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.