How can I call a SOAP 1.2 Web service from a LotusScript agent?

后端 未结 1 1219
说谎
说谎 2021-01-16 00:41

I\'m using a Lotus Domino 9 on a windows Server

I must call a Soap 1.2 web service that is not maintained anymore

The Lotus Web serv

1条回答
  •  情书的邮戳
    2021-01-16 01:21

    Finally I found a solution using the XMLHTTP object

    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 ={}
        soapEnvelope =soapEnvelope & {}
        soapEnvelope =soapEnvelope & {}
    
        ' ...use SoapUI to know the exact envelop structure
    
        soapEnvelope =soapEnvelope & {}
        soapEnvelope =soapEnvelope & {}
    
        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 Sub
    

    0 讨论(0)
提交回复
热议问题