[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
calling webservice from rpgle
Hello Scott,
I've read your article 'RPG as a Web Service consumer' on
systeminetwork.com. Based on this article I want to connect to a web
service from RPGLE. I've made a very simple Hello World web service.
The soap request looks as follows:
POST /zkhnet/webservices/service.asmx HTTP/1.1
Host: rembert2
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<HelloWorld xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
In my RPGLE program I make the following soap string to send it to the
webservice.
SOAP = '<?xml version="1.0" encoding="US-ASCII">
'
+' <soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
+ ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"
'
+ ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
'
+ ' <soap:Body> '
+ ' <HelloWorld xmlns="http://tempuri.org/" />
'
+ ' </soap:Body>
'
+ ' </soap:Envelope>
';
And then I try to connect to the web service with the following code:
url = 'http://128.128.128.2/zkhnet/webservices/'
+ 'service.asmx';
rc = http_url_post_xml( url
: %addr(SOAP) + 2
: %len(SOAP)
: *NULL
: %paddr(Incoming)
: %addr(TRNS)
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'text/xml'
: 'http://tempuri.org/HelloWorld');
When I use the soap action ('http://tempuri.org/HelloWorld') I get the
error HTTP/1.1 400 Bad Request. When I use *blanks as soap action in
the last parameter I get the error 'HTTP/1.1 500 Internal Server
Error'.
Do you know what I'm doing wrong ? When I look at the loggings on my
webserver I see that I'm connected with the webservice and I see also
the 400 & 500 error codes.
Thanks for your time and answer
Devriendt Nico
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------