Author |
Message
|
alaychem |
Posted: Sat Nov 05, 2016 10:34 pm Post subject: Problem witn adding NAMESPACES to existing XMLNSC domain |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
On IIB 9:
I try to add NS to my XMLNSC domain so it will fit SOAP response node (auto generated from deployable WSDL).
The tree looks like:
Code: |
OutputRoot.XMLNSC.serviceresponse.data.(whatever) |
Following IBM Info center I tried
Code: |
SET OutputRoot.XMLNSC.serviceresponse.(XMLNSC.NamespaceDec).xmlns = someNS |
On debug, the variable tree looks fine:
Code: |
XMLNSC
serviceresponse
xmlns = 'www.someNS.com'
|
but still I get BIP 5014 - saying that no NS is present to the serviceresponse element, and because of that, I can't even take the XML out, in order to compare it to valid response.
Any ideas? |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Nov 05, 2016 11:40 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
AFAIK, you have to use the Namespace as a prefix to each element in the message as well as setting the namespace up at the top level.
The easiest way to start to understand this is to put a trace node on the input with the pattern set to
Set the output to a file and send the input to the flow. Just terminate the flow after the trace node (don't wire it up to anything)
Then you can see the structure of the SOAP Message for yourself. This is what you have to replicate in the output.
The SOAP Samples that are available could help as well as other posts on this topic in this forum.
Navigating message trees with namespaces can be hard work even for us so called experts. One I had to use last year had FOUR Different namespaces in the message.
Arrrrrrgggggghhhhhhhhh _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
alaychem |
Posted: Sun Nov 06, 2016 2:28 am Post subject: |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
The error directs me to the root element (serviceresponse) ,and anyhow
all child elements and their decedents have proper NS.
The trace gives me a XML representation, rather then actual XML.
I looked at the trace as you kindly suggested and it seems alright.
Code: |
(0x000...:Folder serviceresponse = (
...
(0x000...:NamespaceDec) xmlns = ...
|
 |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Nov 06, 2016 3:30 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Broker/IIB does not use XML internally.
It uses a tree structure that resembles XML (Coincidental???)
You should have the original message in XMP form anyway.
The message tree shows you the namespaces.
You need will probably to replicate that namespace structure for your output.
Using a trace node before you send the response will help you get to the bottom of your problems. You may well have the XML Tag structure correct so now you need to fill in the namespaces.
The reason for the tree structure is simple. It makes ALL messages the same. The tree is only converted to the final structure when the message leaves the Broker. That is why you specify a parser in the Output (OutputRoot.XMLNSC).
In many applications it makes changing the output format (parser) type easy.
Keep going, you will get there and learn a lot about how this tool works internally. This will help you out in the long run. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
alaychem |
Posted: Sun Nov 06, 2016 6:13 am Post subject: |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
Solved by creating Message Model to the NS-less format and mapping node.
Thank you for your time!! |
|
Back to top |
|
 |
alaychem |
Posted: Wed Nov 16, 2016 2:04 am Post subject: |
|
|
Acolyte
Joined: 10 Feb 2016 Posts: 66
|
Sorry for the necromancy, but a better way to get the actual message then trace node is compute node the turns the message to BLOB, and sends it to some output node (I used MQOutput) |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Nov 16, 2016 2:12 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Do you want to do that in Production?
Trace nodes do nothing unless trace is enabled.
There are other (non progammatical in IIB) ways to get copies of messages that are coming over MQ. For example, write the messages to an Alias Q that is setup to publish to a topic. Then subscribe (create a subscription) that points to the Input Queue Of your flow and a second one that points to your 'dump' queue.
There are others methods but in general trace nodes are a very good solution especially as you can add other information to the trace output. you are not limited to just ${Root}. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 16, 2016 5:45 am Post subject: Re: Problem witn adding NAMESPACES to existing XMLNSC domain |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
alaychem wrote: |
On IIB 9:
I try to add NS to my XMLNSC domain so it will fit SOAP response node (auto generated from deployable WSDL).
The tree looks like:
Code: |
OutputRoot.XMLNSC.serviceresponse.data.(whatever) |
Following IBM Info center I tried
Code: |
SET OutputRoot.XMLNSC.serviceresponse.(XMLNSC.NamespaceDec).xmlns = someNS |
On debug, the variable tree looks fine:
Code: |
XMLNSC
serviceresponse
xmlns = 'www.someNS.com'
|
but still I get BIP 5014 - saying that no NS is present to the serviceresponse element, and because of that, I can't even take the XML out, in order to compare it to valid response.
Any ideas? |
Just to further your understanding. Adding a namespace declaration is nice and will impact the way the XML displays but it will not change the namespace of the corresponding element.
You have to either create it with the namespace (See how to in ESQL)
or add /change the namespace after the fact:
Code: |
DECLARE ns1 NAMESPACE 'http://www.mycompany.com/ns1';
SET OutputRoot.XMLNSC.serviceresponse NAMESPACE = ns1; |
And you'd have to do that recursively for each element with a namespace...
Hope this helps for future reference...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|