Hello,
I am using MTOM with https ... and it is working ok with java client .

However when I send a message though SOAP UI and in my endpoint
implementation class I try to access any of the methods of the Datahandler
object  ( see abridged code below) - and please note that call to any of the
following <DataHandler >.getXXX method gives exception ( as that translates
to corresponding call to LazyDataSource.getXXX method ... and looks like
LazyDataSource is null.


@WebService(targetNamespace = "http://webservice.dcca.dell.com";, 
portName = "ObjectMTOMService", serviceName = "ObjectMTOMServiceService")

public class ObjectMTOMServiceImpl implements ObjectMTOMService {
        
    @Resource
    WebServiceContext wsContext;

    public ObjectStoreResp uploadObject(ObjectStoreReq objectReqParam) {
                
        DataHandler objHandler = objectReqParam.getObjData();
                
        try {
                        
                        if (objHandler != null)
                        {
                                                        
                        String objName=objHandler.getName();
                                
                        String contentType=objHandler.getContentType();
                        
                        InputStream iStream= 
objHandler.getDataSource().getInputStream();

                         }
              catch (Exception e) {
                        e.printStackTrace();
                        respParam.setRespCode(-1);
                        return (respParam);
                }
}


Then I get an exception as follows 

java.lang.NullPointerException
        at
org.apache.cxf.attachment.LazyDataSource.getName(LazyDataSource.java:73)
        at javax.activation.DataHandler.getName(DataHandler.java:191)
        at
com.dell.dcca.webservice.objectmtomservice.ObjectMTOMServiceImpl.uploadObject(ObjectMTOMServiceImpl.java:98)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

       ........  <<< removed for bevity >>>

        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597)
        at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1555)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException


The message that SOAPUI  sends is as follows << I have approximated this --
copying and pasting from SOAPUI log >>

POST https://160.110.73.35:8443/ObjectMTOMService/services/ObjectMTOMService
HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml";
start="<[email protected]>"; start-info="text/xml";
boundary="----=_Part_13_756617.1389959552144"
SOAPAction: "http://InteropBaseAddress/interop/header";
MIME-Version: 1.0
Content-Length: 5432
Host: 160.110.73.35:8443
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
 ------=_Part_13_756617.1389959552144"
"Content-Type: application/octet-stream; name=InfantHealthcare.jpg"
 Content-Transfer-Encoding: binary
Content-ID: <images.jpg>
Content-Disposition: attachment; name="images.jpg";
filename="InfantHealthcare.jpg
<< file contents ... >>






--
View this message in context: 
http://cxf.547215.n5.nabble.com/java-lang-NullPointerException-in-org-apache-cxf-attachment-LazyDataSource-getXXX-tp5738692.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to