ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem witn adding NAMESPACES to existing XMLNSC domain

Post new topic  Reply to topic
 Problem witn adding NAMESPACES to existing XMLNSC domain « View previous topic :: View next topic » 
Author Message
alaychem
PostPosted: Sat Nov 05, 2016 10:34 pm    Post subject: Problem witn adding NAMESPACES to existing XMLNSC domain Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Sat Nov 05, 2016 11:40 pm    Post subject: Reply with quote

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

Code:

${Root.XMLNSC}


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
View user's profile Send private message
alaychem
PostPosted: Sun Nov 06, 2016 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Sun Nov 06, 2016 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
alaychem
PostPosted: Sun Nov 06, 2016 6:13 am    Post subject: Reply with quote

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
View user's profile Send private message
alaychem
PostPosted: Wed Nov 16, 2016 2:04 am    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Wed Nov 16, 2016 2:12 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Nov 16, 2016 5:45 am    Post subject: Re: Problem witn adding NAMESPACES to existing XMLNSC domain Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20697
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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem witn adding NAMESPACES to existing XMLNSC domain
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.