没有有效的操作参数,无法处理请求。请提供有效的 SOAP 操作。

zhuyc 2015-02-05 04:45:51
最近在模拟一个webservice接受soap请求,出问题了,麻烦给看看。
请求:
<?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:Header>
<HTNGHeader xmlns="http://htng.org/1.1/Header/">
<From>
<Credential>
<userName>fdasdfafs</userName>
<password>123131</password>
</Credential>
</From>
</HTNGHeader>
</soap:Header>
<soap:Body>
<MYTEST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.opent.org/2003/05">
<POS>
<Source>
</Source>
</POS>
<AvailRequestSegments xmlns="http://www.opent.org/2003/05"><AvailRequestSegment>
</AvailRequestSegment>
</AvailRequestSegments>
</MYTEST>
</soap:Body>
</soap:Envelope>

webservice代码:
namespace fdafdafaf.fdafda
{
public class HTNGHeader : SoapHeader
{
public string Username{ get; set; }
public string Password { get; set; }

}

public class mytest
{
public HTNGHeader myheader;
[WebMethod]
[SoapHeader("myheader", Direction = SoapHeaderDirection.In)]
public string fdasfsda()
{
return this.GetResponseByName("fdsafd", "fsdaf");
}
}

}

运行后拿此请求请求提示:
System.Web.Services.Protocols.SoapException: 没有有效的操作参数,无法处理请求。请提供有效的 SOAP 操作。
在 System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
在 System.Web.Services.Protocols.SoapServerProtocol.Initialize()
在 System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)


这问题怎么解决呢?
...全文
3704 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
csdn_zuirenxiao 2016-08-08
  • 打赏
  • 举报
回复
我也遇到了,最后发现自己的服务命名空间写错了
ylx7446 2015-12-24
  • 打赏
  • 举报
回复
来学习一下
ylx7446 2015-12-24
  • 打赏
  • 举报
回复
来学习一下
BitCoffee 2015-11-20
  • 打赏
  • 举报
回复
没有设置Content-Type吧。
引用 4 楼 sanyuv 的回复:
解决了吗?我也遇到这个问题了 ,我qq 1302557666
QQ不要随便就给出来了啊,怎么能这么随便阿,矜持点。
number1170196649 2015-11-20
  • 打赏
  • 举报
回复
怎么回事?我Java调用也遇到了这样的问题。
sanyuv 2015-09-03
  • 打赏
  • 举报
回复
是不是服务器的文件夹要修改可读选项啊
sanyuv 2015-09-03
  • 打赏
  • 举报
回复
解决了吗?我也遇到这个问题了 ,我qq 1302557666
sanyuv 2015-09-03
  • 打赏
  • 举报
回复
解决了吗?我也遇到这个问题了 ,我qq 1302557666
gzlx 2015-08-07
  • 打赏
  • 举报
回复
顶一下: soap:SenderSystem.Web.Services.Protocols.SoapException: 没有有效的操作参数,无法处理请求。请提供有效的 SOAP 操作。 在 System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() 在 System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) 在 System.Web.Services.Protocols.SoapServerProtocol.Initialize() 在 System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
zhuyc 2015-02-11
  • 打赏
  • 举报
回复
没人来就自己顶一下

12,166

社区成员

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

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