|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL question |
« View previous topic :: View next topic » |
Author |
Message
|
asalema |
Posted: Sun Aug 13, 2006 2:44 pm Post subject: ESQL question |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
ESQL question
Hi Everyone
I need to be able to transform an XML from this form:
Code: |
<Envelope>
<GetClientByID xmlns="http://clientregistry1.com">
<id>12345</id>
</GetClientByID>
<GetClientByName xmlns="http://clientregistry2.com">
<name>
<lastname>paul</lastname>
<givenname>smith</givenname>
</name>
</GetClientByName>
</Envelope>
|
to this form:
Code: |
<Envelope xmlns:NS1="http://clientregistry1.com" xmlns:NS2="http://clientregistry2.com">
<NS1:GetClientByID>
<id>12345</id>
</NS1:GetClientByID>
<NS2:GetClientByName>
<name>
<lastname>paul</lastname>
<givenname>smith</givenname>
</name>
</NS2:GetClientByName>
</Envelope>
|
Is there a smart way of doing that in ESQL?
I tried this code by it's not even valid
Code: |
DECLARE InputMsgRef REFERENCE TO InputRoot.*[CARDINALITY(InputRoot.*[])];
DECLARE BodyRef REFERENCE TO OutputRoot.XMLNS;
MOVE InputMsgRef FIRSTCHILD;
WHILE LASTMOVE(InputMsgRef) DO
IF InputMsgRef.xmlns IS NOT NULL THEN
CREATE LASTCHILD OF myRef TYPE 0x01000000 NAMESPACE InputMsgRef.xmlns FROM InputMsgRef;
ELSE
CREATE LASTCHILD OF myRef FROM InputMsgRef;
END IF;
MOVE InputMsgRef NEXTSIBLING;
END WHILE;
|
Apparantly, you cannot use the NAMESPACE and the FROM clauses in the CREATE command at the same time. Therefore,
this line of code is invalid
CREATE LASTCHILD OF myRef TYPE 0x01000000 NAMESPACE InputMsgRef.xmlns FROM InputMsgRef;
Is there any other trick to do this transformation, hopefully, without having to copy each field from scratch?
Thx |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Aug 13, 2006 4:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
What if you change the namespaces on the message set from as required to header ? _________________ MQ & Broker admin |
|
Back to top |
|
 |
asalema |
Posted: Mon Aug 14, 2006 8:45 am Post subject: |
|
|
Apprentice
Joined: 05 May 2003 Posts: 35
|
I am not sure I understand exactly your suggestion, can you elaborate more?
The input message is generated automatically by consolidating group of requests. We then want to change the namespaces like so to facilitate the call to a webservice to process these requests. The envelope in the input message is in fact a SOAP envelope (I ommitted part of the SOAP header in the message for saving space).
So, when I try to send the envelope as in the input message the call to the webservice fails. After tracing the webservice request using a TCP monitor, I found that, in the request the function calls have to be defined using the proper namespaces as I listed in the output message. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|