|
You should direct this question to Scott's FTP & HTTP API listfor you to use.
http://www.scottklement.com/mailman/listinfo/ftpapi
Once there, you may want to look into Thomas Raddatz's WSDL2RPG
utility builds an RPGLE interface for the web service from the WSDL
http://www.tools400.de/English/Freeware/WSDL2RPG/wsdl2rpg.html
WSDL2RPG uses Scott's HTTP API to communicate, and is also supported
on Scott's list.
Charles
On Thu, Apr 14, 2016 at 4:08 PM, <RWesh@xxxxxxxxxxx> wrote:
Good Afternoon
I am attempting to communicate with SalesForce's SOAP API via RPGLE
and using Scott Klement's presentations as a guide.understand
I am having some difficulty and as there is quite a bit I don't
I am hoping someone would be able to help.http://www.scottklement.com/presentations/Web%20Services%20from%20RPG%
20with%20HTTPAPI.pdf
that
I have successfully generated a WSDL and performed a login request
as a test via SOAPUI I am now attempting to write code in RPGLE
using HTTPAPI to duplicate
same XML that seemed to work so well, but I receive errors and I'm
unsure about a few things.
1) Can I not use the exact same soap message that worked correctly
in SOAPUI within my RPGLE code? I notice the presentation uses
"tns:" suffix whereas SOAPUI uses "urn:"
2) This goes along with question 1 but are there certain standards I
should be using in RPGLE for SOAP? For example, Scott uses
<SOAP:Header> whereas SOAPUI uses <soapenv:Header>
Below you can also find my constructed SOAP message and post which I
presentation.changed stuff around to emulate the examples I saw in the
'https://test.salesforce.com/services/Soap/c/36.0/0DFZ00000008Phttp://schemas.xmlsoap.org/soap/envelope/
Thank you for any assistance that can be provided
Successful SOAPUI XML
<soapenv:Envelope xmlns:soapenv="
" xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Header>
<urn:organizationId>secret</urn:organizationId>
</soapenv:Header>
<soapenv:Body>
<urn:login>
<urn:username>username</urn:username>
<urn:password>PasswordSecurityToken</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
RPGLE snippet
SOAP =
'<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>'
+'<SOAP:Envelope'
+' xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"'
+' xmlns:tns="tns:enterprise.soap.sforce.com">'
+'<SOAP:Header>'
+'<tns:organizationId>ID</tns:organizationId>'
+'</SOAP:Header>'
+'<SOAP:Body>'
+'<tns:login>'
+'<tns:username>username</tns:username>'
+'<tns:password>PasswordSecurityToken</tns:password>'
+'</tns:login>'
+'</SOAP:Body>'
+'</SOAP:Envelope>';
rc = http_url_post(
xmlns:soapenv=": %addr(SOAP) + 2
: %len(SOAP)
: '/tmp/SalesforceTest.soap'
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'text/xml'
: ' ');
httpapi_debug.txt
SetError() #13: HTTP/1.1 500 Server Error
recvresp(): end with 500
recvdoc parms: identity 287
header_load_cookies() entered
recvdoc(): entered
SetError() #0:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
prohibited.http://scchemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapeenv:Client</faultcode><
faultstring>SOAPAction
HTTP header missing</faultstring>addressed
</soapenv:Fault></soapenv:Body></soapenv:Envelope>
My SOAPAction in the post is blank because SOAPUI shows me that
"SOAPACTION" is blank as well.
This document should only be read by those persons to whom it is
and is not intended to be relied upon by any person without(including
subsequent written confirmation of its contents. Accordingly,
Sumitomo Machinery Corporation disclaims all responsibility and
accept no liability
in negligence) for the consequences for any person acting, ormessage
refraining from acting, on such information prior to the receipt by
those persons of subsequent written confirmation. If you have
received this e-mail
in error, please notify us immediately by telephone. Please also
destroy and delete the message from your computer. Any form of
reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message is strictly
----
This is the RPG programming on the IBM i (AS/400 and iSeries)
(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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
This is the RPG programming on the IBM i (AS/400 and iSeries)
(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.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
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.