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 8.0.0.2 - REFERENCE TO complex type node

Post new topic  Reply to topic
 WMB 8.0.0.2 - REFERENCE TO complex type node « View previous topic :: View next topic » 
Author Message
madjaica
PostPosted: Mon Aug 26, 2013 10:16 am    Post subject: WMB 8.0.0.2 - REFERENCE TO complex type node Reply with quote

Newbie

Joined: 26 Aug 2013
Posts: 4

Hi all!


I am facing a problem with the 'REFERENCE TO' statement and I really need some help. When I declare a reference to a complex node, its value is not the same as the referenced node, i.e., the reference doesn't have the leaf nodes from the referenced node, and the leaf nodes' parents are set as leaf nodes with the value of their last child. This may sound very confusing, but you have a simple example below. The strangest thing is that I didn't find anything about this issue on the internet.

Considering the XML request below, which represents an input to the message broker service:

Code:
<A>
   <B>
      <B1>0</B1>
   </B>
   <C>
       <D>
           <D1>1</D1>
           <D2>VALUE2</D2>
           <D3>VALUE3</D3>
       </D>
   </C>
</A>


I want to reference the <C> element by using:
Code:
DECLARE refC REFERENCE TO InputRoot.SOAP.Body.A.C;


I was expecting 'refC' having the following data:
Code:
D
        D1:INTEGER: 1
        D2:CHARACTER: VALUE2
        D3:CHARACTER: VALUE3


But, instead, it contains:
Code:
D:CHARACTER: VALUE3

As you can see, the element <D> takes the value from its last child.

And, if I check the InputRoot node, it contains:
Code:
A
    B:INTEGER: 0
        B1:INTEGER: 0
    C
        D:CHARACTER: VALUE3
            D1:INTEGER: 1
            D2:CHARACTER: VALUE2
            D3:CHARACTER: VALUE3


I want to access element D1, by doing:
Code:
SET OutputRoot.XMLNSC.Info = refC.D.D1

But, since in 'refC' elementD1 does not exist, the value 'VALUE3' is used.

This problem doesn't occur if I use the full path.
Code:
SET OutputRoot.XMLNSC.Info = InputRoot.SOAP.Body.A.C.D.D1;


NB: I tried unchecking the 'Build tree using XML data types’ from the SOAP Input node properties (which turns every leaf node into CHARACTER). It solved my problem, but it's not a desirable solution.


Thank you in advance ,
Madjaica
Back to top
View user's profile Send private message
mgk
PostPosted: Mon Aug 26, 2013 10:29 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

As you are using SOAP, my guess would be that there are namespaces on some of the elements and you are not using them in your examples. Can you place a Trace node that traces ${Root} after the SOAP Input node and post the output here?

Kind regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
madjaica
PostPosted: Tue Aug 27, 2013 1:27 am    Post subject: Reply with quote

Newbie

Joined: 26 Aug 2013
Posts: 4

mgk,

thank you for your reply. As I was re-running the service to get the trace node result, it started to work properly.

But the trace node result is:
Code:
Message passed through with the following fields:

Body is ( ['xmlnsc' : 0x3a3b9740]
  (0x01000000:Folder)http://www.contact admin.pt /PrismaSinistros:NewSinistroRequest = (
    (0x01000000:Folder):Header = (
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:Version              = 'Version' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:TimeStamp            = TIMESTAMP '2002-01-01 11:00:00' (TIMESTAMP)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:MessageGuid          = 'MessageGuid' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:GeneratorEntity      = 'GeneratorEntity' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:GeneratorApplication = 'GeneratorApplication' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:GeneratorUser        = 'GeneratorUser' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:ServiceId            = 'ServiceId' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:ExternalId           = 'ExternalId' (CHARACTER)
      (0x03000000:PCDataField)http://www.contact admin.pt /Prisma:InternalId           = 'InternalId' (CHARACTER)
    )
    (0x01000000:Folder):Body   = (
      (0x03000000:PCDataField):Policy      = '20' (CHARACTER)
      (
        (0x03000000:PCDataField)ApoliceTypeBPM:npolicyNumber = 23032367 (INTEGER)
        (0x03000000:PCDataField)ApoliceTypeBPM:branch               = '10' (CHARACTER)
        (
          (0x03000000:PCDataField)TipologiaTypeBPM:code = '10' (CHARACTER)
        )
        (0x03000000:PCDataField)ApoliceTypeBPM:insuranceType         = '20' (CHARACTER)
        (
          (0x03000000:PCDataField)TipologiaTypeBPM:code = '20' (CHARACTER)
        )
      )
      (0x01000000:Folder     ):Accident     = (
        (0x03000000:PCDataField)SinistroTypeBPM:manager                            = 'SAFPIS04' (CHARACTER)
        (
          (0x03000000:PCDataField):id   = 3926 (INTEGER)
          (0x03000000:PCDataField):name = 'SAFPIS04' (CHARACTER)
        )
      )
    )
  )
)


The problem resided on accessing the leaf node 'nome', under 'Sinistro.gestorSinistro'. I needed the leaf node 'id' to pass it as a function argument, and I was getting an exception saying that I was passing a CHARACTER (type of 'nome') instead of INTEGER (type of 'id').

I am accessing the field through a reference named 'refSinistro'
Code:
DECLARE refAccident REFERENCE TO InputRoot.SOAP.Body.nsPrismaSinistros:NewSinistroRequest.Body.Accident;


Is it usual for the parent node to have the last child node value?


Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » WMB 8.0.0.2 - REFERENCE TO complex type node
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.