Hi
I Did Some Modification in App.config File Of SampleClient Application.
Those Changes are:
<client>
<!--<endpoint address="http://localhost:8080/SampleService" binding="basicHttpBinding" contract="SampleServiceLiberary.IAnswer"></endpoint>-->
<endpoint address="http://localhost:8080/SampleService" binding="basicHttpBinding" bindingConfiguration="DefaultBinding_IAnswer"
contract="IAnswer" name="DefaultBinding_IAnswer_IAnswer" />
</client>
Just i Copied and Pasted address Property from App.config File Of Sample Host Application.
<endpoint address="http://localhost:8080/SampleService" binding="basicHttpBinding" contract="SampleServiceLiberary.IAnswer"></endpoint>
What i Come to know is: The End Points in Sample Host Application, should be same in SampleClient Application.
First we have to run Sample Host Application, then we can see this message in Command Prompt:
Sample Host of Sample Service is Running...
Again we have to Click Enter then we will see this Message: The Sample Service is Ready Now...
So Now Our Host is Ready, then i ran SampleClient Application.
Here also I done some Changes those are:
In SampleClient Application , In Program.cs file:
After string question = Console.ReadLine();
I added these Lines:
string hostName = System.Net.Dns.GetHostName();
int port = 8080;
Uri serviceUri = new Uri(string.Format("http://{0}:{1}", hostName, port.ToString()));
EndpointAddress endpoint = new EndpointAddress(serviceUri);
Then i Run the this SampleClient Application.
I got the Response.
Hi Guys i'm also new to WCF...
Just i Followed the Author Steps and i created the Service.
If any thing i went wrong Excuse me frinds!!!!
Regards
Nagesh
Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator