Dear community,
migrating my webservice clients from Axis to CXF, in order to
contribute a new webservice to trunk, is being very difficult. I
receive errors at runtime and can't find any information about them
in Google neither StackOverflow.
I have done a simple client to login into a trunk server with WS
enabled
(
https://trunk-mysql.nightly.sakaiproject.org/sakai-ws/soap/login?wsdl)
and when I launch it, I receive an exception. Catalina.out has no
errors.
Below I paste my client and the exception stacktrace. If somebody
can tell me what is happening or send me a different Java client
that works, I would be very grateful.
Thanks in advance.
Best regards.
My client:
import
org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
import org.apache.cxf.endpoint.Client;
public class LoginCXF
{
final String server =
"https://trunk-mysql.nightly.sakaiproject.org/";
final String urlLogin =
"https://trunk-mysql.nightly.sakaiproject.org/sakai-ws/soap/login?wsdl";
public static void main(String[] args)
{
try
{
LoginCXF myApp = new LoginCXF();
try
{
JaxWsDynamicClientFactory dcf =
JaxWsDynamicClientFactory.newInstance();
Client client =
dcf.createClient(myApp.urlLogin);
Object[] res = client.invoke("login",
"admin", "admin" );
System.out.println("Session ID:
"+(String)res[0]+"<br/>");
}
catch (Exception e )
{
System.out.println("Error!! "+e);
e.printStackTrace();
}
}
catch (Exception e)
{
System.err.println(e.toString());
}
}
}
And the exception I receive:
Exception in thread "main" java.lang.NoSuchMethodError:
javax.wsdl.xml.WSDLReader.readWSDL(Ljavax/wsdl/xml/WSDLLocator;Lorg/w3c/dom/Element;)Ljavax/wsdl/Definition;
at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)
at
org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:74)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:296)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:241)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:234)
at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:189)
at LoginCXF.main(LoginCXF.java:18)
--
Daniel Merino Echeverría
daniel...@unavarra.es
Gestor de E-learning - Centro Superior de Innovación Educativa.
Tfno: 948-168489 - Universidad Pública de Navarra.