webservice 无法识别请求元素
我在建立了个soap action
GetForumInfo
测试
测试窗体只能用于使用基元类型或基元类型数组作为参数的方法。
SOAP
下面是一个 SOAP 请求和响应示例。所显示的占位符需要由实际值替换。
POST /webservice1/service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetForumInfo"
<?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>
<GetForumInfo xmlns="http://tempuri.org/">
<nForumCount>int</nForumCount>
<ArrayInForums>
<InForums>
<nForumId>int</nForumId>
</InForums>
<InForums>
<nForumId>int</nForumId>
</InForums>
</ArrayInForums>
</GetForumInfo>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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>
<GetForumInfoResponse xmlns="http://tempuri.org/">
<GetForumInfoResult>
<ForumInfoData>
<nForumId>int</nForumId>
<nPostCount>int</nPostCount>
<nThreadCount>int</nThreadCount>
</ForumInfoData>
<ForumInfoData>
<nForumId>int</nForumId>
<nPostCount>int</nPostCount>
<nThreadCount>int</nThreadCount>
</ForumInfoData>
</GetForumInfoResult>
</GetForumInfoResponse>
</soap:Body>
</soap:Envelope>
请求时候出现如下错误:
<faultcode>soap:Client</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: 无法识别请求元素 <GetForumInfo xmlns=''>。
请问各位是什么原因呢,谢谢。