C#.asmx“ URL无法识别请求格式”

时间:2018-10-09 08:04:48

标签: c# web-services asmx

我有这个C#网络服务定义

POST /MyServices/WP.asmx HTTP/1.1
Host: example.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://example.net/Authorisation"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Authorisation xmlns="https://example.net/">
      <PMSRequest>string</PMSRequest>
    </Authorisation>
  </soap:Body>
</soap:Envelope>

具有字符串参数并返回JSON字符串,当我尝试通过浏览器访问它时:

https://example.net/MyServices/WP.asmx/Authorisation?PMSRequest="{\"Number\":\"22\"}

我明白了

[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/Authorisation'.]

0 个答案:

没有答案