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 Vivek Singhai <vi...@adp.com> on 2005/04/18 12:48:51 UTC

AXIS Client gives Null Pointer Exception in SOAP message that has attachments

Hi All,
	I'm trying to add Attachment in a wsdl2java generated implementation
class.

	The code is 

	public String execute() throws java.rmi.RemoteException
	{
		DataHandler dh = null;
        	try
		{
        		dh = new DataHandler(new FileDataSource(fileName));
		}
		catch (Exception e)
		{
			System.out.println(e);
		}
		//Is this piece of code OK or do I need to set something
else.
		org.apache.axis.Message resmessage =
MessageContext.getCurrentContext().getResponseMessage();
	
resmessage.addAttachmentPart(resmessage.createAttachmentPart(dh));  
		     
		return "Test Response Message";

	}


	On the client side I get null pointer exception in the AXIS code.


This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify postmaster@adpwilco.com immediately. You should not copy it or use it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of ADP.