Out of curiosity, why are you adding a WebService annotation onto the stuff used on the client side? The generated code should just work "as is".
Dan On Tue July 21 2009 1:13:48 pm LeftoverLinguine wrote: > 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(Paym >entServiceContract_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.getInterfaceInf >o(ReflectionServiceFactoryBean.java:549) at > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLO >perations(ReflectionServiceFactoryBean.java:557) at > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperatio >ns(JaxWsServiceFactoryBean.java:238) at > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFro >mWSDL(ReflectionServiceFactoryBean.java:333) at > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServi >ceModel(ReflectionServiceFactoryBean.java:437) at > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflecti >onServiceFactoryBean.java:195) at > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFac >toryBean.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(Paym >entServiceContract_CustomBindingPaymentServiceContract_Client.java:50) > > Can anybody provide any insight into fixing these errors? > > Thanks -- Daniel Kulp [email protected] http://www.dankulp.com/blog
