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 » WMB Namespace Declarations not Producing Expected Results

Post new topic  Reply to topic
 WMB Namespace Declarations not Producing Expected Results « View previous topic :: View next topic » 
Author Message
EricCox
PostPosted: Wed Oct 17, 2012 10:21 am    Post subject: WMB Namespace Declarations not Producing Expected Results Reply with quote

Master

Joined: 08 Apr 2011
Posts: 292

To all,

My namespace declarations are not producing the expected results and I'm not able to adjust the code to produce the expected result. Could you tell me what I'm doing wrong, concepts missed, articles to read.
Thanks,
Eric

Here are the namespace delcarations and code to produce the XML:
Code:

--Declare Namespaces
DECLARE soap_env NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE nm2 NAMESPACE 'http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02';
DECLARE nm3 NAMESPACE 'http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02';

-- Create the SOAP Envelope
SET OutputRoot.XMLNS.soap_env:Envelope.(XML.NamespaceDecl)xmlns:"NS1" = 'http://schemas.xmlsoap.org/soap/envelope/';
SET OutputRoot.XMLNS.soap_env:Envelope.(XML.NamespaceDecl)xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance';
SET OutputRoot.XMLNS.soap_env:Envelope.(XML.NamespaceDecl)xmlns:xsd = 'http://www.w3.org/2001/XMLSchema';

--Create the ResponseMessageHeader
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Header.nm2:ResponseMessageHeader.(XML.NamespaceDecl)xmlns:"NS2" = 'http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02/';

--Set the Header
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Header.nm2:ResponseMessageHeader = '';

--Set the Body
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Body.{serviceName} = '';

--Populate the Result
DECLARE resp REFERENCE TO OutputRoot.XMLNS.soap_env:Envelope.soap_env:Body.{serviceName};
DECLARE hdr REFERENCE TO OutputRoot.XMLNS.soap_env:Envelope.soap_env:Header.nm2:ResponseMessageHeader;
      
--Build the SOAP Header
--SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Header.(XML.NamespaceDecl)xmlns:"cfg_hdr" = 'http://www.co.com/schemas/CFX/';

SET hdr.ErrorList.Status =
   '2';


And here is the result:
Code:

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <NS1:Header>
      <NS1:ResponseMessageHeader xmlns:NS1="http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02" xmlns:NS2="http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02/">
         <ErrorList>
            <Status>2</Status>
         </ErrorList>
      </NS1:ResponseMessageHeader>
   </NS1:Header>
   <NS1:Body>
      <getCustConsLoanAcctsRs/>
   </NS1:Body>
</NS1:Envelope>


What I'm expecting to produce is this:
Code:

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <NS1:Header>
      <NS2:ResponseMessageHeader  xmlns:NS2="http://www.co.com/2012/10/02/CSG/IA/iaConsLoanWebService02/">
         <ErrorList>
            <Status>2</Status>
         </ErrorList>
      </NS2:ResponseMessageHeader>
   </NS1:Header>
   <NS1:Body>
      <getCustConsLoanAcctsRs/>
   </NS1:Body>
</NS1:Envelope>


The NS1 is being declared inside the ResponseMessageHeader where I don't want it and the ResponseMessageHeader isn't being prefixed with NS2 as I want it.

I'll keep trying to experiment.

Thanks to all,
Eric[/code]
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Oct 18, 2012 2:41 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The output document will be constructed from the contents of the output message tree. No involvement from any other settings. So I suggest that you add a Trace node to your flow immediately before the output node. Set the pattern to '${Root}'. Check that the output tree is exactly the way that you intended. If you don't find the problem, post the Trace node output.

Any particular reason why you are using XMLNS instead of XMLNSC?
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Thu Oct 18, 2012 5:08 am    Post subject: Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

1. Switch from XMLNS to XMLSNC

2. The variations in namespace asignments are all explained in the infocenter
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
NealM
PostPosted: Thu Oct 18, 2012 9:26 am    Post subject: Reply with quote

Master

Joined: 22 Feb 2011
Posts: 230
Location: NC or Utah (depends)

Quote:
Any particular reason why you are using XMLNS instead of XMLNSC?

Probably because last month on another topic post, I copied and pasted some old working v5 ESQL for him to see how to set up for and build a SOAP Envelope in v6.0, a step up from trying to use the XML parser.
One small step at a time...
Back to top
View user's profile Send private message
rekarm01
PostPosted: Sat Oct 20, 2012 12:15 pm    Post subject: Re: WMB Namespace Declarations not Producing Expected Result Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

The XML parsers implicitly add namespace declarations with default names "NS1", "NS2", etc., to the output message when the message does not provide a required namespace declaration. If the message flow is also explicity creating namespace declaration elements "NS1", "NS2", etc., then it's hard to tell them apart.

EricCox wrote:
Code:
--Set the Header
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Header.nm2:ResponseMessageHeader = '';

--Set the Body
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Body.{serviceName} = '';

This may not be related to the problem at hand, but don't do that. These are Name elements; they don't need values, (not even an empty string). ResponseMessageHeader already exists, so the SET statement is unnecessary. To create the {serviceName} element, use:

Code:
SET OutputRoot.XMLNS.soap_env:Envelope.soap_env:Body.{serviceName} TYPE = Name;

or, use a CREATE statement.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Oct 21, 2012 7:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Code:
SET OutputRoot.XMLNS.soap_env:Envelope.(XML.NamespaceDecl)xmlns:"NS1" = 'http://schemas.xmlsoap.org/soap/envelope/';


Why did you use NS1 instead of soap_env?
Is this because you have a non standard parser on the other end that expects NS1, NS2 etc...and those in a specific order?
_________________
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 » WMB Namespace Declarations not Producing Expected Results
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.