我可以在 .NET 4 应用程序中使用 WSE3 来与旧的 Web 服务进行通信吗?

发布于 2024-10-18 22:18:02 字数 819 浏览 1 评论 0原文

我有一个 .NET 3.5 库程序集,它使用 WSE 3.0 与外部 Web 服务进行通信。我们正在将系统升级到 .NET 4,但外部 Web 服务将保持不变。 (编辑:不确定它是否相关,但外部网络服务是用 Java 实现的)

为了使迁移过程尽可能快,除非绝对必要,否则我不想更改我们的系统代码。当我将系统更新到 .NET 4 后,WSE3 库是否仍然可以工作?

我看到几个问题表明我们不应该再使用 WSE 来构建 Web 服务(请参阅下面的参考资料)。然而,我纯粹将它用作客户端,与外部网络服务进行通信,所以我对它是否有效感到困惑。

参考文献:

I have a .NET 3.5 library assembly which uses WSE 3.0 to communicate with an outside webservice. We're upgrading our system to .NET 4, but the outside webservice will remain unchanged. (Edit: not sure if it's relevant, but the outside webservice is implemented in Java)

To make the migration process as fast as possible, I don't want to change our system code except where absolutely necessary. Will the WSE3 library still work, once I update the system to .NET 4?

I've seen a couple questions indicating that we should no longer be using WSE to build webservices (see references below). However, I'm using it purely as a client, to communicate with an outside webservice, so I'm confused as to whether or not it will work.

References:

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

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

发布评论

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

评论(2

面犯桃花 2024-10-25 22:18:02

我上周遇到了同样的情况,答案是否定的(或者至少不容易,并且在谷歌搜索 6 个小时后根本找不到答案。)部分问题是没有从 Visual Studio 启用 WSE 的选项在 VS 2010(或 VS 2008,就此而言)中。

然而,好的一面是,使用 VS2010 中的“添加服务引用”工具可以很容易地指向 Web 服务,并添加服务引用(新样式)而不是“Web 引用”。在我绞尽脑汁试图弄清楚如何通过 Web 服务参考获得对 WSE 的支持之后,我只是尝试了新方法,而 Visual Studio 足够聪明,可以正确处理它。它能够创建一个无需额外配置即可与服务器通信的客户端。

主要区别在于,新工具不是为服务生成允许您调用代理类上的函数的代理类,而是为服务创建一个客户端类,允许您使用客户端执行方法。当你习惯了之后,这实际上是一个很小的改变。一旦我弄清楚了差异,一些全局查找和替换操作就会处理更新必要的代码。

编辑

去算一下。这次我在谷歌搜索的第一分钟就找到了答案。

您可以启用第一段中提到的选项,我敢打赌它会起作用。

但是,我将保留其余答案,因为现在切换到新方式可能仍然更好。

http://www.junasoftware.com/blog/如何使用-wse-3-in-visual-studio-2010.aspx

I had the same situation last week, and the answer is no (or at least not easily, and in no way that can be found after 6 hours of googling.) Part of the problem is that there's no option to enable WSE from Visual Studio in VS 2010 (or VS 2008, for that matter).

However, on the bright side, it was very easy to point to the web services using the "Add Service Reference" tool in VS2010, and adding a Service Reference (new style) as opposed to a "Web Reference". After banging my head against the wall trying to figure out how to get support for WSE with a Web Service reference, I just gave the new way a shot, and Visual Studio was smart enough to handle it properly. It was able to create a client that could communicate with the server with no additional configuration.

The main difference is that instead of generating a proxy class for the service that allows you to call functions on the proxy class, the new tool creates a Client class for the service, that allows you to use the client to execute methods. It's actually a very small change when you get used to it. Once I figured out the differences, a few global find and replace operations handled updating the necessary code.

Edit

Go figure. This time around I found an answer in the first minute of googling.

You can enable that option mentioned in the first paragraph, and I bet it will work.

However, I'm leaving the rest of my answer as it's still probably better to switch to the new way now.

http://www.junasoftware.com/blog/how-to-use-wse-3-in-visual-studio-2010.aspx

鹿港小镇 2024-10-25 22:18:02

它应该可以正常工作,请参阅以下参考文献:

http://msdn.microsoft.com/ en-us/library/aa717042.aspx

http://devlicio.us/blogs/ziemowit_skowronski/archive/2007/07/18/interoperability-

Between-wcf-and- wse-3-0.aspx 建议升级是因为更好的性能和更多的功能。

正如 John Saunders 所说,基于 WSE 已经过时,并且非常接近不受支持

It should work fine, see these references:

http://msdn.microsoft.com/en-us/library/aa717042.aspx

http://devlicio.us/blogs/ziemowit_skowronski/archive/2007/07/18/interoperability-between-wcf-and-wse-3-0.aspx

The advice to upgrade is due to better performance and more functionality.

Also as John Saunders says based on WSE being obsolete, and being very close to unsupported

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