cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viola lu <viola...@gmail.com>
Subject Get a null pointer if provider returns null response in payload message mode.
Date Thu, 25 Oct 2012 09:26:35 GMT
Hi, Dev:

 I wrote a sample DOMSource payload provider as below:

@WebServiceProvider()
public class GreeterDOMSourcePayloadProvider implements Provider<DOMSource>
{

    public GreeterDOMSourcePayloadProvider() {
        //Complete
    }

    public DOMSource invoke(DOMSource request) {
        DOMSource response = new DOMSource();
        return null;
    }
}

and run client against it:

 QName serviceName3 = new QName("http://apache.org/hello_world_soap_http",
"SOAPService3");
        QName portName3 = new QName("http://apache.org/hello_world_soap_http",
"SoapPort3");

        SOAPService3 service3 = new SOAPService3(wsdlURL, serviceName3);
        InputStream is3 =
 Client.class.getResourceAsStream("GreetMeDocLiteralReq3.xml");
        if (is3 == null) {
            System.err.println("Failed to create input stream from file "
                               + "GreetMeDocLiteralReq3.xml, please check");
            System.exit(-1);
        }

        SOAPMessage soapReq3 =
MessageFactory.newInstance().createMessage(null, is3);
        DOMSource domReqPayload = new
DOMSource(soapReq3.getSOAPBody().extractContentAsDocument());

        Dispatch<DOMSource> dispDOMSrcPayload =
service3.createDispatch(portName3,

DOMSource.class, Mode.PAYLOAD);
        System.out.println("Invoking server through Dispatch interface
using DOMSource in PAYLOAD Mode");
        DOMSource domRespPayload = dispDOMSrcPayload.invoke(domReqPayload);


but got an null pointer exception in BareOutputInterceptor.

CXF doesn't support null return response in payload mode? I tried it in
message mode, it returns an empty <soap-env:body></soap-env:body>, but not
in payload mode.

I think it should keep same in both mode. Is this a defect of cxf?

You can reproduce it by reusing cxf sample : jaxws_dispatch_provider

Appreciate your comments.
-- 
viola

Apache Geronimo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message