× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

The easiest way is to use a tool like SoapUI which reads a WSDL file and generates the complete SOAP request.

Looking at the raw data it is then just filling in the parameters and you're done.

Kind regards,
Paul

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Robert J. Mullis
Sent: donderdag 20 december 2012 22:43
To: RPG programming on the IBM i / System i
Subject: Re: HTTPAPI and Webservices

Hi Scott.

This is a sample of the SOAP message that I would send:

<?xml version="1.0"?>
-<soapenv:Envelope
xmlns:soap="http://servicegate.infolock.com/MSC/ServiceSys/SOAPHandler";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>-<soapenv:Header>-<soap:RequestHeader><soap:Affiliation>af</soap:Affiliation><soap:Requestor>sv0</soap:Requestor><soap:TimeoutSeconds>10</soap:TimeoutSeconds></soap:RequestHeader></soapenv:Header>-<soapenv:Body>-<soap:SOAPRequest>-<RequestDocument>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?> <msvauth:Servicegate-Authorization
xmlns:msvdict="http://servicegate.infolock.com/ns/sv/v2.0/dictionary";
xmlns:msvbase="http://servicegate.infolock.com/ns/sv/v2.0/basetypes";
xmlns:msvauth="http://servicegate.infolock.com/ns/sv/v2.0/auth";
xmlns:msvtrx="http://servicegate.infolock.com/ns/sv/v2.0/transaction";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://servicegate.infolock.com/ns/sv/v2.0/auth
http://servicegate.beta.infolock.com/public/auth/sv/v2.0/request.xsd";
DocVersion="2.0" Id="A1"> <msvtrx:SoftwareInfo> <msvtrx:Name>Name0</msvtrx:Name> <msvtrx:Version>1.0</msvtrx:Version>
</msvtrx:SoftwareInfo> <msvtrx:Transaction Id="T1"> <msvtrx:Number>123456</msvtrx:Number> <msvtrx:Type>Sale</msvtrx:Type> <msvtrx:AuthorizationType>Auth</msvtrx:AuthorizationType>
<msvtrx:TerminalId>10290000297</msvtrx:TerminalId>
<msvtrx:BatchNumber>100</msvtrx:BatchNumber>
<msvtrx:Currency>USD</msvtrx:Currency> <msvtrx:Time TimeZone="US-CHICAGO">2012-05-04T18:13:51</msvtrx:Time> <msvtrx:CardInfo Type="Avcard" Expiry="2014-07"> <msvtrx:CardNumber>6010295001064972</msvtrx:CardNumber> </msvtrx:CardInfo> <msvtrx:Amount>105.00</msvtrx:Amount>
<msvtrx:PurchaseOrderNumber>PO1234</msvtrx:PurchaseOrderNumber>
<msvtrx:AircraftTailNumber>TAIL123456</msvtrx:AircraftTailNumber>
<msvtrx:Detail Id="D015"> <msvtrx:Number>1</msvtrx:Number> <msvtrx:ItemCode>JetAFuel</msvtrx:ItemCode>
<msvtrx:Amount>100.00</msvtrx:Amount> <msvtrx:Rate Type="PerUnit">5.000</msvtrx:Rate> <msvtrx:Quantity Units="USGallon">20.000</msvtrx:Quantity> <msvtrx:DeliveryTime TimeZone="US-CHICAGO">2012-05-04T18:13:51</msvtrx:DeliveryTime>
</msvtrx:Detail> <msvtrx:Detail Id="D016"> <msvtrx:Number>2</msvtrx:Number> <msvtrx:ParentDetail Id="D015"/> <msvtrx:ItemCode>SalesTax</msvtrx:ItemCode>
<msvtrx:Amount>5.00</msvtrx:Amount> <msvtrx:Rate Type="Percentage">5.0</msvtrx:Rate> </msvtrx:Detail> </msvtrx:Transaction> </msvauth:Servicegate-Authorization> ]]> </RequestDocument></soap:SOAPRequest></soapenv:Body></soapenv:Envelope>

Apologies in advance if this is obvious. I am a relative novice when it comes to this SOAP stuff. I don't believe I would have to worry about escaping my XML data in the "RequestDocument" element of the SOAP. The XML is within CDATA. Correct?

-----Original Message-----
From: Scott Klement
Sent: Thursday, December 20, 2012 2:09 PM
To: RPG programming on the IBM i / System i
Subject: Re: HTTPAPI and Webservices

hi Robert,

Yes, I think you're right, Robert. For example, if your XML currently looks like this:

<myXML>Data</myXML>

then in a wrapped SOAP message it'd look something like this:

<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope";
xmlns:tns="urn:WellingtonRoyceXmlWrapper">
<soap:Body>
<tns:YourRequest>
<tns:Data>&lt;myXML&gt;Data&lt;/myXML&gt;</tns:Data>
</tns:YourRequest>
</soap:Body>
</soap:Envelope>

Granted, I made up some of the names ("YourRequest", "Data", the TNS
namespace) but that's the general idea. The original XML is escaped into character entities and placed in a parameter of a SOAP message.

It shouldn't be hard to build this message in an RPG program, and send it via HTTPAPI. The hardest part will be escaping the existing XML data
-- but it shouldn't be too bad. If you can't figure it out, let me know.

When the output message is sent back, you can use HTTPAPI's XML parser to extract the original XML data -- it'll automatically "unescape" it for you.

-SK


On 12/20/2012 11:53 AM, Robert J. Mullis wrote:
Thanks Scott.

My XML will stay the same. It is "wrapped" in a SOAP message for the
web service. If I understand everything correctly, I should still be
able to use my same HTTP process that I am using now. The only
difference is that I will need to "wrap" the XML in a SOAP message,
before sending it. When the XML is returned, I will need to remove
the SOAP message "wrapper", before I can parse the XML. Is my
assumption correct?

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.