WCF: No service response from the server side
I just noticed the remote server accepts calls from any client but only responds to a few of them. I can telnet the same host & ip from any client.
I set a breakpoint at the server side but it never trapped if I connected from unlucky client.
Another clue; I could get response if I only used ip adress instead of hostname:
C:\NET>Hello.exe remoteserver 1333
No response
C:\NET>Hello.exe 192.168.35.211 1333
Response from service: Server v3.32
You might thing it's a binding related but here is another symptom:
Client A
C:\NET>Hello.exe 192开发者_Python百科.168.35.211 1333
Response from service: Server v3.32
Client B
C:\NET>Hello.exe 192.168.35.211 1333
No response
As you see it looks very weird and I'm totally lost.
This is the client project's Pastebin code: Hello.cs
And this is the server's related section: Server.cs
Why does the server "choose" the clients? What would be the reason?
UPDATE
OK, I trapped the error at client side, during a service call:
The server has rejected the client credentials.
And the solution:
NetTcpBinding tcpBind = new NetTcpBinding();
tcpBind.Security.Mode = SecurityMode.None;
精彩评论