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 IndexWebSphere Message Broker (ACE) SupportUrgent!! Problem in XML construction using ESQL

Post new topicReply to topic
Urgent!! Problem in XML construction using ESQL View previous topic :: View next topic
Author Message
sree4vit
PostPosted: Tue Apr 12, 2011 5:09 am Post subject: Urgent!! Problem in XML construction using ESQL Reply with quote

Novice

Joined: 05 Aug 2010
Posts: 21

I’m trying to build the HotelSearch Req Xml like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance">
<soapenv:Header>
<authentication>
<userid>8072</userid>
<password>F5s0sE9</password>
</authentication>
</soapenv:Header>
<soapenv:Body>
<OTA_HotelSearchRQ Version="1.002" AltLangID="enUS">
<Criteria>
<Criterion>
<Profiles>
<ProfileInfo>
<Profile LastModifyDateTime="19000101T09:30:47.0Z"/>
</ProfileInfo>
</Profiles>
</Criterion>
</Criteria>
</OTA_HotelSearchRQ>
</soapenv:Body>
</soapenv:Envelope>

For which my piece of code is :

DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE ns2 NAMESPACE 'http://www.opentravel.org/OTA/2003/05';
DECLARE ns3 NAMESPACE 'http://www.w3.org/2001/XMLSchema-instance';

SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)"xmlns" = ns2;
SET OutputRoot.XMLNSC.soapenv:Envelope.(XMLNSC.NamespaceDecl)"xmlns:xsi" = ns3;

SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Header.soapenv:authentication.soapenv:userid = '8072';
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Header.soapenv:authentication.soapenv:password = 'F5s0sE9';
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.soapenv:OTA_HotelSearchRQ.soapenv:Criteria.
soapenv:Criterion.soapenv:Profiles.soapenv:ProfileInfo.soapenv:Profile.(XMLNSC.Attribute)LastModifyDateTime = '1900-01-01T09:30:47.0Z';

But the Response of this is:

<NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NS1:Header>
<NS1:authentication>
<NS1:userid>8072</NS1:userid>
<NS1:password>F5s0sE9</NS1:password>
</NS1:authentication>
</NS1:Header>
<NS1:Body>
<NS1:OTA_HotelSearchRQ>
<NS1:Criteria>
<NS1:Criterion>
<NS1:Profiles>
<NS1:ProfileInfo>
<NS1:Profile LastModifyDateTime="1900-01-01T09:30:47.0Z"/>
</NS1:ProfileInfo>
</NS1:Profiles>
</NS1:Criterion>
</NS1:Criteria>
</NS1:OTA_HotelSearchRQ>
</NS1:Body>
</NS1:Envelope>


Problem here is Every element has NS1 namespace in it, which should not be the case. So what we do to remove that is, From the above ESQL we will take of the Namespace decln for that particular part of msg construction.

Something like this,

SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Header.authentication.userid = '8072';
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Header.authentication.password = 'F5s0sE9';
SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.OTA_HotelSearchRQ.Criteria.Criterion.Profiles.ProfileInfo.Profile.(XMLNSC.Attribute)LastModifyDateTime = '1900-01-01T09:30:47.0Z';

But this is a Incorrect way of Creating XML according to WMB. Which throws the error saying “XML Writing errors have occured”!!

Example 3 : Example of incorrect usage
DECLARE space1 NAMESPACE 'namespace1';
SET OutputRoot.XMLNSC.root.(XMLNSC.NamespaceDecl)xmlns = space1;
SET OutputRoot.XMLNSC.root.example = 'ABCDE';

URL : http://127.0.0.1:2177/help/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac67194_.htm



So now, How can I construct the HotelSearch Req Xml ??

Any suggestions?
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Apr 12, 2011 5:19 am Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Quote:
Any suggestions?


As you have been around a while how's about going back and editing your post and using the Code tags

for example
Code:

This is a code section. This is much easier to read

_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 12, 2011 5:26 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why is it a problem that the elements have explicit namespace prefixes rather than having default namespace prefixes?

Is the service you are trying to talk to written using a non-compliant XML parser?
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 12, 2011 5:52 am Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
...according to WMB. Which throws the error saying “XML Writing errors have occured”!!
Please can you post the rest of the error message. You should be able to find it in the Windows Event Viewer. If you cannot find it there, please take a user trace.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportUrgent!! Problem in XML construction using ESQL
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.