从asmx webservice到wcf服务的透明过渡

发布于 2024-10-06 20:31:42 字数 632 浏览 0 评论 0原文

我正在开发一个项目,用 wcf 服务替换 asmx web 服务。然而,在过渡期间,我希望这两项服务都能为我们的客户服务。

所以我已经实现了一些目标,但是在一些测试过程中我遇到了困难。我收到以下消息:

测试方法IntegrationTests.StrictMatchTests.StrictProviderPass引发异常:System.Web.Services.Protocols.SoapHeaderException:由于操作“https://secure.mydomain.net/core/myMethod”的消息无法在接收方处理, EndpointDispatcher 处的 ContractFilter 不匹配。这可能是因为合同不匹配(发送者和接收者之间的操作不匹配)或发送者和接收者之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合约和相同的绑定(包括安全要求,例如消息、传输、无)..

我公开了一个 asmx 文件,我可以将其作为传统的 Web 服务使用。但是,它们似乎与旧服务不兼容。如果我使用新服务,它就可以正常工作。但我希望这个初始过渡对最终用户是透明的,并随着时间的推移逐渐让他们使用 wcf 服务。

以前有人处理过类似的事情吗?如果是这样,你能指出我正确的方向吗?

提前致谢!

I'm working on a project where I'm replacing an asmx webservice with a wcf service. However, during a transition period, I'd like to have both work for our customers.

So I've achieved this somewhat, however I've run into a wall during some testing. I'm getting the following message:

Test method IntegrationTests.StrictMatchTests.StrictProviderPass threw exception: System.Web.Services.Protocols.SoapHeaderException: The message with Action 'https://secure.mydomain.net/core/myMethod' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)..

I have an asmx file exposed, and I can consume it as a traditional web service. However, they don't seem to be compatible with the older service. If I consume the new service, it works just fine. But I would like this initial transition to be transparent to the end user, and gradually have them consume the wcf service over time.

Anyone tackle something like this before? If so, can you please point me in the right direction?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫思念不要吵 2024-10-13 20:31:42

我能够解决这个问题。我发现两个数据合约之间存在差异。数据合同中的属性之一存在大小写差异。纠正此问题解决了问题。我通过获取旧服务和新服务生成的服务引用的副本来解决这个问题。我并排比较了两个参考文献并注意到大小写差异。

约翰 - 感谢您上面的建议。

I was able to resolve this issue. I found there was a difference between the two data contracts. One of the properties in the data contract had a case difference. Corrected this resolved the issue. I figured this out by getting a copy of the generated service reference for the old service and the new service. I compared the two references side by side and noticed the case difference.

John - thanks for your suggestions above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文