Author |
Message
|
bullaydin |
Posted: Thu Nov 30, 2006 8:01 am Post subject: Missing Element in OutputRoot |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
Hi all
I have the following ESQL after HTTP Request ;
Code: |
DECLARE ns NAMESPACE 'urn:ec.europa.eu:taxud:vies:services:checkVat:types';
DECLARE tns NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
-- Output is MQ, so remove HTTP headers
SET OutputRoot.HTTPResponseHeader = NULL;
-- Output is XML1, so set target message properties
SET OutputRoot.Properties.MessageType = 'VAT_Response';
SET OutputRoot.Properties.MessageFormat = 'TDS1';
SET OutputRoot.Properties.MessageSet = 'VAT_Response';
-- Create an MQMD and restore it to saved values
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN 'MQMD';
SET OutputRoot.MQMD = Environment.MQMD ;
-- Build message to be sent
SET OutputRoot.MRM.SQLIDN = 2;
SET OutputRoot.MRM.APAIDN = 0;
SET OutputRoot.MRM.Request_date = '10.10.2006' ;
SET OutputRoot.MRM.Valid = InputBody.tns:Body.ns:checkVatResponse.vatNumber; |
OutputRoot was created without last element - Valid . I've seen the following statements in Trace. For the first three , assignments are ok,
the last has a problem. But I don't know how I can solve this problem ;
BIP2568I: Node 'Check_VAT.Compute': Copying sub-tree from ''Environment.MQMD'' to ''OutputRoot.MQMD''.
BIP2537I: Node 'Check_VAT.Compute': Executing statement ''SET OutputRoot.MRM.SQLIDN = 2;'' at ('.Check_VAT_Compute.Main', '23.3').
BIP2566I: Node 'Check_VAT.Compute': Assigning value ''2'' to field / variable ''OutputRoot.MRM.SQLIDN''.
BIP2537I: Node 'Check_VAT.Compute': Executing statement ''SET OutputRoot.MRM.APAIDN = 0;'' at ('.Check_VAT_Compute.Main', '24.3').
BIP2566I: Node 'Check_VAT.Compute': Assigning value ''0'' to field / variable ''OutputRoot.MRM.APAIDN''.
BIP2537I: Node 'Check_VAT.Compute': Executing statement ''SET OutputRoot.MRM.Request_date = '10.10.2006';'' at ('.Check_VAT_Compute.Main', '25.3').
BIP2566I: Node 'Check_VAT.Compute': Assigning value '''10.10.2006''' to field / variable ''OutputRoot.MRM.Request_date''.
BIP2537I: Node 'Check_VAT.Compute': Executing statement ''SET OutputRoot.MRM.Valid = InputBody.tns:Body.ns:checkVatResponse.vatNumber;'' at ('.Check_VAT_Compute.Main', '26.9').
BIP2543I: Node 'Check_VAT.Compute': ('.Check_VAT_Compute.Main', '26.36') : Failed to navigate to path element number '2' because it does not exist.
BIP2539I: Node 'Check_VAT.Compute': Evaluating expression ''InputBody.tns:Body.ns:checkVatResponse.vatNumber'' at ('.Check_VAT_Compute.Main', '26.36'). This resolved to ''InputBody.http://schemas.xmlsoap.org/soap/envelope/:Body.urn:ec.europa.eu:taxud:vies:services:checkVat:types:checkVatResponse.vatNumber''. The result was ''EMPTY ROW''.
BIP2567I: Node 'Check_VAT.Compute': Assigning NULL to ''OutputRoot.MRM.Valid'', thus deleting it.
regards _________________ *************************
" Sharing knowledge better than having it ."
http://www.openpoint.de |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 30, 2006 8:08 am Post subject: Re: Missing Element in OutputRoot |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
On the face of it, the problem is simple:
bullaydin wrote: |
Hi all
('.Check_VAT_Compute.Main', '26.36') : Failed to navigate to path element number '2' because it does not exist.
|
As a result you get :
bullaydin wrote: |
BIP2539I: Node 'Check_VAT.Compute': Evaluating expression ''InputBody.tns:Body.ns:checkVatResponse.vatNumber'' at ('.Check_VAT_Compute.Main', '26.36'). This resolved to ''InputBody.http://schemas.xmlsoap.org/soap/envelope/:Body.urn:ec.europa.eu:taxud:vies:services:checkVat:types:checkVatResponse.vatNumber''. The result was ''EMPTY ROW''.
BIP2567I: Node 'Check_VAT.Compute': Assigning NULL to ''OutputRoot.MRM.Valid'', thus deleting it.
|
But I imagine you'd already worked that out! How certain are you that the input path item exists? Does it show up in the trace? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bullaydin |
Posted: Thu Nov 30, 2006 8:18 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
I 've seen the following InputBody (response from web service) from the Debug mode ;
Code: |
DebugMessage
--------Message
-------------Body
----------------checkVatResponse
countryCode = AT
vatNumber = wer
requestDate = 2006-11-30
valid = false
name
address
|
[/img] _________________ *************************
" Sharing knowledge better than having it ."
http://www.openpoint.de |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Nov 30, 2006 8:58 am Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
Can you use a Trace node to show the value of {$Root}?
It is most likely something to do with the namespace. _________________ Joseph
Administrator - IBM WebSphere MQ (WMQ) V6.0, IBM WebSphere Message Broker (WMB) V6.1 & V6.0
Solution Designer - WMQ V6.0
Solution Developer - WMB V6.1 & V6.0, WMQ V5.3 |
|
Back to top |
|
 |
bullaydin |
Posted: Fri Dec 01, 2006 1:10 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
I've used that and here is the result... I suppose that namespaces are the same with DECLARE in Compute node or am I wrong ?
Code: |
BIP4060I: Data ''(
(0x01000000)http://schemas.xmlsoap.org/soap/envelope/:Body = (
(0x01000000)urn:ec.europa.eu:taxud:vies:services:checkVat:types:checkVatResponse = (
(0x03000000):countryCode = 'AT'
(0x03000000):vatNumber = 'wer'
(0x03000000):requestDate = DATE '2006-12-01'
(0x03000000):valid = FALSE
(0x03000000):name = ''
(0x03000000):address = ''
)
)
)
'' |
_________________ *************************
" Sharing knowledge better than having it ."
http://www.openpoint.de |
|
Back to top |
|
 |
gregop |
Posted: Fri Dec 01, 2006 1:32 am Post subject: |
|
|
Voyager
Joined: 24 Nov 2006 Posts: 81
|
I'd guess vatNumber is within ns namespace.
Try:
SET OutputRoot.MRM.Valid = InputBody.tns:Body.ns:checkVatResponse.ns:vatNumber; |
|
Back to top |
|
 |
bullaydin |
Posted: Fri Dec 01, 2006 1:44 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
I am afraid so it has the same effect ...  _________________ *************************
" Sharing knowledge better than having it ."
http://www.openpoint.de |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 01, 2006 1:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Question:
Quote: |
-- Output is XML1, so set target message properties
SET OutputRoot.Properties.MessageType = 'VAT_Response';
SET OutputRoot.Properties.MessageFormat = 'TDS1';
SET OutputRoot.Properties.MessageSet = 'VAT_Response'; |
If the output is XML1 why is the MessageFormat set to 'TDS1'. Is that message format even defined for the MessageSet ??? _________________ MQ & Broker admin |
|
Back to top |
|
 |
bullaydin |
Posted: Fri Dec 01, 2006 2:02 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
firstly, ok comment line is wrong , output is not a XML1...
I am sure that Message Format was defined ... _________________ *************************
" Sharing knowledge better than having it ."
http://www.openpoint.de |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 01, 2006 2:16 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
urn:ec.europa.eu:taxud:vies:services:checkVat:types:checkVatResponse |
Something looks fishy in that namespace... I would have expected something like:
urn:ec.europa.eu/taxud/vies/services/checkVat/types
Note the use of ':' in the namespace. If the use is correct you may have to enclose it in quotes...
I sure hope the urn passed is private.
Tried it as http and the only thing near it I could find was this:
European Commission laws on VAT... and under VAT Electronic Services _________________ MQ & Broker admin |
|
Back to top |
|
 |
bullaydin |
Posted: Fri Dec 01, 2006 2:53 am Post subject: |
|
|
Apprentice
Joined: 16 Feb 2006 Posts: 25 Location: Germany
|
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 01, 2006 3:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Change your last line to :
Code: |
SET OutputRoot.MRM.Valid VALUE = InputBody.tns:Body.ns:checkVatResponse.vatNumber; |
or
Code: |
SET OutputRoot.MRM.Valid VALUE = InputBody.tns:Body.ns:checkVatResponse.ns:vatNumber; |
This should take care of any null values in the source.information....
The alternative would be to iterate through the children using a reference and
checking name and namespace... _________________ MQ & Broker admin
Last edited by fjb_saper on Fri Dec 01, 2006 3:29 am; edited 3 times in total |
|
Back to top |
|
 |
gregop |
Posted: Fri Dec 01, 2006 3:20 am Post subject: |
|
|
Voyager
Joined: 24 Nov 2006 Posts: 81
|
Is the trace showing pattern ${Root} ?
If thats the full root tree then there is no message domain indicated in the trace. InputBody = InputRoot.DOMAIN therefore I'd expect InputBody would return null if no message domain assigned for the response message.
Try specifying XML in your HTTPRequest message DOMAIN or perhaps you can reference the HTTP response directly using InputRoot instead of InputBody. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 01, 2006 3:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Reading up on the different response possibilities of the service (see your url post) did you provide for all the type of answers?
You may need to add the VALUE qualifier for all the answers from the service as there are times when the service could answer with fault or "try later" in which case you would never have anything to assign to your "Valid" element... _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 01, 2006 4:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
gregop wrote: |
InputBody = InputRoot.DOMAIN therefore I'd expect InputBody would return null if no message domain assigned for the response message.
|
Actually "InputBody" = "InputRoot.[<]".
That is, the last child of InputRoot. This may or may not be the same thing as "InputRoot.DOMAIN". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|