ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP with Attachment

Post new topic  Reply to topic
 SOAP with Attachment « View previous topic :: View next topic » 
Author Message
prafic
PostPosted: Sat Nov 08, 2014 5:21 am    Post subject: SOAP with Attachment Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Nov 10, 2014 5:16 am    Post subject: Re: SOAP with Attachment Reply with quote

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
View user's profile Send private message
magvlvri
PostPosted: Mon Nov 10, 2014 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message
prafic
PostPosted: Mon Nov 10, 2014 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Nov 10, 2014 1:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SOAP with Attachment
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.