消息=服务器无法识别HTTP标头SOAPAction的值:错误
问题描述:
HI伙计, 我已经创建了一个Web服务。我可以使用SOAPUI访问Web服务,但是当我尝试通过我的代码调用时出现此错误。 任何想法?消息=服务器无法识别HTTP标头SOAPAction的值:错误
确定Web服务代码如下所示:
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[WebServiceBindingAttribute(Name = "SoapBinding", Namespace = "xyz")]
[System.ComponentModel.ToolboxItem(false)]
[WebService(Namespace = "http://Search")]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class Stub : System.Web.Services.WebService
{
public Stub()
{
Log.Debug(this,string.Format("this is just a test message"));
}
[WebMethod]
public Response searchAsset(Request serviceTag)
{
}
而我的客户端代码:
Search _search = new Search();
_search.url;
_search.n.wcred;
_search.searchAsset(request);
答
这解决了我的问题与SOAPACTION:
[SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]
SoapServiceRoutingStyle Enumeration SOAPACTION SOAP消息是基于SOAPAction HTTP头路由。 RequestElement SOAP消息根据SOAP消息的XML元素后面的第一个子元素进行路由。
+0
两年来,这个答案仍然是节省培根! 1UP – Bertie 2013-06-04 11:06:08
答
最常见的原因,我听说过这是在任何的价值真实代码:
[WebService(Namespace = "http://Search")]
如果此值不是服务器期望的值,则报告的错误消息会发生。
你忘了显示你的代码(最好是客户**和**服务)。 – 2010-08-11 16:40:34
我解决了。 其实我在wsdl中嘲笑的功能有一些我忘记使用的参数。我添加后开始工作。 – alice7 2010-08-11 18:16:52