我正在尝试调用在 IIS 7.5 内的 Windows 7 机器上运行的 Web 服务。我可以使用soapUI和另一台机器的Java客户端从本地机器调用Web服务,它可以工作。当我尝试在 C 程序中使用 gsoap 框架从远程计算机调用 Web 服务时,我收到 HTTP 400:错误请求。我的请求/回复如下,有什么想法吗?
POST /MyService/AddressService.asmx HTTP/1.1
Host: thisMachine.myDomain.net
User-Agent: gSOAP/2.7
Content-Type: text/xml; charset=utf-8
Content-Length: 714
Connection: close
SOAPAction: "http://thisMachine.myDomain.net/MyService/AddressService.asmx/CheckAddress"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<AddressService1:CheckAddress>
<AddressService1:chkAddress>
<AddressService1:chkCompanyName>Test</AddressService1:chkCompanyName>
<AddressService1:chkStreet1>123 Some Rd</AddressService1:chkStreet1>
<AddressService1:chkStreet2></AddressService1:chkStreet2>
<AddressService1:chkCity>Columbia</AddressService1:chkCity>
<AddressService1:chkState>SC</AddressService1:chkState>
<AddressService1:chkZipcode5>29054</AddressService1:chkZipcode5>
<AddressService1:chkZipcode4></AddressService1:chkZipcode4>
<AddressService1:chkSuite></AddressService1:chkSuite>
</AddressService1:chkAddress>
</AddressService1:CheckAddress>
</SOAP-ENV:Body>
HTTP/1.1 400 Bad Request
Cache-Control: private
Server: Microsoft-IIS/7.5
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Mon, 29 Aug 2011 19:46:55 GMT
Connection: close
Content-Length: 0