• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Receive attachments using axis1.4

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

;-)
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic