Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WCF Server service CLI
Hi, I got a WCF service working with callbacks. Everything works fine when I pass an integer to wcf service, and then the service call back to client another integer.
 
But when I try to pass a complex type, like List<string> to WCF service, the service cannot call back the CLient.
 
Anyone has experienced this ??
Need help.
Thanks!
Posted 25-Oct-11 5:56am
Comments
Mark Salsbery at 25-Oct-11 11:12am
   
What do you mean "the service cannot call back the CLient"?
L_Coelho at 25-Oct-11 12:03pm
   
I mean the Server side cannot send result to client side...
 
SERVER:
public void GetData(ObservableCollection<People> listValues)
{
Callback.ResultData(listValues);
}
 
IDuplexCallback Callback
{
get
{
return OperationContext.Current.GetCallbackChannel();
}
}
 

CLIENT:
 
// Construct InstanceContext to handle messages on callback interface.
InstanceContext instanceContext = new InstanceContext(new CallbackHandler());
 
// Create a client.
DuplexServiceReference.DuplexClient client = new DuplexServiceReference.DuplexClient(instanceContext);
 
client.GetData(observableCollectionPeople);
 

public class CallbackHandler : IDuplexCallback
{
public void ResultData(ObservableCollection<People> listInt)
{
System.Windows.MessageBox.Show(listInt.Count().ToString());
}
}
 

When debugging, I enter in the server code. When the server (service) code try to call back the client (Callback.ResultData) it fails with timeout exception.
 
But if i instead of ObservableCollection I use an integer, it works.
Mark Salsbery at 25-Oct-11 19:28pm
   
You stated "like List<string>", not ObservableCollection<People>. Is your People class WCF-serializable? Does it work if you use List<People>?

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

  Print Answers RSS
0 OriginalGriff 315
1 Jochen Arndt 190
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 25 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100