没有SOAPAction头WCF Web服务 [英] WCF web service without SOAPAction header

查看:325
本文介绍了没有SOAPAction头WCF Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在WCF我可以实现的web服务,使得它不要求SOAPAction头为present中的请求,并因此将分发使用信息主体的根元素名称呼叫?默认情况下,basicHttpBinding的要求SOAPAction报。

How can I implement a web service in WCF such that it does not require the SOAPAction header to be present in the request, and would thus dispatch the call using the message body root element name? By default, BasicHttpBinding requires the SOAPAction.

我想这能提供不使用SOAPActions客户端的兼容性。 这是我的SOAP消息:

I need this to provide compatibility with a client that does not use SOAPActions. This is my SOAP message:

<?xml version='1.0' encoding='UTF-8'?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<messageDeliveryReport xmlns="http://bogus/ns"><status>D</status><systemName>cc</systemName></messageDeliveryReport>
</env:Body></env:Envelope>

和我想它叫'messageDeliveryReport操作。谢谢!

and I want it to call 'messageDeliveryReport' operation. Thanks!

推荐答案

这不是basicHttpBinding的一个问题,它秉承的的SOAP 1.1标准它说:

It's not an issue of BasicHttpBinding, it's an issue of adhering to the SOAP 1.1 standard which says:

An HTTP client MUST use this header field when issuing a SOAP HTTP Request.

所以,你所面对的是什么,这并不符合多数民众赞成存在一个标准自2000年以来,您可能能够解决此问题,通过实施WCF的扩展点,这将在更详细的解释之一的客户端在MSDN文章 WCF扩展与自定义行为,大概无论是 IDispatchMessageInspector IDispatchOperationSelector ,但请求甚至不让它那么远,因为该消息确实不是开始一个有效的SOAP请求与

So what you're dealing with is a client that doesn't conform to a standard that's existed since 2000. You might be able to work around this problem by implementing one of the extensibility points of WCF which are explained in greater detail in the MSDN article Extending WCF with Custom Behaviors, probably either IDispatchMessageInspector or IDispatchOperationSelector, but the request may not even make it that far since the message really isn't a valid SOAP request to begin with.

这篇关于没有SOAPAction头WCF Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆