gpt4 book ai didi

web-services - 使用 SOAP 从 VBA 调用 Web 服务

转载 作者:行者123 更新时间:2023-12-02 01:57:35 25 4
gpt4 key购买 nike

我正在尝试在 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

我得到以下回复:

  <?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>

以前有人做过类似的事情吗?

最佳答案

您的 SOAP 操作还应该包括方法的命名空间例如

"http://tempri.org/PutSchedule"

找出您的Service的命名空间并将其添加到方法名称PutSchedule的前面。

关于web-services - 使用 SOAP 从 VBA 调用 Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/241725/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com