相关疑难解决方法(0)

使用SOAP从VBA调用Web服务

我正在尝试在Excel宏中调用Web服务:

Set objHTTP = New MSXML.XMLHTTPRequest
objHTTP.Open "post", "https://www.server.com/EIDEServer/EIDEService.asmx"
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "SOAPAction", "PutSchedule"
objHTTP.send strXML      
Run Code Online (Sandbox Code Playgroud)

我得到以下回复:

  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
      <soap:Fault>
        <faultcode>soap:Client</faultcode>
        <faultstring>Server did not recognize the value of HTTP Header SOAPAction: PutSchedule.</faultstring>
        <detail />
      </soap:Fault>
    </soap:Body>
  </soap:Envelope> 
Run Code Online (Sandbox Code Playgroud)

以前有人做过这样的事吗?

excel vba web-services excel-vba

7
推荐指数
1
解决办法
4万
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1

web-services ×1