Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAP Response with Attachment

 
Pattabhi ram
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Tim Moores
Bartender
Posts: 2849
46
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 2849
46
  • Mark post as helpful
  • send pies
  • 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 :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic