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 » SwA response

Post new topic  Reply to topic
 SwA response « View previous topic :: View next topic » 
Author Message
pottas
PostPosted: Thu Apr 11, 2013 11:51 pm    Post subject: SwA response Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

I am running the following:
WebSphere Message Broker Toolkit - Message Broker

Version: 7.0.0.3
Build id: 7.0.0.3-20110825_1025

So this is my requirement:
I have a SOAP request coming in, I make a call to our Host gathering the data, once I have all the data, I need to parse it into a BLOB, do a BASE64 Encoding on it, GZIP it, and attach it to a response message.

In short, I don't really know what parameters to set for the SOAP attachment, I can build the response, that's the easy part, but when it comes to attaching my stuff to the response, I have an issue.


Code:
      -- Set up the message set properties
      SET OutputRoot.Properties.MessageSet = 'KBQQQNC002001';
      SET OutputRoot.Properties.MessageType = 'ProfileChangeExportRs';
      SET OutputRoot.Properties.MessageFormat = 'XML1';

      SET OutputRoot.HTTPRequestHeader = NULL;
      SET OutputRoot.HTTPResponseHeader = NULL;      

      SET OutputRoot.MQMD = InputRoot.MQMD;
      SET OutputRoot.MQMD.Expiry = 60000;
      -- Setup the MQRFH2
      SET OutputRoot.MQRFH2 = Environment.variables.originalRequest.MQRFH2;
      DECLARE vBLOB BLOB;
      SET vBLOB = CAST('<aaa>xxx</aaa>' AS BLOB CCSID 1208);
      SET OutputRoot.Properties.ContentType = 'multipart/related; boundary=myBoundary';

      -- Build a successful response:
      SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:ResultInfo.pbiv:ResultCode = 'R00';

      SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:AttachmentInfo.pbiv:AttachmentContent = 'XML';
      SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:AttachmentInfo.pbiv:LineCount         = '10';

      SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:AttachmentInfo.pbiv:Attachment      = vBLOB;


I have done a number of different options, and done a heck of a lot of research, but I just cannot get the right combination....
Back to top
View user's profile Send private message
smdavies99
PostPosted: Fri Apr 12, 2013 12:47 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

You don't tell what error you are getting? This may help
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
pottas
PostPosted: Fri Apr 12, 2013 1:06 am    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

At this stage, I get no error in theresponse, I get the response, with the Attachment as part of the Soap reply body:

Code:

      <NS1:ProfileChangeExportRs xmlns:NS1="http://contracts.it.nednet.co.za/services/business-execution/2013-05-12/ProfileBeneficiaryImport">
         <NS1:ResultInfo>
            <NS1:ResultCode>R00</NS1:ResultCode>
         </NS1:ResultInfo>
         <NS1:AttachmentInfo>
            <NS1:AttachmentContent>XML</NS1:AttachmentContent>
            <NS1:LineCount>10</NS1:LineCount>
            <NS1:Attachment>3c6161613e7878783c2f6161613e</NS1:Attachment>
         </NS1:AttachmentInfo>
      </NS1:ProfileChangeExportRs>



I would want something like:

Code:

      <NS1:ProfileChangeExportRs xmlns:NS1="http://contracts.it.nednet.co.za/services/business-execution/2013-05-12/ProfileBeneficiaryImport">
         <NS1:ResultInfo>
            <NS1:ResultCode>R00</NS1:ResultCode>
         </NS1:ResultInfo>
         <NS1:AttachmentInfo>
            <NS1:AttachmentContent>XML</NS1:AttachmentContent>
            <NS1:LineCount>10</NS1:LineCount>
            <NS1:Attachment>cid:0001</NS1:Attachment>
         </NS1:AttachmentInfo>
      </NS1:ProfileChangeExportRs>


...and the the attachment as 'application/octet-stream', Part '0001', Type 'XOP'

As I mentioned, please be patient with this, I know it is going to be a simple solution, and it is just a matter of setting specific (the correct) parameters to the Output message, but I just simply cannot get my stuff right.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Fri Apr 12, 2013 1:14 am    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

First of all you have to clarify to your self and us what are you trying to do. How does the wsdl describe the interface you are trying to implement?


Why are you playing with ContentType -property? If you are responding with XMLNSC domain it perhaps should be set to 'text/xml'.

If you need to use multipart messages you should perhaps use MIME -domain (or create your own implementation with BLOB -domain).

--
Marko
Back to top
View user's profile Send private message Visit poster's website
kimbert
PostPosted: Fri Apr 12, 2013 3:55 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I agree with marko.

If you want this in your output message:
Code:
<NS1:Attachment>cid:0001</NS1:Attachment>

then change your ESQL to this:
Code:
SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:AttachmentInfo.pbiv:Attachment      = 'cid:0001';

I am fairly sure that my answer is not helpful, but I don't understand what you are trying to achieve. If you explain your problem in more detail then we will be able to assist.
Back to top
View user's profile Send private message
mgk
PostPosted: Sat Apr 13, 2013 8:09 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

SwA is directly supported by the SOAP nodes. If you are using a SOAPInput and SOAPReply pair then you can create the SwA message by creating the attachments under the SOAP.Attachment.<cid>.BLOB folder - there is an example in an article on developerworks, but the site is not up at present so I can't post a link.

If you are not using the SOAP nodes you can either change to use the SOAP nodes (should be the simplest way) or use the MIME parser to build the SwA tree yourself.

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
pottas
PostPosted: Sun Apr 14, 2013 11:59 pm    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

mgk,

Thanks for the response.

I believe you got some of the details from our company already.

If it would be of any help, this is a short run-down of what we want to achieve:

SoapRequest from Service Requestor;

Multiple calls to our back-end systems, storing all results in the environment tree;

Compiling a SOAP Response with all the resultant data in attachment in an XML format, building a SOAP response message, attaching the mentioned, but first encoding and gzip-ping the attachment.

So, I would think the developerworks article will be very helpful, if the link is up again, please post it, and I can give it a bash.

Thanks for all assistance so far.

Jacques
Back to top
View user's profile Send private message
goffinf
PostPosted: Mon Apr 15, 2013 12:43 am    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

If you don't fancy using the SOAP nodes for whatever reason, constructing a SwA message is really very straight-forward using MIME. There's nothing special about SwA versus any other multipart MIME message other than the convention that the first part contains the SOAP Envelope.

HTHs

Fraser.
Back to top
View user's profile Send private message
pottas
PostPosted: Tue Apr 16, 2013 11:19 pm    Post subject: Reply with quote

Disciple

Joined: 27 Oct 2005
Posts: 185
Location: South Africa

OK, I am a lot closer to a solution now. The attachment I intend to send back should be base64 Binary, g-zipped. So I first g-zip it, and then do a BASE64ENCODING on it.
The attachment should go back to the requestor as a .gz, XOP, and i believe an 'application/octet-stream' content type.
So, I know I need to set properties somewhere in theresponse, but I am not too sure to what I must set it.

So, I have built a response SOAP message with an attachment, but I get a failure that states the following exception:

Code:
ExceptionList
   RecoverableException
         File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbDataFlowNode.cpp
         Line:INTEGER:1083
         Function:CHARACTER:ImbDataFlowNode::createExceptionList
         Type:CHARACTER:ComIbmMQInputNode
         Name:CHARACTER:pbi/client/pbiOutputAdapter/pbiProfBenImpSOAPReplyRouter#FCMComposite_1_4
         Label:CHARACTER:pbi.client.pbiOutputAdapter.pbiProfBenImpSOAPReplyRouter.PBI.ENT.SOAP.RES
         Catalog:CHARACTER:BIPmsgs
         Severity:INTEGER:3
         Number:INTEGER:2230
         Text:CHARACTER:Node throwing exception
         RecoverableException
               File:CHARACTER:F:\build\S700_P\src\WebServices\WSLibrary\ImbSOAPReplyNode.cpp
               Line:INTEGER:391
               Function:CHARACTER:ImbSOAPReplyNode::evaluate
               Type:CHARACTER:ComIbmSOAPReplyNode
               Name:CHARACTER:pbi/client/pbiOutputAdapter/pbiProfBenImpSOAPReplyRouter#FCMComposite_1_7
               Label:CHARACTER:pbi.client.pbiOutputAdapter.pbiProfBenImpSOAPReplyRouter.SOAP Reply
               Catalog:CHARACTER:BIPmsgs
               Severity:INTEGER:3
               Number:INTEGER:3752
               Text:CHARACTER:Error occurred in ImbSOAPReplyHelper::makeSOAPReply()
               ParserException
                     File:CHARACTER:F:\build\S700_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
                     Line:INTEGER:1304
                     Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElementsInner
                     Type:CHARACTER:
                     Name:CHARACTER:
                     Label:CHARACTER:
                     Catalog:CHARACTER:BIPmsgs
                     Severity:INTEGER:3
                     Number:INTEGER:3605
                     Text:CHARACTER:SOAP tree cannot be serialized
                     ParserException
                           File:CHARACTER:F:\build\S700_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
                           Line:INTEGER:1207
                           Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElementsInner
                           Type:CHARACTER:
                           Name:CHARACTER:
                           Label:CHARACTER:
                           Catalog:CHARACTER:BIPmsgs
                           Severity:INTEGER:3
                           Number:INTEGER:3608
                           Text:CHARACTER:invalid data for SOAP.Attachment.<Content-Id>.BLOB
                           Insert
                                 Type:INTEGER:5
                                 Text:CHARACTER:BLOB


My response esql configures does the following:

Code:

      DECLARE soapVersion CHARACTER InputRoot.MQRFH2.usr.client.soapNamespace;
      DECLARE ns NAMESPACE soapVersion;   

      DECLARE vFieldName CHARACTER InputRoot.Properties.MessageType;
      DECLARE vFieldNameSpace CHARACTER InputRoot.MQRFH2.usr.nameSpace;
      DECLARE ns1 NAMESPACE vFieldNameSpace;
      
      -- Set the ContentType in the response:
--      SET OutputRoot.HTTPReplyHeader."Content-Type" = 'multipart/related; boundary=myBoundary';      

      IF EXISTS( InputRoot.MRM.*[]) = true THEN
         SET OutputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:{vFieldName} = InputRoot.MRM;
      ELSEIF EXISTS( InputRoot.SOAP.*[]) = true THEN
         SET OutputRoot.SOAP = InputRoot.SOAP;
         SET OutputRoot.Properties.ContentType = 'application/xop+xml';
      ELSEIF FIELDNAME( InputRoot.XMLNSC.*[1]) = 'Envelope' THEN
         SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
      ELSE
         SET OutputRoot.XMLNSC.ns:Envelope.ns:Body = InputRoot.XMLNSC;
--         SET OutputRoot = InputRoot;
      END IF;

      -- Set the http reply identifier
       SET OutputLocalEnvironment.Destination.SOAP.Reply.ReplyIdentifier = CAST(InputRoot.MQRFH2.usr.client.httpRequestIdentifier AS BLOB);

--Just testing:
       SET OutputRoot.Properties.ContentType = 'application/xop+xml';--multipart/related; type=text/xml; boundary=myBoundary
       
        SET OutputRoot.SOAP.Attachment.Id1.BLOB = InputRoot.MQRFH2.usr.attachment.BLOB;--X'3c48656c6c6f576f726c645c3e';
        SET OutputRoot.SOAP.Attachment.Id1.MIME_Headers."Content-Type" = 'application/xop+xml';
        SET OutputRoot.SOAP.Attachment.Id1.MIME_Headers."Content-Id" = 'Id1.gz';
      -- Set the http reply identifier
       SET OutputLocalEnvironment.Destination.SOAP.Reply.ReplyIdentifier = CAST(InputRoot.MQRFH2.usr.client.httpRequestIdentifier AS BLOB);

      -- Remove the MQRFH2 headers
      SET OutputRoot.MQRFH2 = NULL;

      -- Set the correct CCSID and Encoding:
      SET OutputRoot.Properties.Encoding          = 273;
      SET OutputRoot.Properties.CodedCharSetId    = 1208;


Also, the properties that is set for the SOAP response:

Code:

Properties
   MessageSet:CHARACTER:KBQQQNC002001
   MessageType:CHARACTER:ProfileChangeExportRs
   MessageFormat:CHARACTER:XML1
   Encoding:INTEGER:273
   CodedCharSetId:INTEGER:1208
   Transactional:BOOLEAN:true
   Persistence:BOOLEAN:false
   CreationTime:TIMESTAMP:   ExpirationTime:TIMESTAMP   Priority:INTEGER:0
   ReplyIdentifier:BLOB:[B@f000f0
   ReplyProtocol:CHARACTER:MQ
   Topic:CHARACTER:
   ContentType:CHARACTER:application/xop+xml
   IdentitySourceType:CHARACTER:
   IdentitySourceToken:CHARACTER:
   IdentitySourcePassword:CHARACTER:
   IdentitySourceIssuedBy:CHARACTER:
   IdentityMappedType:CHARACTER:
   IdentityMappedToken:CHARACTER:
   IdentityMappedPassword:CHARACTER:
   IdentityMappedIssuedBy:CHARACTER:


...and the actual SOAP response message:

Code:

SOAP
   Body
         ProfileChangeExportRs
               NS1:CHARACTER:http://contracts.it.nednet.co.za/services/business-execution/2013-05-12/ProfileBeneficiaryImport
               ResultInfo
                     ResultCode:CHARACTER:R00
               AttachmentInfo
                     AttachmentContent:CHARACTER:XML
                     LineCount:CHARACTER:10
   Attachment
         Id1
               
BLOB:CHARACTER:H4sIAAAAAAAAALVVTY+iQBD9K5u5K+LHhbgkCmPGxF
GjbjZ77GmKsRPoZrqLie6v36aB5kP2aMKl3qt69ZrqgmUmRcwSWG+CK+Gf
8Mq//OWxi215LPzl/ux6ZXzIQBJkgv+4pQlXnmZ+vlwRM89xqOAoCUU1Zjjm
EHHAMRXjv8RRIL8ZBeXQXKFIQY4sMp24s9FkMXKnTt0aOMSMMiLvL/4qDJfO
QPvC09Rbb85IEKyX6XO9BJfCi21beJhVxn5pkR1TaK3Mnmql1zkEJCxRJbyN
gCPD+176buG3g5iMomRPUqh5G1v2JBLwX8+HhjeI5VfUDKGaTgcrc7JIv6D
L2Z9OJu7IPJeJ65mnqqgzTP4qx2txHA7JNqxtdcESGziz8ziFQnSux/QuoirNzm
X+7Lnovg1SH6YP9vNOEIMETmEgveGqU13uGfjrcFNllnHFNWO1kWHOQmIgI
svZ2LArStGoBKuStoCl93n6AbIubyE2400kUftePaAmM4SY5AmGGpLFKn/b7
AGmXRH8tyLoV5zgK2cSlJ6QiA/x5eajzKGseeRMyW+iqwOSYS5B3yX5CapV
NMRWL3zHUoat/Zt7WxXq4F6sgzbUiHTxqtxARqOZWgurBN/1Vb0OSnYZe+0
N2JPtoLUwue3FMUU1JN3j2gc+gmQi8sPdn1q9Ddc2jAC5p/rro1o+OnCnvr3T
3f0tNBdemGcJo/q7seWR3ejFUze6fiPd5trh4I/SGfil/gPRJR4PZwcAAA==
               MIME_Headers
                     Content-Type:CHARACTER:application/xop+xml
                     Content-Id:CHARACTER:Id1.gz


So, please just help me with thesettings/properties that I am missing, also, mgk, you mentioned an article on the developerwors link, can you provide the url for it? I see the site is up and running again, but I am not sure what article you had in mind.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Apr 17, 2013 3:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You don't seem to have understood the concept.
try and read http://www.ibm.com/developerworks/webservices/library/ws-soapatt/
Also read and understand http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ac64020_.htm

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Wed Apr 17, 2013 3:17 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

Here is the link I was talking about:
Quote:
http://www.ibm.com/developerworks/webservices/library/ws-soapnode2/index.html


You should not need to set the mime content type - just set the BLOB and let the node take care of the rest as the article describes. However, I noticed you were trying to set the type to "XOP" which is actually MTOM, and not SwA. You must choose either MTOM or SwA and not try to mix them. The article also talks about MTOM as well...

Also, you code create two parsers - XMLNSC and SOAP. You should pick one (SOAP) and use that in this case.


Kind regards.
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
deloxx
PostPosted: Tue Apr 30, 2013 4:27 pm    Post subject: Reply with quote

Newbie

Joined: 30 Apr 2013
Posts: 1

I did change my ESQL with this code and it's working:
"SET OutputRoot.XMLNSC.pbiv:ProfileChangeExportRs.pbiv:AttachmentInfo.pbiv:Attachment = 'cid:0001';"
--deloxx
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 » SwA response
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.