|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SwA vs MTOM implementation |
« View previous topic :: View next topic » |
Author |
Message
|
vickas |
Posted: Thu Oct 09, 2014 3:46 am Post subject: SwA vs MTOM implementation |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
Hie All ;
I need some clarification on MTOM vs SwA Implementation in Broker
please correct me if am wrong ,
The basic understanding ( Talking only from implementation perspective) in sending attachments using SwA n MTOM mechanism i have is,
inorder to work with SwA WSDL should have multipartRelated
Code: |
<wsdl:input>
<mime:multipartRelated>
<mime:part>
<soapbind:body use="literal"
parts="ClaimDetail" namespace="http://example.com/mimetypes"/>
</mime:part>
<mime:part>
<mime:content part="ClaimPhoto" type="image/jpeg"/>
</mime:part>
</mime:multipartRelated>
</wsdl:input>
|
and inorder to work with MTOM , the wsdl should have base64 type elements
Code: |
<element name="doc1" type="base64Binary" xmime:expectedContentTypes="image/jpeg"/> |
* secondly , in MTOM , the attachments will be the part of SOAP message . here , we map the attachment directly to the base64 element which is defined in the WSDL. but in SwA , we categorize them as parts .
and what i dont understand in SwA is the following part ( Taken the following example)
Code: |
MIME-Version: 1.0
Content-Type: Multipart/Related;boundary=MIME_boundary;type="application/xop+xml";
start="<mymessage.xml@example.org>";
startinfo="application/soap+xml; action=\"addGuarantorStamp\""
Content-Description: SOAP message with image
--MIME_boundary
Content-Type: application/xop+xml;charset=UTF-8; type "application/soap+xml; action=\"addGuarantorStamp\""
Content-Transfer-Encoding: 8bit
Content-ID: <mymessage.xml@example.org>
<SOAP-ENV:Body>
Content-Type: image/jpeg
Content-Transfer-Encoding: binary
Content-ID: <http://example.org/me.jpg>
POST /foo/mgk HTTP/1.1
Content-Type: multipart/related; boundary=BBB; type="text/xml"; start="mgk";charset=UTF-8
Content-Length: 527
--BBB
content-type:text/xml; charset=UTF-8
content-id: <mgk>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://ns2" xmlns:ns1="http://wss001.miwssoap.broker.mqst.ibm.com"><SOAP-ENV:Header><ns2:h1>hdr1</ns2:h1><ns2:h2><href>cid:XXX</href></ns2:h2></SOAP-ENV:Header><SOAP-ENV:Body><ns1:timesTen>3</ns1:timesTen></SOAP-ENV:Body></SOAP-ENV:Envelope>
--BBB
content-type:application/octet-stream
content-transfer-encoding:quoted-printable
content-id:<XXX>
|
I find many Content-ID here ?? If am not wrong, Content-ID acts like a unique address , why do we have many Content-ID's ??
and what do MIME_boundary define & with what values it can be populated ?? Can someone please take the pain to give me some clarity ? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 09, 2014 5:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Every time you see a MIME boundary, you start a new MIME part.
Each MIME part has it's own content, so each MIME part has it's own content-type and content-id. |
|
Back to top |
|
 |
vickas |
Posted: Thu Oct 09, 2014 9:39 am Post subject: |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
Tq for ua reply MqJeff!
I dont really understand how to generate the MIME request in ESQL inorder to hit the service .
from what i read , the presence/absence of MIME tree doesnt effect the SOAP request .
This is how i tried ,
Code: |
SET OutputRoot.HTTPRequestHeader."Accept-Encoding" = 'gzip,deflate';
SET OutputRoot.HTTPRequestHeader."Content-Type" = 'multipart/related; boundary=vickasBoundary ;type=application/xop+xml';
SET OutputRoot.HTTPRequestHeader."Content-Encoding" = 'base64';
SET OutputRoot.HTTPRequestHeader.SOAPAction = '' ;
SET OutputRoot.Properties.CodedCharSetId = '1208';
SET OutputRoot.Properties.Encoding= InputRoot.Properties.Encoding;
SET OutputRoot.Properties.ContentType = 'application/xop+xml';
CREATE FIELD OutputRoot.MIME TYPE Name;
DECLARE M REFERENCE TO OutputRoot.MIME;
CREATE FIELD M."Content-Type" TYPE NameValue VALUE 'multipart/related; type="application/xop+xml"; boundary=myBoundary';
CREATE FIELD M."Content-ID" TYPE NameValue VALUE 'Penguins.jpg';
CREATE LASTCHILD OF M TYPE Name NAME 'Parts';
CREATE LASTCHILD OF M.Parts TYPE Name NAME 'Part';
DECLARE P1 REFERENCE TO M.Parts.Part;
CREATE FIELD P1."Content-Type" TYPE NameValue VALUE 'application/octet-stream; name=Penguins.jpg';
CREATE FIELD P1."Content-Transfer-Encoding" TYPE NameValue VALUE 'base64';
CREATE LASTCHILD OF P1 TYPE Name NAME 'SOAP';
CREATE LASTCHILD OF P1.SOAP TYPE Name NAME 'Body';
DECLARE B REFERENCE TO P1.SOAP.Body ;
CREATE LASTCHILD OF B.ns:sendImage TYPE Name NAME 'image';
CREATE LASTCHILD OF P1 TYPE Name NAME 'Data';
CREATE LASTCHILD OF P1.Data DOMAIN('BLOB') PARSE(InputRoot.BLOB.BLOB);
|
can u please guide me how to form the request using ESQL for SwA ?? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 09, 2014 10:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
vickas |
Posted: Fri Oct 10, 2014 6:12 am Post subject: |
|
|
Centurion
Joined: 18 Aug 2013 Posts: 126
|
Code: |
SET OutputRoot.Properties.CodedCharSetId = '1208';
SET OutputRoot.Properties.Encoding= InputRoot.Properties.Encoding;
SET OutputRoot.Properties.ContentType = 'application/xop+xml';
SET OutputRoot.SOAP.Body.ns:sendImage.image = BASE64ENCODE(CAST(InputRoot.BLOB.BLOB AS BLOB CCSID 1208));
SET OutputRoot.SOAP.Attachment.Id1.MIME_Headers."Content-Type" = 'application/xop+xml';
SET OutputRoot.SOAP.Attachment.Id1.MIME_Headers."Content-Id" = 'Penguins.jpg';
SET OutputRoot.SOAP.Attachment.Id1.BLOB = InputRoot.BLOB.BLOB;
|
this is how i have written the ESQL to call sWa .(below is the WSDL)
Code: |
<message name="imageMsg">
<part name="image" type="xsd:hexBinary"/>
</message>
<operation name="sendImage">
<input message="tns:imageMsg"/>
<output message="tns:empty"/>
</operation>
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sendImage">
<soap:operation soapAction=""/>
<input>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal"/>
</mime:part>
<mime:part>
<mime:content part="image" type="image/jpeg"/>
</mime:part>
</mime:multipartRelated>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<service name="XXXservice">
<port name="XXX" binding="tns:XXXBinding">
<soap:address
location="http://localhost:XXXX"/>
</port>
|
can someone please guide upon how to generate the request in ESQL ?? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|