How to consume a web service from VB6?

前端 未结 7 2164
囚心锁ツ
囚心锁ツ 2020-11-27 21:28

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

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 21:30

    Assuming that you're running on Windows XP Professional or above, one interesting method is to use the SOAP moniker. Here's an example, lifted from some MSDN page. I don't know if this particular service works, but you get the idea...

       set SoapObj = GetObject
           ("soap:wsdl=http://www.xmethods.net/sd/TemperatureService.wsdl")
       WScript.Echo "Fairbanks Temperature = " & SoapObj.getTemp("99707")
    

    This mechanism also works from VBScript. Which is nice.

提交回复
热议问题