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 » Embed XML as encoded String within XML

Post new topic  This topic is locked: you cannot edit posts or make replies.
 Embed XML as encoded String within XML « View previous topic :: View next topic » 
Author Message
wmbv7newbie
PostPosted: Tue May 13, 2014 1:41 am    Post subject: Embed XML as encoded String within XML Reply with quote

Centurion

Joined: 13 May 2014
Posts: 121

Hi,

I have a requirement wherein I need to embed an xml within an xml to generate a SOAP request. Inside xml has to be inserted as String. The structure looks something like -

Code:
<soapenv:Envelope xmlns:soapenv="" xmlns:hris="">
<soapenv:Header/>
<soapenv:Body>
<hris:Dispatch>
<hris:HRXML>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;Envelope version='1.0'&gt;
&lt;Sender&gt;
&lt;Id&gt;HRXMLEMPLID&lt;/Id&gt;
&lt;Credential&gt;25297&lt;/Credential&gt;
&lt;/Sender&gt;
&lt;Recipient&gt;
&lt;/Users&gt;]]&gt;
&lt;/Payload&gt;
&lt;/Packet&gt;
&lt;/Envelope&gt;
</hris:HRXML>
</hris:Dispatch>
</soapenv:Body>
</soapenv:Envelope>


I tried casting the inner xml to String and then using the XMLNSC parser as below -

Code:
DECLARE OutputMessageBlob BLOB;
SET OutputMessageBlob = ASBITSTREAM OutputRoot.XMLNSC.hris:Dispatch.hris:HRXML);
DECLARE OutputMessageChar CHARACTER CAST(OutputMessageBlob AS CHARACTER CCSID 1208);
CREATE LASTCHILD OF Environment.Variable.Data DOMAIN ('XMLNSC') PARSE (OutputMessageChar CCSID 1208);
SET OutputRoot.XMLNSC.hris:Dispatch.hris:HRXML = Environment.Variable.Data;


This doesnt give me the encoded string as expected. I am missing the entities '&it' and '&gt' in the generated xml.

Any leads would help.

Thanks!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue May 13, 2014 2:56 am    Post subject: Reply with quote

Grand High Poobah

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

Do not double post. It is rude and wastes our time!
http://www.mqseries.net/phpBB2/viewtopic.php?t=63451
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jsware
PostPosted: Tue May 13, 2014 2:56 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

Hi,

You're just dealing with Output trees (OutputRoot etc). You're not referencing any Input trees in the ESQL.

I think you need to do something more like:

Code:
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.hris:HRXML = CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.Properties.CodedCharSetId);


If you only need part of the InputRoot.XMLNSC, you can either ASBITSTREAM it and then cast it using the input CCSID.

I'm assuming here you've defined namespaces for soapenv and hris beforehand.
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  This topic is locked: you cannot edit posts or make replies. Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Embed XML as encoded String within XML
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.