webservice 无法识别请求元素

fendiky 2005-03-29 02:42:30
我在建立了个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=''>。

请问各位是什么原因呢,谢谢。
...全文
1688 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
pclogic 2005-08-11
  • 打赏
  • 举报
回复
碰上同样问题
hb_wxy 2005-08-08
  • 打赏
  • 举报
回复
mark
fendiky 2005-04-01
  • 打赏
  • 举报
回复
等??
fendiky 2005-03-31
  • 打赏
  • 举报
回复
有人可以帮忙吗?谢谢
fendiky 2005-03-30
  • 打赏
  • 举报
回复
上述3个情况:
二我试过了,没有用;
三,我没有用的Proxy端代理,有关吗?
一,我的soap请求如下,应该不缺什么了呀?

不好意思,刚接触web service 。请多多指教,谢谢


<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- <SOAP-ENV:Body SOAP-ENV:encodingStyle="">
- <GetForumInfo SOAP-ENV:encodingStyle="">
<nForumCount SOAP-ENV:encodingStyle="">3</nForumCount>
- <ArrayInForums SOAP-ENV:encodingStyle="">
- <InForums SOAP-ENV:encodingStyle="">
<nForumId SOAP-ENV:encodingStyle="">5</nForumId>
</InForums>
- <InForums SOAP-ENV:encodingStyle="">
<nForumId SOAP-ENV:encodingStyle="">3</nForumId>
</InForums>
- <InForums SOAP-ENV:encodingStyle="">
<nForumId SOAP-ENV:encodingStyle="">2</nForumId>
</InForums>
</ArrayInForums>
</GetForumInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Tomgus 2005-03-29
  • 打赏
  • 举报
回复
一种情况是:使用WSE后,客户端没有加SOAPHeader信息;
二种情况是:是VS.NET2003在Debug版时的一个Bug,你改在Release版发布服务就没这个问题了
三种情况是: WebService端类的命名空间与Proxy端代理类的命名空间不一致。
fendiky 2005-03-29
  • 打赏
  • 举报
回复
试过了,还试不行呢?
~~~
:(
Tomgus 2005-03-29
  • 打赏
  • 举报
回复
停止IIS服务,清除Temporary ASP.NET Files目录
(%WINDOWS%\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files).

12,166

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧