• Post Reply Bookmark Topic Watch Topic
  • New Topic

Receive attachments using axis1.4

 
Lindy Hagan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am newbie to web services.I want to receive attachment from the service. In the service I see the attachment has been created and it is attached with an attachment id.I am having difficulty in receiving the attachment. This is my code

ServiceStub stub = new ServiceStub();
ServiceStub.GetAttachemntsResponse response = stub.getImagesByEventIds(request);
OperationContext oc = stub._getServiceClient().getLastOperationContext();
MessageContext messageContext = oc.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
Attachments attachments = messageContext.getAttachmentMap();
Map map = attachments.getMap();

Iterator iterator = map.keySet().iterator();

while (iterator.hasNext()) {
String key = iterator.next().toString();
String value = map.get(key).toString();


}

Exception in thread "main" org.apache.axiom.om.OMException: java.io.IOException: Attempted read on closed stream.
 
yoel Ben
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same problem.

The solution is in this page.

http://mail-archives.apache.org/mod_mbox/axis-java-dev/200708.mbox/%3C20383136.1188574111481.JavaMail.jira@brutus%3E

The generated Stub call cleanup
Comment it and it will be ok

;-)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!