Silverlight 4.0问题-同步调用asmx web服务

发布于 2024-09-05 15:52:49 字数 333 浏览 2 评论 0原文

我有 Silverlight 问题。

我必须处理相当大的遗留应用程序,其中暴露了一些Web服务(常规asmx,而不是wcf)。我需要做的是构建使用这些 Web 服务的 Silverlight 应用程序。由于业务逻辑,我需要从 Silverlight 应用程序同步调用相同的 Web 方法。我能够构建 Web 服务消费,但只能异步进行,因为这将是默认的 Silverlight 行为。

Silverlight中有没有办法使异步调用同步?我看了这里并用谷歌搜索,但只找到了 wcf 示例。如果有人能给我一个常规 asmx Web 服务的代码示例,我将不胜感激。我使用Silverlight 4.0。

谢谢!

I have Silverlight problem.

I have to deal with fairly large legacy application that has some web services exposed (regular asmx, not wcf). What I need to do is to build Silverlight app that consumes those web services. Due to business logic I need to have the same web method to be called from Silverlight app synchronously. I was able to build web services consumption but only asynchronously because that would be default Silverlight behavior.

Is there a way to make asynchronous calls synchronous in Silverlight? I looked here and googled around but came across only wcf examples. I would appreciate if somebody would get me a code example for regular asmx web service. I use Silverlight 4.0.

Thanks!

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

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

发布评论

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

评论(2

屌丝范 2024-09-12 15:52:49

Silverlight 不支持同步调用。甚至 TCP/IP 堆栈也是异步的。

在某些情况下,您需要将“WebServiceCall-A”的结果发送到“WebServiceCall-B”,您将必须编写代码将它们链接在一起。例如,webservice-call-a ->回调-a->处理数据->网络服务-b ->回调-b ->处理数据-> ETC。

Silverlight does not support sync calls. Even the TCP/IP stack is async.

In some cases where you need the results of "WebServiceCall-A" to send to "WebServiceCall-B", you will have to write code to chain those together. For example, webservice-call-a -> callback-a -> process data -> webservice-b -> callback-b -> process data -> etc.

苏别ゝ 2024-09-12 15:52:49

仅供参考:
我今天找到了 Daniel Vaughan 的文章。这是链接:

http://www.codeproject.com/KB/silverlight/SynchronousSilverlight。 aspx

它解释了如何使用 Silverlight 进行同步 Web 服务调用。

Just FYI:
I have found the article by Daniel Vaughan today. Here is the link:

http://www.codeproject.com/KB/silverlight/SynchronousSilverlight.aspx

It explains how you can actually do Synchronous Web Service Calls with Silverlight.

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