After writing some code and after reading many articles on the web I am in a confused
state.
I have a web service with the following method (I have registered the
serializers and deserializers)
public DataHandler getFile()
{
...
return dataHandler;
}
how different is the above when compared to returning the
file the following way? -
public void getFile()
{
org.apache.axis.MessageContext messageContext =
org.apache.axis.MessageContext.getCurrentContext();
org.apache.axis.Message responseMessage =
messageContext.getResponseMessage();
//responseMessage.getAttachmentsImpl().setSendType(org.apache.axis.attachments.Attachments.SEND_TYPE_DIME);
responseMessage.addAttachmentPart(new
AttachmentPart(dh));
}
The reason I am asking the question is because I thought that the
second scenario was an attachment; the binary data being outside the soap message
whereas in the first case ... the binary data was in the soap message thus being more
inefficient. I compared the soap messages using tcpmon in all these approaches and
they seemed similar in either approach. Looks like I have got into a state where
everything is confused with so much information to make sense of so I need SOMEBODY
to HELP me straighten my understanding. Same goes for input of a file to a web
service. What is different between -
public acceptFile(DataHander dh)
{
}
as compared to-
public acceptFile()
{
1. where I get the attachment out of the current
message context here after I used the addAttachment() method on the client
side before invoking this web
service method.
}
Thanks
Srinivas