为什么无法从IIS获取SOAP 1.2响应

时间:2013-01-21 15:07:14

标签: .net web-services soap

我使用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>

为什么我无法得到所描述的回应?

1 个答案:

答案 0 :(得分:1)

正确的回应。前缀无关紧要。