Я не знаю, почему я получаю исключение TimeOutException в моем коде:
Dim Uri2 As New Uri("http://localhost:8733/Design_Time_Addresses/ssWcfService/Service1/")
Dim binding2 As New WSDualHttpBinding()
Dim callback = New MyCallBackClient()
Dim Client = New MyContractClient(callback, binding2, New EndpointAddress(Uri2))
'Dim Proxy = Client.ChannelFactory.CreateChannel()
Dim ProxyNotFaulty = Client.ChannelFactory.CreateChannel()
Try
Dim dataList As New List(Of DataClass)
Dim datas As New DataClass
RichTextBox.Text = "Connecting to WCF Service..."
RichTextBox.Text += Environment.NewLine + "Please Wait..."
RichTextBox.Text += Environment.NewLine + "Please Wait..."
RichTextBox.Text += Environment.NewLine + "The Operation is now Invoking..."
ProxyNotFaulty.DoSomething()
For Each Clientdata As DataClass In dataList
RichTextBox.Text += "The CallBack Status" + Clientdata.callbackMessage
RichTextBox.Text += Environment.NewLine
RichTextBox.Text += "After CallBack Status" + Clientdata.OnCallBackMessage
Next Clientdata
Client.Close()
Catch ex As Exception
MessageBox.Show("An Exception Happened:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Client.Abort()
Finally
End Try
Sub DoSomething() Implements IService1.DoSomething
data.callbackMessage = "Call Back is Made SuccessFully From Client To Service"
data.OnCallBackMessage = "Null"
dataList.Add(data)
Dim callBack = OperationContext.Current.GetCallbackChannel(Of IIIService1)()
callBack.OnCallBack()
End Sub
Public Interface IService1
<OperationContract()>
Sub DoSomething()
<OperationContract()>
Sub DoSomethingTwo()
<OperationContract()>
Function GetStatus() As List(Of DataClass)
'<OperationContract()>
'Function GetData(ByVal value As Integer) As String
'<OperationContract()>
'Function GetDataUsingDataContract(ByVal composite As CompositeType) As CompositeType
' TODO: Add your service operations here
End Interface
Public Interface IIIService1
<OperationContract(IsOneWay:=True)>
Sub OnCallBack()
<OperationContract(IsOneWay:=True)>
Sub OnCallBackFromService()
End Interface