Correct me If I am doing wrong,
I have just started to check WCF services so have created a sample WCF service application with two methods IService
[ServiceContract]
public interface IService1
{
[OperationContract]
string GetData(int value);
[OperationContract]
CompositeType GetDataUsingDataContract(CompositeType composite);
// TODO: Add your service operations here
}
And wanted to consume this service in VB application so added my service using
Servicereference>>Advanced>>AddWebreference
after that trying to call the method in the service on a simple button click in VB form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim client As New localhost.Service1
client.GetData(10, True)
End Sub
But when am trying to execute the button click am getting the TimeOut Exception..
Can some one assist me on what am I doing wrong.
Thanks
You need just the Service Reference to the WCF service, Web Reference is for ASMX.
Also, if you have Visual Studio 2010, under Tools, you will see a built-in ‘WCF Test Client’ to verify your service.
Finally, using a Service Reference is convenient, but it generates a lot of unnecessary files (especially if you use source control), so suggest using a single file (.vb or .cs) in the form of a proxy class. This is auto-generated via svcutil.exe (see here for more details).