Powerbuilder使用BasicAuthentication调用WebService [英] Powerbuilder call WebService with BasicAuthentication
本文介绍了Powerbuilder使用BasicAuthentication调用WebService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用PB 11.5.1(经典),并且希望将XML传递给使用BasicAuth的Web服务。
I am using PB 11.5.1 (Classic) and I want to pass an XML to a WebService that uses BasicAuth.
我找不到如何实现BasicAuth的方法。
I cannot find how to implement the BasicAuth.
我已经搜索过论坛/博客,但即使有可能,我也没有找到明确的答案。
I have searched forums/blogs but I found no clear answer if it is even possible.
任何感谢帮助
推荐答案
也许您可以使用 oleobject
来使用 MSXML.ServerXMLHTTP
:
Perhaps you can use an oleobject
which uses MSXML.ServerXMLHTTP
:
// args: as_username, as_password, as_basicauthstring
oleobject lole_http
string ls_response
lole_http = create oleobject
lole_http.ConnectToNewObject("msxml2.ServerXMLHTTP")
lole_http.Open("POST", ls_theurl, FALSE, as_username, as_password)
lole_http.setTimeouts 5000, 5000, 10000, 10000 //ms - resolve, connect, send, receive
lole_http.setRequestHeader("Authorization", "Basic " + as_basicauthstring) // set your basic auth string here
lole_http.Send(xmlToSend)
ls_response = lole_http.responseText
lole_http.DisconnectObject()
这篇关于Powerbuilder使用BasicAuthentication调用WebService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文