Author |
Message
|
Sandman |
Posted: Thu Apr 02, 2009 10:39 am Post subject: Parsing SOAP with Attachments (SwA) Message Over MQ? |
|
|
Centurion
Joined: 16 Oct 2001 Posts: 134 Location: Lincoln, RI
|
Hi,
I would like to receive an SwA message in an MQInput node. I've searched this forum and read all I can in the Broker Info Center. But it all seems to be either about SwA in web service context (using SOAP nodes) or MIME parsing (which apparently isn't usable when processing SwA).
I'm hoping someone can please point me in the right direction. I just want to be able to parse this SwA message on an MQInput node (or ResetContentDescriptor) or even w/ a CREATE FIELD...PARSE ESQL statement so that I can easily access its parts via the logical tree. Is this combination possible?
Thank you. |
|
Back to top |
|
 |
mgk |
Posted: Thu Apr 02, 2009 1:23 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hello.
SwA is actualy a MIME format message, so you should be able to use the MIME parser on the MQInput node. However, I have not tried this and there could be a small issues, but they should be surmountable. So if you do have any problems doing this, feel free to post an example message and the error you receive...
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 |
|
 |
Sandman |
Posted: Fri Apr 03, 2009 6:11 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2001 Posts: 134 Location: Lincoln, RI
|
But the Info Center says:
Quote: |
Typically, the MIME parser handles the majority of uses of MIME in application-to-application messaging, including multipart MIME with a single part and non-multipart MIME documents. However, you should use the SOAP domain for SOAP with Attachments (SwA). |
However, you're right, I managed to parse it fine w/ the MIME parser. So what does the above statement mean?  |
|
Back to top |
|
 |
mgk |
Posted: Fri Apr 03, 2009 7:29 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
It means you should use the SOAP Domain if you can. But for input the SOAP Domain can only be used by the SOAPNodes and the SOAP nodes only support HTTP today. So you have no real choice; you have to use the MIME domain with the MQ message... _________________ 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 |
|
 |
Sandman |
Posted: Fri Apr 03, 2009 7:52 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2001 Posts: 134 Location: Lincoln, RI
|
Thanks mgk. I've got it parsed fine using the MIME parser on the MQInput node.
Now I'm trying to find the right syntax to parse/access the SOAP part of the message.
Do I need to use the ASBITSTREAM function first? I thought not because the SOAP part is already BLOB, isn't it? So can I just do this?
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNS') PARSE(InputRoot.MIME.Parts.Part[1].Data.BLOB.BLOB, InputProperties.Encoding, InputProperties.CodedCharSetId); |
When I try, the debugger shows me "CHARACTER:XML Parsing Errors have occurred" under OutputRoot??? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 03, 2009 8:07 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Sandman wrote: |
Thanks mgk. I've got it parsed fine using the MIME parser on the MQInput node.
Now I'm trying to find the right syntax to parse/access the SOAP part of the message.
Do I need to use the ASBITSTREAM function first? I thought not because the SOAP part is already BLOB, isn't it? So can I just do this?
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNS') PARSE(InputRoot.MIME.Parts.Part[1].Data.BLOB.BLOB, InputProperties.Encoding, InputProperties.CodedCharSetId); |
When I try, the debugger shows me "CHARACTER:XML Parsing Errors have occurred" under OutputRoot??? |
It is already a blob. So the only thing you should be doing wrong is setting the domain to XMLNS instead of XMLNSC...
But you might attempt to use the MIME content information to ensure you've got the right encoding and ccsid. And then check the usertrace to see why it's failing the XML parse. |
|
Back to top |
|
 |
Sandman |
Posted: Fri Apr 03, 2009 8:29 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2001 Posts: 134 Location: Lincoln, RI
|
I tried the same syntax w/ XMLNSC:
Quote: |
( CCHUBF_BRKR.MWS ) An XML parsing error ''Invalid document structure '' occurred on line '1' column '1' when parsing element ''XMLNS''.
Internal error codes are ''186'' and ''''.
This error was reported by the generic XML parser, and is usually the result of a badly formed XML message.
Check that the input XML message is a well-formed XML message that adheres to the XML specification. The line number and column number that are quoted in the message give the position where the parser discovered the problem. However, the actual error might be earlier in the message.
Other possible causes are:
1. A character that is not supported by XML occurs in the instance message data.
XML supports only a subset of control characters; therefore, ensure that no unsupported characters, such as X'00', appear in the document.
2. The Coded Character Set ID that is defined in the message header does not reflect the contents of the instance message.
If the XML document has an XML prologue, the WebSphere MQ CodedCharSetId should be consistent with the XML Encoding field.
3. A reserved XML character appears in the instance message data.
Characters that might be recognized as XML markup - for example, < and & - should be replaced with the corresponding XML entities - < and &. |
Should I be supplying the Encoding from the InputProperties or use the "Content-Transfer-Encoding" from the MIME header? If the latter, how do I access it, as I don't see it in the debugger (like I do the Content-Type)? Also, why don't I see the MIME header fields for anything but the first/top MIME header?
Here is my input message:
Code: |
Content-Type: multipart/related; boundary=IDSMessage
--IDSMessage
Content-Type: text/xml
Content-Transfer-Encoding: 8bit
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<DSIMSG VERSION="100.018.0">
<CTLBLOCK>
<ATTACHMENT TYPE="BINARY">
<DELIMITER>DOCUMENTSTREAM</DELIMITER>
</ATTACHMENT>
<REQTYPE>i_RPDPrintTEST</REQTYPE>
<RESULTQMGR>CCHUBD</RESULTQMGR>
</CTLBLOCK>
<MSGVARS>
<VAR NAME="AGENT">DATA\AGENT.bch</VAR>
...
<VAR NAME="XMLOUTPUT">D:\MRL\DEV1_CORRESPONDENCE\print\0qhszUSoZigFhbi3UqXWRnQl-hysy3WLTXE6vmemKQKHv.dat</VAR>
</MSGVARS>
</DSIMSG>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--IDSMessage
Content-Type: application/ids
Content-Transfer-Encoding: base64
Content-ID: DOCUMENTSTREAM
... binary data ...
--IDSMessage--
|
|
|
Back to top |
|
 |
mgk |
Posted: Fri Apr 03, 2009 11:17 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Can you place a Trace node after the MQInput node and trace $Root and post the output here please.
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 |
|
 |
Sandman |
Posted: Fri Apr 03, 2009 11:22 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2001 Posts: 134 Location: Lincoln, RI
|
All set. I changed the DOMAIN to XMLNSC instead of MIME and it parsed the inner SOAP BLOB fine.
Thank you for your help. |
|
Back to top |
|
 |
|