如何使用VB6中的Web服务? [英] How to consume a web service from VB6?
本文介绍了如何使用VB6中的Web服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用我的VB6程序的外部Web服务。我希望能够在不使用SOAP工具包的情况下部署我的程序,但这不是必需的。我没有网络服务源,也没有创建它。它是供应商提供的服务。
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屋!
查看全文