简体   繁体   English

将ASMX Web服务迁移到WCF

[英]ASMX Web service migration to wcf

We have developed the wcf service with the existing web service code. 我们使用现有的Web服务代码开发了wcf服务。 the existing customer wants to consume that service only changing the new url. 现有客户只想通过更改新网址来使用该服务。 They do not want to replace the proxy class. 他们不想替换代理类。 is it possible in any case. 在任何情况下都有可能吗

The customer is able to consume the same with replacing the proxy and config. 客户可以通过替换代理和配置来使用相同的资源。 but he does not want to replace the proxy. 但他不想替换代理。 please share ur comments whether it is possible or not. 请分享您的评论,无论是否可行。

You may be able to do this by configuring an endpoint using basicHttpBinding . 您可以通过使用basicHttpBinding配置端点来做到这一点。 I believe you will also need to force the use of the XML Serializer, and I don't know how to do that offhand, so someone else will have to help you with that. 我相信您还需要强制使用XML序列化器,而且我不知道该如何立即使用,因此其他人将不得不为您提供帮助。 I'm concerned that there could still be small differences that would cause errors using the same proxy class. 我担心使用相同的代理类可能仍然会有一些小的差异,从而导致错误。

On the other hand, if performance isn't the top consideration, you could create an ASMX service using the original class and method attributes from the old service. 另一方面,如果性能不是首要考虑因素,则可以使用旧服务中的原始类和方法属性来创建ASMX服务。 This ASMX service would then call the WCF service. 然后,此ASMX服务将调用WCF服务。

BTW, the ASMX service could call the WCF service on a fast endpoint. 顺便说一句,ASMX服务可以在快速终结点上调用WCF服务。 If they were running on the same server, they could use netNamedPipesBinding , for instance, but in any case could use netTcpBinding , which uses binary over TCP/IP. 例如,如果它们在同一台服务器上运行,则可以使用netNamedPipesBinding ,但是在任何情况下都可以使用netTcpBinding ,后者使用基于TCP / IP的二进制文件。 That would mitigate the performance difference from the extra hop. 这将减轻额外跳的性能差异。

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

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