我在windows上使用Lotus 9
我必须调用不再维护的SOAP1.2 web服务
Lotus服务使用者只接受SOAP1.1 web服务,因此我不能使用这个很好的特性绑定web服务。
是否可以从我的LotusScript代理调用SOAP1.2 LotusScript web服务?如果有,需要执行哪些步骤?
发布于 2015-02-19 07:23:57
最后,我找到了一个使用XMLHTTP对象的解决方案
Sub Initialize
Dim xmlhttp As Variant
dim DOMDocument As Variant
Dim soapEnvelope As String
Dim webService As String
dim username As String
Dim password As String
Dim strxml As String
Set xmlhttp = CreateObject("Msxml2.XMLHTTP")
Set DOMDocument = CreateObject("MSXML2.DOMDocument")
webService = "http://server/path/service"
username = "user1"
password = "123456"
soapEnvelope ={<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:doc="http://checkYourOwnEnvelopeDetails.com">}
soapEnvelope =soapEnvelope & {<soap:Header/>}
soapEnvelope =soapEnvelope & {<soap:Body>}
' ...use SoapUI to know the exact envelop structure
soapEnvelope =soapEnvelope & {</soap:Body>}
soapEnvelope =soapEnvelope & {</soap:Envelope>}
DOMDocument.loadXML (soapEnvelope)
Call xmlhttp.open("POST", webService, False,username,password)
Call xmlhttp.setRequestHeader("Content-Type", "application/soap+xml;charset=UTF-8")
Call xmlhttp.setRequestHeader("Username", username)
Call xmlhttp.setRequestHeader("Password", password)
' again, use SoapUI to discover the exact name of the action
Call xmlhttp.setRequestHeader("SOAPAction", "urn:getListAll")
Call xmlhttp.send(DOMDocument.xml)
strxml = xmlhttp.responseText
...
End Subhttps://stackoverflow.com/questions/28580457
复制相似问题