Author |
Message
|
brokerDev |
Posted: Thu Jan 25, 2007 4:28 pm Post subject: No valid body of the document could be found |
|
|
Acolyte
Joined: 21 Jun 2006 Posts: 53
|
Hi,
We are using MB v5. I am trying to pass the following bit of xml as a parameter to a stored procedure.
<Order xmlns="http://aaa.a.xxx.com" xmlns:ns1="http://bbb.b.xxx.com" xsi:schemaLocation="http://aaa.a.xxx.com
X:\....................">
<Field1>
...
</Field1>
<Field2>
...
<Field2>
<Field3>
<RouteID>123456789</RouteID>
<GeometryDefinition>
<Status>
<Coordinates>
<ns1:coord>
<ns1:X>3.1415926535897932384626433832795</ns1:X>
<ns1:Y>3.1415926535897932384626433832795</ns1:Y>
<ns1:Z>3.1415926535897932384626433832795</ns1:Z>
</ns1:coord>
<ns1:mid>abcdef</ns1:mid>
<ns1:Name>String</ns1:Name>
</Coordinates>
<GreenLight>true</GreenLight>
</Status>
</GeometryDefinition>
</Field3>
</Order>
I have tried variations of the following bit of ESQL to cast the message as BLOB (the relevant variable of the stored proc has been so defined).
DECLARE inRef REFERENCE TO InputRoot.XMLNS.*[1];
DECLARE myNS NAMESPACE 'http://http://aaa.a.xxx.com';
MOVE inRef FIRSTCHILD NAMESPACE * NAME 'Field3';
DECLARE ab BLOB ASBITSTREAM(inRef.{myNS}:GeometryDefinition);
When I run the flow in debug mode, I keep on getting a runtime error when I get to the last line above - "No valid body of the document could be found".
Does anyone have any suggestions as to where I'm going wrong? I'm sure it's probably something very silly
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 25, 2007 4:42 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You aren't setting all the right options on ASBITSTREAM. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
brokerDev |
Posted: Thu Jan 25, 2007 5:29 pm Post subject: |
|
|
Acolyte
Joined: 21 Jun 2006 Posts: 53
|
Have tried the following -
DECLARE BitStream BLOB CAST(ASBITSTREAM(inRef.{myNS}:GeometryDefinition) AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);
and also
DECLARE ab BLOB ASBITSTREAM(inRef.{myNS}:GeometryDefinition Encoding InputRoot.MQMD.Encoding CCSID InputRoot.MQMD.CodedCharSetId);
but still getting the same error... |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 25, 2007 5:31 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to specify OPTIONS clause. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
KBA |
Posted: Fri Jan 26, 2007 12:58 pm Post subject: |
|
|
Newbie
Joined: 29 Nov 2006 Posts: 7
|
Try like this .....
DECLARE Payloadstring CHARACTER;
SET Payloadstring ='Ur xml';
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(Payloadstring CCSID 1208 ENCODING MQENC_NATIVE ); |
|
Back to top |
|
 |
KBA |
Posted: Fri Jan 26, 2007 1:00 pm Post subject: |
|
|
Newbie
Joined: 29 Nov 2006 Posts: 7
|
Try like this .....
DECLARE Payloadstring CHARACTER;
SET Payloadstring ='Ur xml';
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC') PARSE(Payloadstring CCSID 1208 ENCODING MQENC_NATIVE ); |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 26, 2007 1:25 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
KBA - that's entirely backwards. It will take a string and produce an XML tree.
Brokerdev wants to take an XML tree and produce a string. But only of a subsection of the message tree - which is done by specifying the FolderBitStream OPTION. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
brokerDev |
Posted: Mon Jan 29, 2007 10:29 am Post subject: |
|
|
Acolyte
Joined: 21 Jun 2006 Posts: 53
|
Thanks again jefflowrey.
If anyone is interested, I used the bit of code below to get what I wanted.
DECLARE myChar CHAR CAST(ASBITSTREAM(inRef.{myNS}:GeometryDefinition OPTIONS FolderBitStream) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId); |
|
Back to top |
|
 |
|