从VB6消费Web服务的最佳方法是什么? [英] What is the best way to consume a web service from VB6?

查看:204
本文介绍了从VB6消费Web服务的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从我的VB6程序中使用外部Web服务。如果可能,我希望能够部署我没有SOAP工具包的程序,但这不是必需的。我没有Web服务源,我没有创建它。这是一个供应商提供的服务。



所以在SOAP工具包之外,从VB6消费Web服务的最好方法是什么?

解决方案

我使用此函数从Web服务获取数据。

 私有函数HttpGetRequest(url As String)As DOMDocument 
Dim req As XMLHTTP60
Set req = New XMLHTTP60
req.OpenGET,url,False
req .send

Dim resp作为DOMDocument
如果req.responseText<> vbNullString然后
设置resp =新建DOMDocument60
resp.loadXML req.responseText
Else
设置resp = req.responseXML
结束If
设置HttpGetRequest = resp
结束功能


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服务的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆