Author |
Message
|
PiperPivo92 |
Posted: Wed Nov 09, 2016 6:56 am Post subject: How can I access to SOAP Header with ESQL? |
|
|
Newbie
Joined: 09 Nov 2016 Posts: 3
|
Hi all,
I'm new in the ESQL world and i'm trying to access the information conteined in the input soap header message.
In particular the message is structured like this:
Code: |
<soapenv:Envelope xmlns:soapenv="..." xmlns:ser="...">
<soapenv:Header>
<ser:testObject>
...
</ser:testObject>
</soapenv:Header>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope> |
and i need to access the element <ser:testObject> for propagate the content to the OutputRoot in a ESQL Compute node.
I've tryed to use this code:
Code: |
DECLARE soapenv NAMESPACE '...';
DECLARE ser NAMESPACE '...';
InputRoot.XMLNSC.soapenv:Envelope.soap:Header.ser:ISPWebservicesHeader |
or the "InputLocalEnviromnet" object but the ruslt is always the same: empty element.
Can anyone help me please?
Thank you very mush for your help and your patience.
PiperPivo92 |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 09, 2016 7:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Presumably you're using a SOAPInput node?
This means that the SOAP items will be under the SOAP domain not XMLNSC.
Put a Trace node after the input and look at the actual message tree you're getting. This is good general advice for any message problem. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PiperPivo92 |
Posted: Wed Nov 09, 2016 7:30 am Post subject: |
|
|
Newbie
Joined: 09 Nov 2016 Posts: 3
|
Hi Vitor, thanks for your reply.
I've use the record message to see the message through the path and i see that this element
is reachable under the localEnvironment tree but if i use the InputLocalEnviromnet return an empty element.
I try to use the Trace node now.
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 09, 2016 7:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 09, 2016 7:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PiperPivo92 wrote: |
I've use the record message to see the message through the path and i see that this element
is reachable under the localEnvironment tree |
This lies under a number of circumstances. Especially with parsing issues.
PiperPivo92 wrote: |
I try to use the Trace node now. |
Much more reliable. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PiperPivo92 |
Posted: Wed Nov 09, 2016 8:08 am Post subject: |
|
|
Newbie
Joined: 09 Nov 2016 Posts: 3
|
I use the trace node and i put this between input node and compute node and the result of print ${Root} is this:
Code: |
( ['SOAPRoot' : 0x282d172af30]
(0x01000000:Name ):Properties = ( ['SOAPPROPERTYPARSER' : 0x282d0e98e80]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2016-11-09 16:05:47.513' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'000000000000000000000000000000000000000000000000' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'SOAP-AXIS2' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Name ):HTTPInputHeader = ( ['WSINPHDR' : 0x282d2a76620]
(0x03000000:NameValue):X-Original-HTTP-Command = 'POST http://localhost:7800/TemperatureConverter/TemperatureConverter HTTP/1.1' (CHARACTER)
(0x03000000:NameValue):SOAPAction = 'http://TemperatureConverter/CtoF' (CHARACTER)
(0x03000000:NameValue):User-Agent = 'Java/1.7.0' (CHARACTER)
(0x03000000:NameValue):Host = 'localhost:7800' (CHARACTER)
(0x03000000:NameValue):Accept = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' (CHARACTER)
(0x03000000:NameValue):Connection = 'keep-alive' (CHARACTER)
(0x03000000:NameValue):Content-Type = 'application/x-www-form-urlencoded' (CHARACTER)
(0x03000000:NameValue):Content-Length = '453' (CHARACTER)
(0x03000000:NameValue):X-Remote-Addr = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Remote-Host = '127.0.0.1' (CHARACTER)
(0x03000000:NameValue):X-Server-Name = 'localhost' (CHARACTER)
(0x03000000:NameValue):X-Server-Port = '7800' (CHARACTER)
)
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x282d2f3e0d0]
(0x01000400:XmlDeclaration):XmlDeclaration = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
(0x01000000:Folder )http://TemperatureConverter:CtoF = (
(0x03000000:PCDataField):TemperatureInC = 0 (DECIMAL)
)
)
) |
I don't see my element. I'm doing something wrong?
Thanks again |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 09, 2016 8:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Trace {LocalEnvironment} _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 09, 2016 8:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Obvious question I should have asked:
Did you generate the service by using a WSDL; i.e. do you have the system generated subflow after the SOAPInput node?
If yes, put the Trace node after that.
If not, how are you extracting the SOAP Envelope for future processing? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
learner.ibm |
Posted: Thu Nov 10, 2016 10:03 am Post subject: How can I access to SOAP Header with ESQL? |
|
|
Novice
Joined: 10 Nov 2016 Posts: 10
|
Check the domain from which you are accessing the SOAP request inside compute node.
If you are accessing the SOAP request after MQInput (XMLNSC will be the domain)
You should be using something like InputRoot.XMLNSC.Envelope.Header.Element where element is the node you want to access.
If the domain is SOAP after SOAPInput then you should be using something like
InputRoot.SOAP.Envelope.Header.Element where element is the node you want to access |
|
Back to top |
|
 |
|