如何使用 VB6 的 Web 服务? [英] How to consume a web service from VB6?
本文介绍了如何使用 VB6 的 Web 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从我的 VB6 程序中使用外部 Web 服务.如果可能的话,我希望能够在没有 SOAP 工具包的情况下部署我的程序,但这不是必需的.我没有 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.
那么在 SOAP 工具包之外,使用来自 VB6 的 Web 服务的最佳方式是什么?
So outside of the SOAP toolkit, what is the best way to consume a web service from VB6?
推荐答案
我使用此函数从 Web 服务获取数据.
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 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文