You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Kumuda Bhaskar <Ku...@symphonysv.com> on 2006/01/24 11:44:00 UTC

getResponseMessage is throwing NullPointerException

Hello,

I have created the stubs for the .net webservice using WSDL2JAVA.

I have to send an attachment to the webservice.

MessageContext ctx = AxisEngine.getCurrentMessageContext();

Message m = ctx.getResponseMessage();

Attachments ats = m.getAttachmentsImpl();

ats.setSendType(Attachments.SEND_TYPE_DIME);

AttachmentPart ap = null;

try {

            ap = (AttachmentPart) ats.createAttachmentPart();

} catch (AxisFault e) {

            // TODO Auto-generated catch block

e.printStackTrace();

}

ap.setContent(getStream(), null);

m.addAttachmentPart(ap);

 

I am getting NullPointerException at line 2. that is
ctx.getResponseMessage();

 

I browsed and found that it could be due to Classloader problem

 

Actually I have a war file, which is having the axis.jar file in the
web-inf/lib folder

And also I have the webservices.jar which have these stubs in the same
lib folder.

 

I also have activation.jar and mail.jar in the lib folder.

 

I am not able to solve this problem

 

Can anyone please help me in resolving this.

 

 

Thanks and Regards

KumudaRajarshi