org.apache.cxf.jaxws.EndpointImpl does not set endpoint name in service factory
-------------------------------------------------------------------------------

                 Key: CXF-541
                 URL: https://issues.apache.org/jira/browse/CXF-541
             Project: CXF
          Issue Type: Bug
          Components: JAX-WS Runtime
    Affects Versions: 2.1
         Environment: Windows
            Reporter: Paul Taylor
             Fix For: 2.1


Trying to publish an endpoint using a provider as implementation object  
results in a NullPointerException during EndpointImpl.publish().

        Bus bus = BusFactory.getDefaultBus();
        String endpointId = null;
        String wsdl = "testutils/hello_world_soap12.wsdl";
        EndpointImpl ep = new EndpointImpl(bus, impl, endpointId, wsdl);
        String namespace = "http://apache.org/hello_world_soap12_http";;
        QName endpointName = new QName(namespace, "SoapPort");
        QName serviceName = new QName(namespace, "SOAPService");
        ep.setEndpointName(endpointName);
        ep.setServiceName(serviceName);
        ep.publish();

Exception is:

java.lang.NullPointerException
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:203)
        at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:187)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:189)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:225)
        at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:129)
        at 
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:78)
        at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:84)
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:307)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:200)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:388)
        at org.apache.cxf.systest.pft.Server.run(Server.java:55)
        at 
org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestServerBase.java:61)
        at org.apache.cxf.systest.pft.Server.main(Server.java:71)

Fix is to add the following to EndpointImpl.doPublish(String addr):

        if (endpointName != null) {
            serverFactory.getServiceFactory().setEndpointName(endpointName);
        }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to