Author |
Message
|
anon_kb |
Posted: Mon Aug 31, 2015 1:16 am Post subject: Encapsulate Input XML to SOAP |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Aug 31, 2015 4:17 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Mon Aug 31, 2015 4:27 am Post subject: |
|
|
 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 |
|
 |
anon_kb |
Posted: Mon Aug 31, 2015 10:37 pm Post subject: |
|
|
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 |
|
 |
smdavies99 |
Posted: Mon Aug 31, 2015 10:46 pm Post subject: |
|
|
 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 |
|
 |
|