Forum OpenACS Development: Re: XML-RPC on HTTPS

Collapse
4: Re: XML-RPC on HTTPS (response to 3)
Posted by Iuri Sampaio on
In fact there is!
ns_httpopen is used within packages/xml-rpc/tcl/xml-rpc-procs.tcl
I tried to fix but after switching ns_httpopen to whether [util::http:post] or [ns_http], both started to return errors.

#packages/xml-rpc/tcl/xml-rpc-procs.tcl
set req_hdrs [ns_set create]
# headers necessary for a post and the form variables
ns_set put $req_hdrs Accept "*/*"
ns_set put $req_hdrs User-Agent "[ns_info name]-Tcl/[ns_info version]"
ns_set put $req_hdrs "Content-type" "text/xml"
ns_set put $req_hdrs "Content-length" [string length $content]

Neither
-- set http [ns_httpopen POST $url $req_hdrs 30 $content]
++ set http [util::http::post -url $url -headers $req_hdrs -timeout 30 -body $content]

Nor
-- set http [ns_httpopen POST $url $req_hdrs 30 $content] body $content]
++ set http [ns_http run -method POST -headers $req_hdrs -timeout 30 -body $content $url]

The remote call for testing purposes was:
catch {xmlrpc::remote_call http://www.evex.co/RPC2 blogger.newPost -string "dsdsddfrerevgrtere" -int 1197 -string "mailto:iuri@iurix.com"; -string "jDEDW€@234fghaiIGJANEPQ" -string "text body" -boolean tru\ e} result

See logs bellow

Best wishes,
Iuri



Notice: request processor did not set ad_conn untrusted_user_id, fallback: 0 [02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-] Error: xmlrpc::remote_call url: http://www.evex.co/RPC2 request: ?xml version="1.0"? blogger.newPost mailto:dsdsddfrerevgrtere1197iuri@iurix.comjDEDW€@234fghaiIGJANEPQtext body1 error: can not find channel named ""
[02/Apr/2017:17:08:07][9989.b51f8b70][-conn:evex:4-]
Notice: HTTP_ERROR {HTTP request failed due to "can not find channel named """}