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 » Accessing elements in XMLNS message

Post new topic  Reply to topic
 Accessing elements in XMLNS message « View previous topic :: View next topic » 
Author Message
Sandman
PostPosted: Mon Mar 26, 2007 4:47 am    Post subject: Accessing elements in XMLNS message Reply with quote

Centurion

Joined: 16 Oct 2001
Posts: 134
Location: Lincoln, RI

Can anyone please help me understand why only the first SET statement below functions as expected? I'm a namespace noob, so I apologize for that. But the incoming XMLNS message does not prefix every element within the message. Specifically, the AddAddressResponse command wrapper has no prefix. (Should it? IOW, does everything within an XMLNS message have to contain a prefix?)

Thank you.

Code:
      DECLARE msg NAMESPACE 'http://www.amica.com/amica_messaging';
      DECLARE loc NAMESPACE 'http://www.amica.com/Location';
      DECLARE impl NAMESPACE 'http://www.amica.com/Implementation';

      SET Environment.Variables.COMMAND = InputRoot.XMLNS.msg:Message.msg:COMMAND;
      SET Environment.Variables.AddAddressResponse = InputRoot.XMLNS.msg:Message.msg:COMMAND.AddAddressResponse;

Sample XML:
Code:
<msg:Message xmlns="http://www.amica.com/amica_messaging" xmlns:msg="http://www.amica.com/amica_messaging" xmlns:adrImpl="http://www.amica.com/AddressImpl" xmlns:impl="http://www.amica.com/Implementation" xmlns:loc="http://www.amica.com/Location" xmlns:obj="http://www.amica.com/Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.amica.com/amica_messaging C:\PVCSWO~1\ENTERP~2\AMICAU~1\AddressUpdate.xsd" id="1174578008875" version="1.4" bodyType="Amica-XML" sourceLogicalId="CMA" destinationLogicalId="EDB" timeStampCreated="2007-03-22T10:40:08-05:00">
 <msg:COMMAND>
  <AddAddressResponse cmdType="request" id="ID00001" cmdMode="alwaysRespond">
   <PostalAddress id="ID00002" implRef="ID00003">
    <loc:streetAddress>122 Manley Dr.</loc:streetAddress>
    <loc:additionalInformation>Test</loc:additionalInformation>
    <loc:city>Pascoag</loc:city>
    <loc:state>RI</loc:state>
    <loc:zipCode>02859</loc:zipCode>
    <loc:province />
    <loc:county>Providence</loc:county>
    <loc:fipsCountyCode />
    <loc:country>USA</loc:country>
   </PostalAddress>
   <AddressImpl id="ID00003">
    <impl:effectiveDate>2007-03-17</impl:effectiveDate>
    <impl:modifedBy>A9438</impl:modifedBy>
   </AddressImpl>
  </AddAddressResponse>
 </msg:COMMAND>
</msg:Message>
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Mar 26, 2007 4:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

The XML document defines a default namespace, so unprexifed elements actually belong to this namespace.

In your example, the msg namespace appears to be identical to the default, so I'd expect msg:AddAddressResponse to suceed.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Sandman
PostPosted: Mon Mar 26, 2007 5:56 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2001
Posts: 134
Location: Lincoln, RI

You're right, Vitor. Thank you. AAMOF, the developer who created this message has recently published a modification - in which he removed this code:
Code:
xmlns="http://www.amica.com/amica_messaging"
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Mar 26, 2007 6:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Sandman wrote:
You're right, Vitor. Thank you. AAMOF, the developer who created this message has recently published a modification - in which he removed this code:
Code:
xmlns="http://www.amica.com/amica_messaging"


And thus removing the default namspace, causing your original code to be correct.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Sandman
PostPosted: Mon Mar 26, 2007 6:35 am    Post subject: Reply with quote

Centurion

Joined: 16 Oct 2001
Posts: 134
Location: Lincoln, RI

Then I am so

Thanks again.
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 » Accessing elements in XMLNS message
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.