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 » Convert XML to SOAP message

Post new topic  Reply to topic
 Convert XML to SOAP message « View previous topic :: View next topic » 
Author Message
CAONIMA
PostPosted: Wed Feb 03, 2016 10:58 am    Post subject: Convert XML to SOAP message Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Hi All,

I have a flow like this:

MQ Input ----> Compute Node1 ------> SOAP Request------->Compute Node2

The input file is XML, in the compute node1, I will generate a new soap message for the soap request.

My question is how can I convert the xml message to the SOAP message and where can I find the right namaspace?

Many thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 03, 2016 11:10 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand High Poobah

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

CAONIMA wrote:
how can I convert the xml message to the SOAP message


Same way you'd convert the XML message to any other format. If you're using a Compute node I'd assume you've settled on ESQL.

CAONIMA wrote:
where can I find the right namaspace?


From the WSDL that matches the web service you're calling, or from the guy who owns the web service if he's not seen fit to provide a WSDL (some kind of gateway web service for example).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
CAONIMA
PostPosted: Wed Feb 03, 2016 11:27 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Thank you for your answer.

Should I generate a soap header or just write :

Set OutputRoot.XMLNSC.ns:sdf:ns:df= InputRoot.XMLNSC.sdf.df.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 03, 2016 11:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should generate the message your flow needs.

It would probably help to read the knowledge center, review any training materials you have, and review the samples.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Feb 03, 2016 1:04 pm    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand High Poobah

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

CAONIMA wrote:
Should I generate a soap header or just write :

Set OutputRoot.XMLNSC.ns:sdf:ns:df= InputRoot.XMLNSC.sdf.df.


Well that depends on:

- the answer to "what's going on about namesapces?"
- if there's a WSDL or not, and if there is, how you're using it within IIB
- does the web service in question need a SOAP header or not?
- if it does, can the SOAPRequest node generate it automatically from the information available

etc

etc

It's unlikely that it's going to be as simple as a single line of ESQL. You'd at least need another one to the one you posted to define the ns prefix you've quoted.

I concur with my most worthy associate.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
CAONIMA
PostPosted: Thu Feb 04, 2016 9:02 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Vitor wrote:
CAONIMA wrote:
Should I generate a soap header or just write :

Set OutputRoot.XMLNSC.ns:sdf:ns:df= InputRoot.XMLNSC.sdf.df.


Well that depends on:

- the answer to "what's going on about namesapces?"
- if there's a WSDL or not, and if there is, how you're using it within IIB
- does the web service in question need a SOAP header or not?
- if it does, can the SOAPRequest node generate it automatically from the information available

etc

etc

It's unlikely that it's going to be as simple as a single line of ESQL. You'd at least need another one to the one you posted to define the ns prefix you've quoted.

I concur with my most worthy associate.


Hi,

Thank you for you kindly reply.

I have a WSDL file and already invoked it into SOAP Request Node, There are many namespaces in the WSDL, I don't know which namesapce should I use to generate the soap message.

For right now, I just write:

Code:
 SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:CUSTOMER_CODE = InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.CUSTOMER_CODE;
      SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:TICKET_NUMBER = InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.TICKET_NUMBER;
      SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:COST_CENTER = InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.COST_CENTER;
      SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:NOTE = InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.NOTE;
      SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:NC_COMPENSATE_DETAIL.ns:PRODUCT_CODE=InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.NC_COMPENSATE_DETAIL.PRODUCT_CODE;
      SET OutputRoot.SOAP.Body.ns:SW_COMPENSATE.ns:NC_COMPENSATE_HDR.ns:NC_COMPENSATE_DETAIL.ns:QUANTITY=InputRoot.XMLNSC.SW_COMPENSATE.NC_COMPENSATE_HDR.NC_COMPENSATE_DETAIL.QUANTITY;


Only one namespace I use, how can I find the right namespace stucture?

Thank you very much.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Feb 04, 2016 9:08 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

CAONIMA wrote:
Only one namespace I use, how can I find the right namespace stucture?


By looking at the WSDL.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 04, 2016 9:12 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand High Poobah

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

mqjeff wrote:
CAONIMA wrote:
Only one namespace I use, how can I find the right namespace stucture?


By looking at the WSDL.




If you've imported the WSDL, you can use the Toolkit to help navigate. For example, the auto complete function include the namespace prefix and definition. You might find it advantageous to manually clean up afterwards if you've a lot of ESQL but in any event the code is functional.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
CAONIMA
PostPosted: Thu Feb 04, 2016 9:27 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Vitor wrote:
mqjeff wrote:
CAONIMA wrote:
Only one namespace I use, how can I find the right namespace stucture?


By looking at the WSDL.




If you've imported the WSDL, you can use the Toolkit to help navigate. For example, the auto complete function include the namespace prefix and definition. You might find it advantageous to manually clean up afterwards if you've a lot of ESQL but in any event the code is functional.


Thank you very much.

Now I am getting the exception, said

Quote:
no operation found matching payload


Is that the namespace problem.

By the way, how can I use the toolkit to help me nagvigate the soap message?

Many thanks!
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 04, 2016 9:36 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand High Poobah

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

CAONIMA wrote:
Now I am getting the exception, said

Quote:
no operation found matching payload


Is that the namespace problem.


It's the prime suspect certainly; the XML doesn't match anything in the WSDL and if the structure is right (and you can easily see that from the code) the next most likely problem is the use of the wrong namespace for an element or elements.

CAONIMA wrote:
By the way, how can I use the toolkit to help me nagvigate the soap message?


As I mention above, I find the fastest and easiest method to be the auto-complete. Others may prefer different methods which may prove to be better in your use case.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
CAONIMA
PostPosted: Thu Feb 04, 2016 11:08 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Acolyte

Joined: 03 Dec 2014
Posts: 65

Vitor wrote:
CAONIMA wrote:
Now I am getting the exception, said

Quote:
no operation found matching payload


Is that the namespace problem.


It's the prime suspect certainly; the XML doesn't match anything in the WSDL and if the structure is right (and you can easily see that from the code) the next most likely problem is the use of the wrong namespace for an element or elements.

CAONIMA wrote:
By the way, how can I use the toolkit to help me nagvigate the soap message?


As I mention above, I find the fastest and easiest method to be the auto-complete. Others may prefer different methods which may prove to be better in your use case.



Thanks very much,

The soap message will like this:
Code:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cre="http://xmlns.oracle.com/CreateSalesOrderProcess">
   <soapenv:Header/>
   <soapenv:Body>
      <cre:createSalesOrderInput>
         <cre:input>
            <!--1 or more repetitions:-->
            <cre:order>
               <cre:region>?</cre:region>
               <cre:organizationCode>?</cre:organizationCode>
               <cre:accountNumber>?</cre:accountNumber>
               <cre:siteId>?</cre:siteId>
               <cre:location>?</cre:location>
               <cre:ticketNumber>?</cre:ticketNumber>
               <cre:costCenter>?</cre:costCenter>
               <cre:note>?</cre:note>
               <cre:lines>
                  <cre:line>
                     <cre:productCode>?</cre:productCode>
                     <cre:quantity>?</cre:quantity>
                  </cre:line>
               </cre:lines>
            </cre:order>
         </cre:input>
      </cre:createSalesOrderInput>
   </soapenv:Body>
</soapenv:Envelope>



How can I generate the namespace?
Just like:

Code:
Set OutputRoot.SOAP.Body.ns:XXX.ns:XXX=InputRoot.xxx


Thanks for your kindly reply.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 04, 2016 11:20 am    Post subject: Re: Convert XML to SOAP message Reply with quote

Grand High Poobah

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

CAONIMA wrote:
How can I generate the namespace?
Just like:

Code:
Set OutputRoot.SOAP.Body.ns:XXX.ns:XXX=InputRoot.xxx


No.

There's a difference between a namespace (the URL definition of an XML element) and a namespace prefix (the letters before the : that make it easier to read. You need to define the namespace within the ESQL, and make sure it's added to the message tree as well as the payload.

Start reading here and follow the links as needed.

Or use the auto-complete in the Toolkit like I do.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » Convert XML to SOAP message
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.