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 balachandra <ch...@gmail.com> on 2008/09/25 14:43:04 UTC
Axis server is not loading incomming attachments
Hi All,
Im invoking a axis2 service in REST style using HttpClient. and its
working fine but when i send any attachment they are not available through
message context. below are the code listings i used
Client side code:
String urlString =
"http://localhost:8080/app/services/Customservice/simpleServiceToPing";
HttpClient client = new HttpClient();
PostMethod filePost = new PostMethod(urlString);
filePost.addParameter("booleanParam", "true");
FilePart filePart = new FilePart("simple.txt", new
File("c:\\simple.txt"));
Part[] parts = {filePart};
RequestEntity sds = new MultipartRequestEntity(parts,
filePost.getParams());
filePost.setRequestEntity(sds);
int statusCode = client.executeMethod(filePost);
System.out.println("Status details "+statusCode);
service side code:
public Object simpleServiceToPing(String booleanParam){
MessageContext messageContext =
MessageContext.getCurrentMessageContext();
Attachments attachment = messageContext.getAttachmentMap();
String[] contentIds = attachment.getAllContentIDs();
System.out.println(contentIds.toString());
return null;
}
i have been working on this quite a long. could somebody please help me on
this...
Thank you,
bala.
--
View this message in context: http://www.nabble.com/Axis-server-is-not-loading-incomming-attachments-tp19668747p19668747.html
Sent from the Axis - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org