|
-
Jun 22nd, 2009, 01:22 PM
#1
[RESOLVED] WCF: Problems creating duplex contract
I'm trying to create a duplex contract in my WCF service, which from what I gather requires that you do the following:
Define an interface in your service, e.g IMyClientCallBack
Tell your main service to use that interface as its call back contract
implement the interface in your client
So I have the following on the server side:
vb.net Code:
''' <summary>
''' Main service
''' </summary>
<ServiceContract(CallbackContract:=GetType(IProtoChatCallBack), SessionMode:=SessionMode.Required)> _
Public Interface IProtoChatService
<OperationContract()> _
Function GetServerInfo() As ServerInfoDescription
<OperationContract()> _
Function GetUserList() As List(Of UserObject)
<OperationContract()> _
Function SignUserIn(ByVal iUName As String, ByVal iPassword As String) As SignInResult
<OperationContract()> _
Sub SignUserOut(ByVal iUName As String)
End Interface
''' <summary>
''' Call back contract that will be implemented on client side
''' </summary>
<ServiceContract()> _
Public Interface IProtoChatCallBack
<OperationContract(IsOneWay:=True)> _
Sub MessageReceived(ByVal SenderDisplayName As String, ByVal Message As String, ByVal TimeSent As DateTime)
<OperationContract(IsOneWay:=True)> _
Sub SignUserOut(ByVal Reason As String)
End Interface
However, now when I go to update the service reference on the client (so that I can define an implementation of the call back interface) I just get an error saying "Metadata contains a reference that could not be resolved".
If I take those 2 methods (MessageReceived and ForceUserSignOut) out of the interface then I can update the service reference on the client fine... but obviously there's not much use having a callback contract that doesnt do anything!
Anyone see where im going wrong?
Thanks
Chris
Last edited by chris128; Jun 23rd, 2009 at 01:21 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|