You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Grégory Le Bonniec <gr...@gmail.com> on 2010/03/03 20:15:41 UTC

probleme with Client and Header

Hi

I have created a small Web Service in Code-First
The content of the SEI is :

@WebService(targetNamespace = "http://www.test.partenaires.com/business")
public interface BusinessService {

    @WebResult(name = "retour", targetNamespace = "
http://www.test.partenaires.com/business")
    public int reserver(
            @WebParam(name = "id", targetNamespace = "
http://www.test.partenaires.com/business", header=true, mode=Mode.IN) String
id,
            @WebParam(name = "depart", targetNamespace = "
http://www.test.partenaires.com/business") String depart,
            @WebParam(name = "arrivee", targetNamespace = "
http://www.test.partenaires.com/business") String arrivee,
            @WebParam(name = "date", targetNamespace = "
http://www.test.partenaires.com/business") Date date)
            throws VoyageNonDisponibleException;
}

If I call this service from SOAPUI per example, there is no problem.

If I try call to call this service from a client code :

URL wsdlURL = new URL(
                    "http://localhost:8080/services/business?wsdl");
            QName serviceName = new QName(
                    "http://www.test.partenaires.com/business",
                    "BusinessServiceImplService");

            Service service = Service.create(wsdlURL, serviceName);
            BusinessService client = service.getPort(BusinessService.class);

            System.out.println(client.reserver("REF_001", "Paris", "Rennes",
                    new Date()));

I've got this error :

java.lang.NullPointerException
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeClassInfo(ReflectionServiceFactoryBean.java:754)
    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:222)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:674)
    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:258)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:424)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
    at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:411)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:296)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:291)
    at javax.xml.ws.Service.getPort(Service.java:161)
    at com.test.ws.ConsumerVoyage.main(ConsumerVoyage.java:20)

Apparently the problem is coming from the header annotation : if I remove
it, no NPE is throwed

Any idea ?

Greg

Re: probleme with Client and Header

Posted by Grégory Le Bonniec <gr...@gmail.com>.
Bug resolved : https://issues.apache.org/jira/browse/CXF-2692

Greg


2010/3/3 Grégory Le Bonniec <gr...@gmail.com>

> Hi
>
> I have created a small Web Service in Code-First
> The content of the SEI is :
>
> @WebService(targetNamespace = "http://www.test.partenaires.com/business")
> public interface BusinessService {
>
>     @WebResult(name = "retour", targetNamespace = "
> http://www.test.partenaires.com/business")
>     public int reserver(
>             @WebParam(name = "id", targetNamespace = "
> http://www.test.partenaires.com/business", header=true, mode=Mode.IN)
> String id,
>             @WebParam(name = "depart", targetNamespace = "
> http://www.test.partenaires.com/business") String depart,
>             @WebParam(name = "arrivee", targetNamespace = "
> http://www.test.partenaires.com/business") String arrivee,
>             @WebParam(name = "date", targetNamespace = "
> http://www.test.partenaires.com/business") Date date)
>             throws VoyageNonDisponibleException;
> }
>
> If I call this service from SOAPUI per example, there is no problem.
>
> If I try call to call this service from a client code :
>
> URL wsdlURL = new URL(
>                     "http://localhost:8080/services/business?wsdl");
>             QName serviceName = new QName(
>                     "http://www.test.partenaires.com/business",
>                     "BusinessServiceImplService");
>
>             Service service = Service.create(wsdlURL, serviceName);
>             BusinessService client =
> service.getPort(BusinessService.class);
>
>             System.out.println(client.reserver("REF_001", "Paris",
> "Rennes",
>                     new Date()));
>
> I've got this error :
>
> java.lang.NullPointerException
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeClassInfo(ReflectionServiceFactoryBean.java:754)
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperation(JaxWsServiceFactoryBean.java:222)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:674)
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:258)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:424)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:278)
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
>     at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:411)
>     at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:296)
>     at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:291)
>     at javax.xml.ws.Service.getPort(Service.java:161)
>     at com.test.ws.ConsumerVoyage.main(ConsumerVoyage.java:20)
>
> Apparently the problem is coming from the header annotation : if I remove
> it, no NPE is throwed
>
> Any idea ?
>
> Greg
>
>