cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viola lu <>
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:

public class GreeterDOMSourcePayloadProvider implements Provider<DOMSource>

    public GreeterDOMSourcePayloadProvider() {

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

and run client against it:

 QName serviceName3 = new QName("",
        QName portName3 = new QName("",

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

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

        Dispatch<DOMSource> dispDOMSrcPayload =

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.

Apache Geronimo

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