VBA API调用返回错误,SoapUI正确返回

问题描述

我有一个在SoapUI中正常工作的POST API调用。我已经使用了可成功用于许多其他API调用的vba代码

    Set objhttp = CreateObject("MSXML2.ServerXMLHTTP")
    With objhttp
        .Open "POST",URL,False
        .setRequestHeader "Content-Type","text/xml; charset=UTF-8"
        .send (stXML)
        .waitForResponse
        Result = .responseText
    End With

但这会产生以下错误

<faultstring xml:lang="en-GB">The message with Action '' cannot be processed at the receiver,due to a ContractFilter mismatch at the Endpointdispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements,e.g. Message,Transport,None).</faultstring>

每个呼叫的URL都相同,并且发送的XML也相同。

stXML

     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:GetConsignmentTracking>
         <tem:userName>USERNAME</tem:userName>
         <tem:password>PASSWORD</tem:password>
         <tem:consignmentNumber>TRACKINGNUMBER</tem:consignmentNumber>
      </tem:GetConsignmentTracking>
   </soapenv:Body>
</soapenv:Envelope>

如何在VBA中使用它? 预先感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)