WCF方法被称为两次 [英] WCF Method Being Called Twice

查看:80
本文介绍了WCF方法被称为两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个WCF服务类,由于某种原因,这个类中的一个方法被调用了两次。



我有一个标签页,每个标签都有自己的WCF服务类,但是这些标签中只有一个提出了一个问题,当它被选中时,它会调用两次WCF服务。



我已经阅读了很多关于服务行为和终点行为的网站和博客,但这并没有帮助解决我遇到的问题。



我尝试过:< datacontractserializer maxitemsinobjectgraph =2147483646>但是这也没有帮助。



如果有人知道怎么解决这个问题我会很感激。



谢谢。

Hi,

I have a WCF Service class and for some reason 1 of the methods within this class is being called twice.

I have a tabbed page, each tab has its own WCF Service class however only 1 of these tabs are giving an issue that when it gets selected it called its WCF Service twice.

I have read through many websites and blogs regarding Service Behavior and End Point Behavior but that has not helped remedy my issue that I am experiencing.

I did try: <datacontractserializer maxitemsinobjectgraph="2147483646"> but this had not helped either.

If anyone knows how to get around this I will appreciate it.

thanks.

推荐答案

1.您的问题与WCF服务调用无关,并且是由您调用WCF服务的用户界面中的代码生成的;所以应该有一些UI事件产生问题。



2.解决方案是在你的UI代码中设置一个断点,在那里调用WCF并且在Debug中分析生成此方法调用的位置,然后在这种情况下优化调用仅为一次。
1.You problem is not related with WCF service call and is generated by the code from your user interface that is calling the WCF service; so there should be some UI events that generate the problem.

2.The solution is to setup a breakpoint in your UI code where the call to the WCF is made and to analyze in Debug from where this method call is generated, then to optimize the call to be only once also in this case.


这篇关于WCF方法被称为两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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