Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had created wcf service named as "WcfSample1"(which is hosted in server's iis) and created win App Named as "WinSamp"(Which is in one of my local system).
In WinSamp app added servicereference for "WcfSample1"


I try the below two methods.

C#
private void button1_Click(object sender, EventArgs e)
        {
            //manual wcf service link for this Application
            WSHttpBinding binding = new WSHttpBinding();
            EndpointAddress endpoint = new EndpointAddress(new Uri("http://197.168.0.11//WcfSample1/Service1.svc"));
            Service1Client Client1 = new Service1Client(binding,endpoint);
            MessageBox.Show(Client1.GetData(Convert.ToInt16(textBox1.Text)));
        }


XML
<pre lang="c#">
private void button1_Click(object sender, EventArgs e)
        {
            Service1Client Client1 = new Service1Client();
            MessageBox.Show(Client1.GetData(Convert.ToInt16(textBox1.Text)));
        }
</pre>



but it shows the error, The error image is in below link

Click to view Error Image

But it is working in my serverPC...

Thanks in advance...!
Posted

1 solution

Its evident from the error that the issue with the authentication when call from two different environment.

Try this options. Might be it give you some clue.

how-do-i-pass-credentials-in-an-iis-hosted-wcf-service[^]
not-passing-credentials-to-wcf-service-resulting-in-a-401[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900