我使用 C# 设置了一个 Web 服务,并在 IIS 6 中发布它,SOAP 1.2 请求和响应应该是这样的:
SOAP1.2 请求
POST /WebServices/EUWS.asmx HTTP/1.1
Host: 10.30.178.81
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Add xmlns="http://www.eutesttools.com">
<num1>double</num1>
<num2>double</num2>
</Add>
</soap12:Body>
</soap12:Envelope>
SOAP1.2 响应
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<AddResponse xmlns="http://www.eutesttools.com">
<AddResult>double</AddResult>
</AddResponse>
</soap12:Body>
</soap12:Envelope>
但实际上当我发布这个请求时:
Content-Type application/soap+xml
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Add xmlns="http://www.eutesttools.com">
<num1>3</num1>
<num2>5</num2>
</Add>
</soap12:Body>
</soap12:Envelope>
然后我总是得到这样的回应:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AddResponse xmlns="http://www.eutesttools.com">
<AddResult>8</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>
为什么我无法得到所描述的响应?