Manually Calling SOAP web services

  1. 4 years ago

    Jim B

    7 Jul 2014 Pre-Release Testers, Xojo Pro Uckfield, England

    Just in case others are facing a similar issue: -

    Just struggled with calling a SOAP web service that returned Base64 data in a string (this was the contents of a file held in a database). It doesn't work! Case 34352.

    So instead I used an HTTPSocket: -

    Dim socket As New HTTPSocket
    Dim SOAPCall As String
    Dim SOAPResponse As String
    Dim XML As New XmlDocument
    Dim Data As String

    ' This generates the SOAP call. I can share this routine if you are interested.
    SOAPCall = GenerateSOAPCall
    URL = "http://dell-laptop/tldisubscriber/dlsubscriber.asmx"
    socket.SetRequestContent(SOAPCall, "text/xml; charset=utf-8")
    SOAPResponse = socket.Post(URL, 30)
    XML.LoadXML (SOAPResponse)

    ' This was a test app so not the best way of reaching the data! But if you now save "Data" to a file, the file is correctly created!
    Data = DecodeBase64(XML.FirstChild.FirstChild.FirstChild.FirstChild.Child(1).FirstChild.Value)

  2. Tim H

    7 Jul 2014 Pre-Release Testers Portland, OR USA

    You may also need to set the SOAPAction header.

    socket.SetRequestHeader("SOAPAction", ActionName)

  3. 3 months ago
    Edited 3 months ago

    @Jim B Just in case others are facing a similar issue: -

    Just struggled with calling a SOAP web service that returned Base64 data in a string (this was the contents of a file held in a database). It doesn't work! Case 34352.

    So instead I used an HTTPSocket: -

    Dim socket As New HTTPSocket
    Dim SOAPCall As String
    Dim SOAPResponse As String
    Dim XML As New XmlDocument
    Dim Data As String

    ' This generates the SOAP call. I can share this routine if you are interested.
    SOAPCall = GenerateSOAPCall
    URL = "http://dell-laptop/tldisubscriber/dlsubscriber.asmx"
    socket.SetRequestContent(SOAPCall, "text/xml; charset=utf-8")
    SOAPResponse = socket.Post(URL, 30)
    XML.LoadXML (SOAPResponse)

    ' This was a test app so not the best way of reaching the data! But if you now save "Data" to a file, the file is correctly created!
    Data = DecodeBase64(XML.FirstChild.FirstChild.FirstChild.FirstChild.Child(1).FirstChild.Value)

    But, so You Invoke a Webservice that lack of WSDL Definition??

    So I have a WSDL Webservice (WCF - Windows Common Foundation) That lacks of WSDL Definition, nevertheless, It receives requests and Also answer that requests.

    But only on VB dot Net, But I'm trying to Replying it on Xojo.

  4. 9 weeks ago

    Hi,
    If your code is working and you managed to call a SOAP web service in this way, Please send me your GenerateSOAPCall procedure.

    thank you very much
    oms336@gmail.com

or Sign Up to reply!