本文介绍了如何从 VB6 使用 Web 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I need to consume an external web service from my VB6 program. I want to be able to deploy my program without the SOAP toolkit, if possible, but that's not a requirement. I do not have the web service source and I didn't create it. It is a vendor-provided service.

So outside of the SOAP toolkit, what is the best way to consume a web service from VB6?

解决方案

I use this function to get data from a web service.

Private Function HttpGetRequest(url As String) As DOMDocument
    Dim req As XMLHTTP60
    Set req = New XMLHTTP60
    req.Open "GET", url, False
    req.send ""

    Dim resp As DOMDocument
    If req.responseText <> vbNullString Then
        Set resp = New DOMDocument60
        resp.loadXML req.responseText
    Else
        Set resp = req.responseXML
    End If
    Set HttpGetRequest = resp
End Function

这篇关于如何从 VB6 使用 Web 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-18 05:24
查看更多