Author |
Message
|
sw_conslnt |
Posted: Fri Jun 18, 2010 11:59 pm Post subject: Hot to cast Charecter to XML |
|
|
Newbie
Joined: 18 Jun 2010 Posts: 3
|
Hi,
I am using WMB v6.1. I am getting a response from external web service that the response xml contains a charecter in a tag what is basically an xml comming as char.
Like that :
<NS1:OrderResponse xmlns:NS1="http://www.xx.com/web-services/intOrder">
<response>
<?xml version="1.0" encoding="UTF-8"><result timestamp="2010-06-17T19:43:58.976-04:00" xmlns="http://www.xx.com/rules/client"> <messages> <message>Order is not well-formed .</message> </messages> </result>
</response>
</NS1:OrderResponse>
I need to convert the payload char into xmlnsc. I have used :
CREATE LASTCHILD OF Environment.Payload DOMAIN ('XMLNSC')
PARSE ( InputRoot.XMLNSC.ns:OrderResponse ,InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);
But after that I am not getting data from Environment.Payload.XMLNSC.
Can Anybody help me regarding that ?
Thanks
Suman |
|
Back to top |
|
 |
kimbert |
Posted: Sat Jun 19, 2010 12:36 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
InputRoot.XMLNSC.ns:OrderResponse is a CHARACTER field in the message tree. What is the code page of the characters? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jun 19, 2010 4:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sw_conslnt wrote: |
I need to convert the payload char into xmlnsc. I have used :
CREATE LASTCHILD OF Environment.Payload DOMAIN ('XMLNSC')
PARSE ( InputRoot.XMLNSC.ns:OrderResponse ,InputRoot.Properties.Encoding, InputRoot.Properties.CodedCharSetId);
But after that I am not getting data from Environment.Payload.XMLNSC. |
Kimbert's advice paying great attention. then act on it!
You are not following the manual for your Create /parse...
Also insert a trace node displaying the Environment after your node...
Why would you look at Environment.Payload.XMLNSC ?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sw_conslnt |
Posted: Sat Jun 19, 2010 11:50 am Post subject: |
|
|
Newbie
Joined: 18 Jun 2010 Posts: 3
|
Can I directly cast a charecter as xml using exql ? Normal cast statement is not working on it. |
|
Back to top |
|
 |
Vitor |
Posted: Sat Jun 19, 2010 3:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
sw_conslnt wrote: |
Can I directly cast a charecter as xml using exql ? Normal cast statement is not working on it. |
Follow the advise given - take a trace, insert a trace node and read other threads on this topic. Especially those with parsing & casting advice from kimbert. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Sun Jun 20, 2010 10:40 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Can I directly cast a charecter as xml using exql ? Normal cast statement is not working on it. |
The CAST function converts one simple data type to another simple data type. It does not invoke an XML parser. Please read the infocenter - it has an excellent topic about the CAST function.
Your first approach was correct, but you are using the CREATE...PARSE statement wrongly. |
|
Back to top |
|
 |
|