Silverlight-WCF重复通话 [英] Silverlight-WCF repeated calls

查看:71
本文介绍了Silverlight-WCF重复通话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个Silverlight应用程序,该应用程序与WCF层进行通信以进行数据检索,最近我观察到,即使Silverlight调用了一次,在WCF服务中仍对一个方法进行了多次调用.

例如,在Silverlight页面中,有一个创建票证请求的按钮,如果单击该按钮,它将在服务上调用"CreateTicket"方法,并禁用该按钮直到处理该按钮,当我尝试调试时,我看到有多个调用服务器在"CreateTicket"上,因此一键创建不必要的多个票证.

这很奇怪,无法解决问题,请您帮忙查找问题.


问候,
Kthatik

Hi,

I have a Silverlight application, which communicates with WCF layer for data retrieval, recently I observed that there are multiple calls being made to a method in WCF service even though Silverlight calls one time.

for example, In Silverlight page, there is a button to creat ticket request, if you click on that button, it calls "CreateTicket" method on service and disable the button until it is processed, when I tried to debug I see multiple calls on server on "CreateTicket", so unnecessarily multiple tickets are created for one click.

This is strange and not able to resolve the issue, can you please help in locating the issue.


regards,
Kthatik

推荐答案

在您的CreateTicket方法的第一条语句处放置一个断点,并查看其被击中了多少次.停止时,检查调用堆栈窗口,并查看从何处调用它.

Put a breakpoint at the first statement in your CreateTicket method, and see how many times it''s hit. When it stops, check the call stack window and see where it''s being called from.


这篇关于Silverlight-WCF重复通话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆