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 » Encapsulate Input XML to SOAP

Post new topic  Reply to topic
 Encapsulate Input XML to SOAP « View previous topic :: View next topic » 
Author Message
anon_kb
PostPosted: Mon Aug 31, 2015 1:16 am    Post subject: Encapsulate Input XML to SOAP Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Hi guys. I would like to ask some help.

All I want to do is to copy the input XML data to the soap xml in short to encapsulate. The code seems correct but it wont produce an output.

Code:
SET OutputRoot.MRM.soap:Body.web:WSEtiqSQS_sessionless.EtiqData."Header" = InputRoot.XMLNSC.ETIQFlow1.Header;


Input XML
Quote:
<?xml version="1.0"?>

-<ETIQFlow1 xsi:noNamespaceSchemaLocation="file://ETIQFlow1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


-<Header>

<!-- Message global codification -->



-<MessageIdentityCard>

<MessageType> </MessageType>

<MessageId>ETIQ_FABRICATE_START</MessageId>

<MessageDescription>ETIQ start test</MessageDescription>


-<MessageVersion>

<MessageHeaderVersion>1.0.0</MessageHeaderVersion>

<MessageBodyVersion>1.0.0</MessageBodyVersion>

</MessageVersion>


-<MessageEmissionDateTime>

<MessageEmissionDate>2015-07-08</MessageEmissionDate>

<MessageEmissionTime>17:41:41</MessageEmissionTime>

</MessageEmissionDateTime>

</MessageIdentityCard>

<!-- Define the identity of the publisher -->

-<MessagePublisher>


-<Publisher>

<PublisherIdentity>ETIQ</PublisherIdentity>

</Publisher>

</MessagePublisher>

</Header>
</ETIQFlow1>


SOAP
Quote:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:web="http://www.starlims.com/webservices/">
<soap:Header/>
<soap:Body>
<web:WSEtiqSQS_sessionless>
<EtiqData>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<Header>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<MessageIdentityCard>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<MessageType>?</MessageType>
<!--Optional:-->
<MessageId>?</MessageId>
<!--Optional:-->
<MessageDescription>?</MessageDescription>
<!--Optional:-->
<MessageVersion>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<MessageHeaderVersion>?</MessageHeaderVersion>
<!--Optional:-->
<MessageBodyVersion>?</MessageBodyVersion>
</MessageVersion>
<!--Optional:-->
<MessageEmissionDateTime>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<MessageEmissionDate>?</MessageEmissionDate>
<!--Optional:-->
<MessageEmissionTime>?</MessageEmissionTime>
</MessageEmissionDateTime>
<!--Optional:-->
<MessageComment>?</MessageComment>
</MessageIdentityCard>
<!--Optional:-->
<MessagePublisher>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<Publisher>
<!--Optional:-->
<XmlType>?</XmlType>
<!--Optional:-->
<PublisherIdentity>?</PublisherIdentity>
</Publisher>
</MessagePublisher>
</Header>


Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 31, 2015 4:17 am    Post subject: Reply with quote

Grand High Poobah

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

That's because you're mixing up 2 different domains: MRM and SOAP.
In fact you should be using either XMLNSC or SOAP as a domain.
If using XMLNSC you have to start at the top i.e. the Envelope
If using SOAP you can start at the body but check out the infocenter for the definition of the namespaces...
Code:
 Set OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.ns1:XmlRoot
Set OutputRoot.SOAP.Body.ns1:XmlRoot


Hope this helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Aug 31, 2015 4:27 am    Post subject: Reply with quote

Grand High Poobah

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

fjb_saper wrote:
That's because you're mixing up 2 different domains: MRM and SOAP.


No he's not. He's this guy, and he's still trying to use MRM to write out XML one tag on one line.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
anon_kb
PostPosted: Mon Aug 31, 2015 10:37 pm    Post subject: Reply with quote

Acolyte

Joined: 13 Nov 2014
Posts: 74

Hi fjb, thanks for you reply. Actually on my code i'm just referring it to another sample on which it runs successfully.

The situation i've created a message set based on a wsdl file. In the code that I referred to here's the code:

Code:

DECLARE ns  NAMESPACE 'urn:ebx-schemas:dataservices_1.0';
DECLARE tns  NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
DECLARE ns1  NAMESPACE 'http://www.openapplications.org/oagis/9';
DECLARE ns2  NAMESPACE 'http://schemas.xmlsoap.org/ws/2002
/04/secext';

--Code Sample
SET Environment.Variables.URL = 'http://webservice';

SET OutputRoot.MQMD       = Environment.MQMD;
SET OutputRoot.Properties    = Environment.Properties;
 SET Environment.XMLNSC = InputRoot.XMLNSC;

SET OutputRoot.MRM.tns:Body.ns:update_presentation.data.root.presentation."presentation.code" = InputRoot.XMLNSC.SyncItem.ns1:SyncItemMaster[2];
SET OutputRoot.MRM.tns:Body.ns:update_presentation.data.root.presentation."presentation.label" = InputRoot.XMLNSC.SyncItem.ns1:SyncItemMaster[2].ns1:DataArea.ns1:ItemMaster.ns1:ItemMasterHeader.ns1:Packaging.ns1:FreeFormTextGroup.ns1:Description;
 SET Environment.Destination.HTTP.RequestURL[1] = Environment.Variables.URL;



My Code:

Code:

   SET Environment.Variables.URL = 'http://webservice';

SET OutputRoot.MQMD       = Environment.MQMD;
      SET OutputRoot.Properties    = InputRoot.Properties;
      SET Environment.Variables.MessageType = 'SQS SessionLess';
      SET OutputRoot.HTTPRequestHeader.SOAPAction = 'http://www.test.com/webservices/WSEtiqSQS_sessionless';
      SET OutputRoot.MRM.tns:Header = '';
SET OutputRoot.MRM.tns:Body.web:WSEtiqSQS_sessionless.EtiqData."Header" = InputRoot.XMLNSC.SyncItem.ns1:ETIQFlow1;   
SET Environment.Destination.HTTP.RequestURL[1] = Environment.Variables.URL;


So you mean its more appropriate to use XMLNSC parser on this? Its my first time to try this web service. Hope you can help me.

I also change the MRM into XMLNSC but still it doesnt workk.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Mon Aug 31, 2015 10:46 pm    Post subject: Reply with quote

Jedi Council

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

Any reason why you don't use the SOAP Nodes for calling the WebService? They make all this encapsulation a whole lot easier.
The samples and some excellent developerworks articles can really help you here.
Ok, so the DW articles are a bit dated but the principles remain the same.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Encapsulate Input XML to SOAP
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.