Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
1- i will improve my question for u because i coudn't write comment the server has problem.....
i have WCF service in my desktop computer running windows xp and vista and i have the mobile applictaion project called "Client"... when i genrated the proxy i made this step in commond prompt during the service running :
NetCFSvcUtil http://localhost:8731/Design_Time_Addresses/Server/Service1

and this genrated 2 files Greeting_Service.cs and CFClientBase.cs
and i puted both in Client;

and this is my code in Client :

System.ServiceModel.Channels.Binding binding = GreetingServiceClient.CreateDefaultBinding();
           string address = GreetingServiceClient.EndpointAddress.Uri.ToString();
           GreetingServiceClient m_proxy = new GreetingServiceClient(binding, new EndpointAddress(address));
           string result = m_proxy.Greet(textBox1.Text).ToString();
           textBox2.Text = result;


when i try to run the service and the client the error above is appear in CFClientBase.cs at this part
return requestChannel.Request(msg);

and i tried to run the "Client" from this Client\Client\bin\Debug\Client.exe and it run fine

..............
when i try ur solution and change my command for genrate proxy to ...
NetCFSvcUtil http://192.168.1.76:8731/Design_Time_Addresses/Server/Service1

it is the same error.

and thx for ur replay mr fredik.
Posted
Updated 7-Jun-10 15:25pm
v4

1 solution

I'm not sure I understand your scenario completely, but to me it sounds like you're having a service running on your desktop computer that you're trying to access using a client running on a mobile device (or emulator).

If this is the case then you cannot use localhost as the address because that would point to the mobile device rather than the desktop computer. You need to specify the address of the desktop using an "external" IP or host name.

It works when you're running the desktop client because that is running on the same box as the service so localhost is correct then.

Hope this helps,
Fredrik Bornander
 
Share this answer
 
Comments
Ashraf ELHakim 7-Jun-10 21:26pm    
thx for ur replay and yes u understand me right but i improve my question for u to give me any advice because if i undertsood ur solution right it is the same problem plz check the question again :)

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