• 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

SOAP Response with Attachment

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to WebServices. I have few doubts with respect to the web service SOAP attachment response.

1. How can you check whether the returned SOAP response is an attachment or not? Can the 'Content-Type' value helps? If yes, what would be value?

2. Can a response would be delivered with an attachment as well as normal text? My requirement is that, if the response has attachment, ignore the attachment and process the rest (if any content available). What is the value of 'Content-type' in this case?

A reply would be appreciated!!!

Thanks,
Ram
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "whether the returned SOAP response is an attachment"? A response can have an attachment, but it's still a SOAP response like any other.
 
Pattabhi ram
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for quick response Tim!!!

I meant to say that, how can we decide whether the SOAP response consists of an attachment or not? because, I receive an object of SOAP response. I am trying to decide whether my response has an attachment or not.
For that, I am checking whether the 'Content-Type' in the response is 'multipart' or not. If it is 'multipart...' then, I assume the SOAP response consists of attachment. Pleas guide me if my understanding is correct or not.
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd rather use proper SAAJ calls. For example, if you have a javax.xml.soap.SOAPMessage object, you can use the getAttachments method to find out how many attachments there are. On the other hand, if you're planning to ignore any attachments there might be, why bother to find out if there are any :-)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic