简体   繁体   English

创建双WCF和ASMX服务

[英]Creating dual WCF and ASMX services

We have a set of ASMX style web services which were created using the contract first paradigm by having WSDLs and XSDs supplied provided from an outside source. 我们有一组ASMX样式的Web服务,它们是使用契约第一范例创建的,它提供了从外部源提供的WSDL和XSD。

We want to expose WCF services based on these WSDLs, but in the mean time we are also required to continue to provide ASMX services based on the supplied WSDLs. 我们希望基于这些WSDL公开WCF服务,但同时我们还需要继续提供基于提供的WSDL的ASMX服务。

I am curious if there is a way to use a shared Interface based on the WSDLs and/or a shared set of data objects that are generated based on the XSDs... Or another option was possibly wrapping the WCF service with an ASMX... 我很好奇是否有办法使用基于WSDL的共享接口和/或基于XSD生成的共享数据对象集......或者另一种选择可能是使用ASMX包装WCF服务。 。

Any suggestions or previous experience with supporting both to make this transition period easier without entirely reinventing the wheel for both services? 任何建议或以前的经验,支持两个过渡时期更容易,而不完全重新发明两个服务的轮子?

Absolutely, it's totally possible. 绝对是,这是完全可能的。

The best way to do it is to have your WCF and ASMX services simply pass the request on to an internal class defined in an assembly referenced by both the ASMX and WCF service. 最好的方法是让您的WCF和ASMX服务简单地将请求传递给ASMX和WCF服务引用的程序集中定义的内部类。

A refactor for your specific case to follow this paradigm would be trivial for nearly all cases. 对于您的特定情况,遵循此范例的重构对于几乎所有情况都是微不足道的。

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

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