Author |
Message
|
jagan |
Posted: Thu Jun 21, 2007 6:33 am Post subject: Unable to get values from XMLNSC parser |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
Hi,
Unable to get the values using the XMLNSC parse. I have not used the Message set but decalred the Namespace in the ESQL. My requirement is to get the values from the INPUT Message. It is returing empty while reading the fileds from the below SOAP message. Read some topics in this forum and updated the fix pack 6.0.0.1to 6.0.0.4.
C:\Program Files\IBM\MQSI\6.0>mqsiservice -v
BIPv600 en US
ucnv Console CCSID 437 dft ucnv CCSID 5348
ICUW ibm-5348_P100-1997 ICUA ibm-5348_P100-1997
BIP8996I: Version: 6004
BIP8997I: Product: WebSphere Message Brokers
BIP8998I: CMVC Level: S600-CSD04 DH600-CSD04D1
BIP8999I: Build Type: Production
BIP8071I: Successful command completion.
-------------------------------------------------------------------------------------
Here you go the set up of my flow
1. My flow stats with HTTPINPUT --> Compute --> HTTPReply..
2. No Message Set has been used for this..
3. My input message as below..
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><OTA_AirFlifoRQ RetransmissionIndicator="false" Target="TEDS" Version="1.002" xmlns="http://www.opentravel.org/OTA/2003/05">
<Airline Code="TD" Division="Information Services"/>
<FlightNumber>124</FlightNumber>
<DepartureDate>2007-06-14</DepartureDate>
<FlightSegment><Airline Code="TD" Division="Information Services"/><FlightNumber>776</FlightNumber><DepartureDate>2007-07-28</DepartureDate></FlightSegment>
</OTA_AirFlifoRQ></soapenv:Body></soapenv:Envelope>
4. My ESQL CODE Is as below..
Trying to get values of Airline.Code="TD", but nothing is returing from the below code.
DECLARE ns1 NAMESPACE 'http://www.opentravel.org/OTA/2003/05';
DECLARE ns NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE test, test1,test2,test3,test4,test5 CHAR;
set test =FIELDTYPE(InputRoot.XMLNSC.Envelope.Body.OTAAirFlifoRQ.Airline.Code);
set test1 =FIELDTYPE(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.Code);
set test2 =FIELDTYPE(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.Code.Value);
set test3 =InputRoot.XMLNSC.Envelope.Body.OTAAirFlifoRQ.Airline.Code;
set test4 =InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.Code;
set test5= InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.Code;
5. I have put a trace node in between the HTTPInput and Compute node the values are as below..
(0x01000000):XMLNSC = (
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Envelope = (
(0x03000102)http://www.w3.org/2000/xmlns/:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
(0x03000102)http://www.w3.org/2000/xmlns/:soapenc = 'http://schemas.xmlsoap.org/soap/encoding/'
(0x03000102)http://www.w3.org/2000/xmlns/:xsd = 'http://www.w3.org/2001/XMLSchema'
(0x03000102)http://www.w3.org/2000/xmlns/:xsi = 'http://www.w3.org/2001/XMLSchema-instance'
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Header =
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000)http://www.opentravel.org/OTA/2003/05:OTA_AirFlifoRQ = (
(0x03000100):RetransmissionIndicator = 'false'
(0x03000100):Target = 'FEDS'
(0x03000100):Version = '1.002'
(0x03000102):xmlns = 'http://www.opentravel.org/OTA/2003/05'
(0x01000000)http://www.opentravel.org/OTA/2003/05:Airline = (
(0x03000100):Code = 'nw'
(0x03000100):Division = 'Information Services'
)
(0x03000000)http://www.opentravel.org/OTA/2003/05:FlightNumber = '124'
(0x03000000)http://www.opentravel.org/OTA/2003/05:DepartureDate = '2007-06-14'
(0x01000000)http://www.opentravel.org/OTA/2003/05:FlightSegment = (
(0x01000000)http://www.opentravel.org/OTA/2003/05:Airline = (
(0x03000100):Code = 'NW'
(0x03000100):Division = 'Information Services'
)
(0x03000000)http://www.opentravel.org/OTA/2003/05:FlightNumber = '776'
(0x03000000)http://www.opentravel.org/OTA/2003/05:DepartureDate = '2007-07-28' |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 6:43 am Post subject: Re: Unable to get values from XMLNSC parser |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 21, 2007 6:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Try putting the namespace values in double-quotes in your DECLARE NAMESPACE statements.
Try referencing the path using the any-namespace qualifier (*). Like InputRoot.XMLNSC.*:Envelope.*:Body.*:OTAAirFlifoRQ.*:Airline.*:Code _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 21, 2007 6:45 am Post subject: Re: Unable to get values from XMLNSC parser |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
marcin.kasinski wrote: |
Code: |
.(XML.Attribute)CODE |
|
I think you mean (XMLNSC.Attribute). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 7:16 am Post subject: Unable to get values from XMLNSC parser |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
Hi,
when i tried using double quotes for the declaration of namespace the bar file is not deployed saying the following error message. "The correlation name 'http://www.opentravel.org/OTA/2003/05' is not valid. Those in scope are: ns1."
I have tried witht the XMLSC and XML attribute option but still not getting the values..
set test =InputRoot.XMLNSC.Envelope.Body.OTAAirFlifoRQ.Airline.(XMLNSC.Attribute)Code;
set test1 =InputRoot.XMLNSC.*:Envelope.*:Body.*:OTAAirFlifoRQ.*:Airline.*:Code;
set test2 =InputRoot.XMLNSC.*:Envelope.*:Body.*:OTAAirFlifoRQ.*:Airline.(XMLNSC.Attribute)Code;
set test =InputRoot.XMLNSC.Envelope.Body.OTAAirFlifoRQ.Airline.(XML.Attribute)Code; |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 7:19 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
I have tried the below also but no use
set test =InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code;
set test1 =InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XML.Attribute)Code; |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 8:07 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
And also tried with the below using FIELDVALUE
set test2 =FIELDVALUE(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code);
set test3 =FIELDVALUE(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XML.Attribute)Code); |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 8:26 am Post subject: Re: Unable to get values from XMLNSC parser |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jefflowrey wrote: |
marcin.kasinski wrote: |
Code: |
.(XML.Attribute)CODE |
|
I think you mean (XMLNSC.Attribute). |
UPS.
Of course... _________________ Marcin |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 8:35 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Have you tried this technique.
Code: |
set test1 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope);
set test2 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body);
set test3 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ);
set test4 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline);
set test5 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code);
|
Check this and show us values of tests.
It is very simple and shows where the problem is. _________________ Marcin |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 8:36 am Post subject: Re: Unable to get values from XMLNSC parser |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
marcin.kasinski wrote: |
jefflowrey wrote: |
marcin.kasinski wrote: |
Code: |
.(XML.Attribute)CODE |
|
I think you mean (XMLNSC.Attribute). |
UPS.
Of course... |
I have used the same, but no use pl see my last reply |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 8:42 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
marcin.kasinski wrote: |
Have you tried this technique.
Code: |
set test1 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope);
set test2 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body);
set test3 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ);
set test4 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline);
set test5 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTAAirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code);
|
Check this and show us values of tests.
It is very simple and shows where the problem is. |
The Results are showing as below, no return values for message
test1=Envelope
test2=Body
test3=
test4=
test5= |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 8:48 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
OTAAirFlifoRQ !=OTA_AirFlifoRQ _________________ Marcin |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 9:01 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
marcin.kasinski wrote: |
OTAAirFlifoRQ !=OTA_AirFlifoRQ |
Sorry.. It is OTA_AirFlifoRQ.. I have just copied your code so it is not
Now it is working ...
set test1 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope);
set test2 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body);
set test3 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTA_AirFlifoRQ);
set test4 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTA_AirFlifoRQ.ns1:Airline);
set test5 =FIELDNAME(InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTA_AirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code) ;
set test6 =InputRoot.XMLNSC.ns:Envelope.ns:Body.ns1:OTA_AirFlifoRQ.ns1:Airline.(XMLNSC.Attribute)Code;
The result is
test1=Envelope
test2=Body
test3= OTA_AirFlifoRQ
test4= Airline
test5=Code
test6=nw |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Jun 21, 2007 9:07 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jagan wrote: |
Sorry.. It is OTA_AirFlifoRQ.. I have just copied your code so it is not
|
OK, but I used your code from first post.
In input message you have OTA_AirFlifoRQ.
In your code you have OTAAirFlifoRQ.
Just fix it _________________ Marcin |
|
Back to top |
|
 |
jagan |
Posted: Thu Jun 21, 2007 9:14 am Post subject: |
|
|
Acolyte
Joined: 26 Jun 2001 Posts: 55
|
marcin.kasinski wrote: |
jagan wrote: |
Sorry.. It is OTA_AirFlifoRQ.. I have just copied your code so it is not
|
OK, but I used your code from first post.
In input message you have OTA_AirFlifoRQ.
In your code you have OTAAirFlifoRQ.
Just fix it |
It is typo in my ESQL, that is created a hell lot of problems.. Thanks very much for your help marchi.. |
|
Back to top |
|
 |
|