Author |
Message
|
prafic |
Posted: Sat Nov 08, 2014 5:21 am Post subject: SOAP with Attachment |
|
|
Newbie
Joined: 08 Nov 2014 Posts: 2
|
Can Someone please tell me how to send an attachment as a SOAP response.
I am trying the below ESQL code, and getting an attachment in the response back in soap UI but if my attachment is a pdf it's not opening. So what is the Content-Type that I need to use if I want to pass any kind of document as an SOAP attachment?
SET OutputRoot.SOAP.Attachment.{cOriginalFileName}.BLOB = InputRoot.BLOB.BLOB;
SET OutputRoot.SOAP.Attachment.{cOriginalFileName}.MIME_Headers."Content-Type" = 'text/xml';
SET OutputRoot.SOAP.Attachment.{cOriginalFileName}.MIME_Headers."Content-Id" = cOriginalFileName;
Hope experts here will be able to guide me.
 |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 10, 2014 5:16 am Post subject: Re: SOAP with Attachment |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
prafic wrote: |
So what is the Content-Type that I need to use if I want to pass any kind of document as an SOAP attachment? |
The one that matches the attachment. Seriously. You can't just use a generic one; in the example you quoted "text/xml" doesn't match a PDF does it? But it would match if you had an XML document as an attachment.
If the attachment is a PDF I'd try "application/pdf" but I'd also put some research into what Content Type means if I were you. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
magvlvri |
Posted: Mon Nov 10, 2014 11:36 am Post subject: |
|
|
Apprentice
Joined: 07 Nov 2014 Posts: 26
|
Copy pasted from Infocenter.....
text/plain Typically used for a typical mail or news message. text/richtext is also common.
text/xml Typically used with SwA (SOAP with Attachments).
application/octet-stream Used where the message is an unknown type and contains any kind of data as bytes.
application/xml Used for application-specific xml data.
x-type Used for non-standard content type. It must start with the characters x-.
image/jpeg Used for images. image/jpeg and image/gif are common image formats that are used
multipart/related Used for multiple related parts in a message. Specifically used with SwA (SOAP with Attachments)
multipart/signed Used for multiple related parts in a message including signature. Specifically used with S/MIME
multipart/mixed Used for multiple independent parts in a message |
|
Back to top |
|
 |
prafic |
Posted: Mon Nov 10, 2014 12:07 pm Post subject: |
|
|
Newbie
Joined: 08 Nov 2014 Posts: 2
|
Thanks Victor & magvlvri for your reply.
Victor , I did try with application/pdf to pass a PDF attachment and it worked.But wanted to find out if there is anything generic. Not sure if something generic really exists.
Magvlvri, thanks for putting this together but, I saw this in infocenter.
 |
|
Back to top |
|
 |
Vitor |
Posted: Mon Nov 10, 2014 1:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
prafic wrote: |
Victor , I did try with application/pdf to pass a PDF attachment and it worked.But wanted to find out if there is anything generic. Not sure if something generic really exists. |
Of course something generic exists:
Code: |
application/octet-stream Used where the message is an unknown type and contains any kind of data as bytes.
|
The problem (for want of a better word) is that if you describe the attachment in generic terms you can only open it in a generic way. If the attachment is of a specific type (like a PDF) it can only be opened in a specific way.
Perhaps if you try and explained more what you were trying to do? If you're looking for a method by which the attachment could be automagically processed or the content automagically set, I fear you'll be disapointed but maybe you have something else in mind..? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|