So I generated java classes from a WSDL file using WSDL2Java. I set up the
main method to log in with a username and password(
http://arsenalist.com/2007/07/31/cxf-ws-security-using-jsr-181-interceptor-annotations-xfire-migration/#comment-794
like this ). I also added a WebService annotation to the Service class.
Without giving the annotation any arguments I get the following error:
Exception in thread "main" javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException: Could not find
portType named {http://unknown.namespace/}PaymentService
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:297)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:290)
at javax.xml.ws.Service.getPort(Unknown Source)
at
PaymentServiceContract_CustomBindingPaymentServiceContract_Client.main(PaymentServiceContract_CustomBindingPaymentServiceContract_Client.java:50)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find portType named {http://unknown.namespace/}PaymentService
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.getInterfaceInfo(ReflectionServiceFactoryBean.java:549)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:557)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:238)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:333)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:437)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:195)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:411)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:295)
... 3 more
When I provide the arguments(name->wsdl:portType name,
serviceName->wsdl:service name, portName->wsdl:port name,
enpointInterface->location of the generated endpoint interface java file,
and wsdlLocation pointing to the location of the file) I get this error:
Exception in thread "main" javax.xml.ws.WebServiceException: Unable to load
the class PaymentService.
at
org.apache.cxf.jaxws.ServiceImpl.getPortTypeName(ServiceImpl.java:542)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:405)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:295)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:290)
at javax.xml.ws.Service.getPort(Unknown Source)
at
PaymentServiceContract_CustomBindingPaymentServiceContract_Client.main(PaymentServiceContract_CustomBindingPaymentServiceContract_Client.java:50)
Can anybody provide any insight into fixing these errors?
Thanks
--
View this message in context:
http://www.nabble.com/Problem-running-generated-java-files-from-wsdl2java-tp24591869p24591869.html
Sent from the cxf-user mailing list archive at Nabble.com.