Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.
Posted
Comments
ChintanShukla 30-Sep-14 4:54am    
Can you provide some code if possible?
Kats2512 30-Sep-14 5:05am    
for example:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ServiceModel;

namespace HelloWorldService
{
[ServiceContract]
public interface IHelloWorldService
{
[OperationContract]
public string GetMessage(string name)
{
return "Hello world from " + name + "!";
}
}
}



this will always get fired twice for some reason.
ashok rathod 30-Sep-14 5:09am    
I think there is no issue with your WCF Service Call ? its totally calling related issue. Please check that you are not calling same method twice. As WCF has no mechnism to call function more than once
Kornfeld Eliyahu Peter 30-Sep-14 6:25am    
Try to debug it!
Set breakpoints on all the possible client calls then run your application and see what happening!
ZurdoDev 30-Sep-14 9:03am    
You'll have to debug it. We can't see it so there is no way for us to know why or who is calling it twice.

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900