× 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.



Good Afternoon

I am attempting to communicate with SalesForce's SOAP API via RPGLE and
using Scott Klement's presentations as a guide.
I am having some difficulty and as there is quite a bit I don't understand
I am hoping someone would be able to help.

http://www.scottklement.com/presentations/Web%20Services%20from%20RPG%20with%20HTTPAPI.pdf


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 that
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
changed stuff around to emulate the examples I saw in the presentation.

Thank you for any assistance that can be provided



Successful SOAPUI XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
" 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(
'https://test.salesforce.com/services/Soap/c/36.0/0DFZ00000008P
: %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 xmlns:soapenv="
http://scchemas.xmlsoap.org/soap/envelope/
"><soapenv:Body><soapenv:Fault><faultcode>soapeenv:Client</faultcode><faultstring>SOAPAction
HTTP header missing</faultstring>
</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 addressed and is not intended to be relied upon by any person without subsequent written confirmation of its contents. Accordingly, Sumitomo Machinery Corporation disclaims all responsibility and accept no liability (including in negligence) for the consequences for any person acting, or refraining from acting, on such information prior to the receipt by those persons of subsequent written confirmation. If you have received this e-mail message 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 prohibited.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.