Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - Two way function does not return data with custom data types

 
 
Old 06-23-2007   #1 (permalink)
Jason Rodman


 
 

Two way function does not return data with custom data types

I have been trying to get started with WCF and have hit a wall. I have a
self-hosted WCF service that uses dupex netTcpBinding to allow two-way data
flow. So far it works great with sending basic data types as a return value
when I call a method from a client, but when I return a custom class or
structure, its data members always come back as nothing. Any ideas? Here is a
sample of my implementation:

<ServiceContract(SessionMode:=SessionMode.Required,
CallbackContract:=GetType(IServerCallback))> _
Interface IServer

<OperationContract(IsOneWay:=False, IsInitiating:=True,
IsTerminating:=False)> _
Function Login() As LoginResult

End Interface

<DataContract()> _
Public Class LoginResult

<DataMember()> _
Public Value As String

End Class

<ServiceBehavior(ConfigurationName:="GameStreet.GSTalkServer", _
InstanceContextMode:=InstanceContextMode.PerSession, _
ConcurrencyMode:=ConcurrencyMode.Multiple)> _
Public Class MyService
Implements IServer

Public Function Login() As LoginResult Implements IServer.Login
Dim oRes As New LoginResult
oRes.Value = "Any value..."
Return oRes
End Function

End Class



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Problems with data types PowerShell
Registry and data types PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46