[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: HTTPAPI - Post to SOAP Web Service



This presentation goes over the basic ideas with code snippets. 
http://www.scottklement.com/presentations/Web%20Services%20and%20XML%20for%20RPGers.pdf

In the presentation, Scott shows escaping data but you would escape the whole IFS file. If you have the data in the IFS, this would require a second file for the output. Or if you can adjust the program that writes the file in the first place, you can escape the data there.

This post explains something similar to your situation:
http://www.scottklement.com/archives/ftpapi/200703/msg00025.html

As far as what procedure to use to send the data, it depends. But, if you intend to create the data in the IFS and send from there...
http_url_post_stmf
Then you would process any returned xml using 
http_parse_xml_smtf
Or you could use
http_post_stmf_xml if you wanted to process the returned XML "in-line".
Or you could use
http_post_stmf_xmltf which would send from the IFS and receive to the IFS and then call your parse routine



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Brian
Sent: Wednesday, September 17, 2014 9:27 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: HTTPAPI - Post to SOAP Web Service

Hi List:

I wanted to ask the broader group on the list if they have thoughts or methods to escape an XML file on the IFS so it can be inserted as the payload in the SOAP message?

Thanks all.

On 9/15/2014 2:02 PM, Brian wrote:
> Hi Scott,
>
> I believe you are correct about escaping the XML that will be the 
> payload inside the SOAP message.
>
> Can you shed some light on how I can best do this?  I don't see any 
> examples or specific parts of HTTPAPI that do this.  But, I could be 
> overlooking something as well.
>
> Thank you.
>
> On 9/4/2014 1:28 PM, Scott Klement wrote:
>> I would think that you'd need to escape your XML so that it can be 
>> sent as a character string in the SOAP message.
>> That's what I usually see when you send an XML document as the 
>> payload of a SOAP message (which is also an XML document)
>>
>>
>> For example:
>>
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
>> xmlns:wsm="http://www.partner.com/wsMsgEdgeRecv";>
>>    <soapenv:Header/>
>>    <soapenv:Body>
>>       <wsm:MSGEdgeReceive>
>>          <!--Optional:-->
>>          <wsm:strIncomingMsg>
>>                 &lt;XMLDataStuff &gt; 
>> &lt;MyData&gt;12345&lt;\MyData&gt;
>>                 &lt;\XMLDataStuff&gt;
>>         </wsm:strIncomingMsg>
>>       </wsm:MSGEdgeReceive>
>>    </soapenv:Body>
>> </soapenv:Envelope>
>>
>>
>>
>>
>> On 9/3/2014 2:04 PM, Brian wrote:
>>> Hi List,
>>>
>>> I am hoping you can help me with a question.
>>>
>>> I have a WSDL file that has the info for a web service I must use to 
>>> post an XML file.  I opened the WSDL file in SOAPUI and it shows me
>>> this:
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
>>> xmlns:wsm="http://www.partner.com/wsMsgEdgeRecv";>
>>>    <soapenv:Header/>
>>>    <soapenv:Body>
>>>       <wsm:MSGEdgeReceive>
>>>          <!--Optional:-->
>>> <wsm:strIncomingMsg>?</wsm:strIncomingMsg>
>>>       </wsm:MSGEdgeReceive>
>>>    </soapenv:Body>
>>> </soapenv:Envelope>
>>>
>>> I have an XML document that my program creates and stores on the 
>>> IFS.  I believe my XML needs to be placed inside of these tags in 
>>> this XML:
>>>
>>> <wsm:strIncomingMsg>?</wsm:strIncomingMsg>
>>>
>>> Right now, for example, my program creates an XML document that 
>>> looks like this:
>>>
>>> <XMLDataStuff>
>>>     <MyData>12345<\MyData>
>>> <\XMLDataStuff>
>>>
>>> I am thinking in my program that builds the XML, I just need to add 
>>> these soap wrapper tags so my XML would look like this:
>>>
>>> <soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
>>> xmlns:wsm="http://www.partner.com/wsMsgEdgeRecv";>
>>>    <soapenv:Header/>
>>>    <soapenv:Body>
>>>       <wsm:MSGEdgeReceive>
>>>          <!--Optional:-->
>>>          <wsm:strIncomingMsg>
>>>                 <XMLDataStuff>
>>>                     <MyData>12345<\MyData>
>>>                 <\XMLDataStuff>
>>>         </wsm:strIncomingMsg>
>>>       </wsm:MSGEdgeReceive>
>>>    </soapenv:Body>
>>> </soapenv:Envelope>
>>>
>>> Is that correct?  In the SOAP examples I've looked at, the SOAP 
>>> string is built as one big string so I am thinking I more or less 
>>> need to do the same, except my SOAP document will be a file stored 
>>> on the IFS with the payload encased in the SOAP "stuff" like above.
>>>
>>> If I am correct on creating the full soap XML on the IFS, how should 
>>> I send this to the web service URL?  I looked at HTTPAPI but I am 
>>> not sure how I need to encode the data and what API to use to send.
>>>
>>> Thanks all.
>>>
>>> --------------------------------------------------------------------
>>> --- This is the FTPAPI mailing list.  To unsubscribe, please go to:
>>> http://www.scottklement.com/mailman/listinfo/ftpapi
>>> --------------------------------------------------------------------
>>> ---
>>>
>>
>> ---------------------------------------------------------------------
>> -- This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> ---------------------------------------------------------------------
>> --
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------