Has anybody been able to call a web service via HTTPS and
also supplying a username/password? I have worked with EXAMPLE7 (Example
of supplying USER/PASS to HTTP server) with a mixture of EXAMPLE3 (to
initialize the SSL API’s) and been able to retrieve a page (via http_url_get)
and save that to the IFS. But can this be modified to use http_url_POST? Here’s a sample snippet: c
eval URL = '' c
eval rc = http_url_get(URL: '/tmp/default.aspx')
c
if rc <>
1
c
callp
http_error(err)
c
if err <>
HTTP_NDAUTH
c
eval msg =
HTTP_ERROR
c
dsply msg
c
return
c
endif
*--the getpasswd routine is in example7 c
exsr
getpasswd
c
eval rc = http_url_get(URL: '/tmp/default.aspx’) This saves the file just fine… then I change the URL,
modify the data, then do a url_post to call a web service: c
eval URL = ''
+ c
'/CimaxReturnType_clsXMLReturn.asmx' + c
'/LoadROList' c eval
data = '' c
eval rc = http_url_post(URL : %addr(data) : %len(%trimr(data)) c
: ‘/tmp/results.xml’ : HTTP_TIMEOUT : HTTP_USERAGENT c
: ‘application/x-www-form-urlencoded’) I get the HTTP 1.1/500 Internal Server error.. When I don’t use https with username/password to the
same web service: data =
''; rc =
http_url_POST('http://dvcifyiapp1:8080/'
+
'CimaxReturnType_clsXMLReturn.asmx'
+
'/LoadROList'
:
%addr(data)
:
%len(%trimr(data))
:
'/tmp/results.xml'
:
HTTP_TIMEOUT
:
HTTP_USERAGENT
: 'application/x-www-form-urlencoded');
This works just fine and saves to results.xml on the IFS. Thanks |