简体   繁体   English

通过服务参考添加ASMX Web服务后可以访问可靠消息传递

[英]Reliable Messaging accessible after adding ASMX web service via Service Reference

In VS2013 I have added Service Reference, not Web Reference, to existing legacy ASMX web service(s). 在VS2013中,我向现有的旧版ASMX Web服务中添加了Service Reference,而不是Web Reference。

Does this somehow give this reference the ability to implement WCF features like Reliable Messaging, or any other new features of WCF? 这是否以某种方式使该参考能够实现WCF功能(如可靠消息传递)或WCF的任何其他新功能?

I have done some reading and I think that at least for Reliable Messaging we do not magically get this ability, since as I understand it this feature has to be both enabled on the 'client' and 'server' side, ie both endpoints, and of course the old ASMX web services, the server in this case, don't support Reliable Messaging standard, even if I were to somehow configure the 'client' to do so. 我已经读过一些书,并且我认为至少对于可靠消息传递,我们并没有神奇地获得此功能,因为据我了解,必须同时在“客户端”和“服务器”侧启用此功能,即两个端点都必须启用此功能,并且当然,在这种情况下,旧的ASMX Web服务(在这种情况下为服务器)不支持可靠消息传递标准,即使我要以某种方式配置“客户端”也是如此。

I have been told by resident developers to add these old ASMX web services as a Service Reference as it gives the ability to do async calls and 'some' other configuration benefits, but I am not too sure about this from what I have now read. 居民开发人员告诉我,将这些旧的ASMX Web服务添加为服务参考,因为它可以执行异步调用和“一些”其他配置好处,但是从我现在阅读的内容来看,我不太确定。

What you need is an adapter pattern. 您需要的是适配器模式。 The way I am looking at it is more from design patterns perspective rather than WCF. 我看待它的方式更多是从设计模式的角度而不是WCF。

[ServiceContract]
public interface IService
{
    [OperationContract]
    string SayHello(string toWhom);
}


public class Service : IService
{
    public string SayHello(string toWhom)
    {
        // consume the ASMX service here and return the result.

    }
}

in the binding you can use the features that are missing in ASMX. 在绑定中,您可以使用ASMX中缺少的功能。

<bindings>
  <wsHttpBinding>
    <binding>
      <reliableSession/>
      <security>
        <message />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM