Forum OpenACS Development: Re: XML-RPC on HTTPS

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.

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]

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

-- 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 blogger.newPost -string "dsdsddfrerevgrtere" -int 1197 -string "" -string "jDEDW€@234fghaiIGJANEPQ" -string "text body" -boolean tru\ e} result

See logs bellow

Best wishes,

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: request: <?xml version="1.0"?> blogger.newPost mailto:dsdsddfrerevgrtere1197iuri@iurix.comjDEDW€@234fghaiIGJANEPQtext body1 error: can not find channel named ""
Notice: HTTP_ERROR {HTTP request failed due to "can not find channel named """}