Local service (The server has rejected the client credentials.)
I have a simple setup, a WPF application running on the machine and a WCF service hosted within a Windows Service on the same machine (always on the same machine). When i debug on one computer i can easily access the local WCF Service. When i run it on another machine i get an error:
"The server has rejected the client credentials."
Some of my observations are, that at my local machine i have no domain/network. Its my home machine.开发者_高级运维 When at a customers site, it will not run, and gives the above error. Anyone got any ideas on why this is different on these computers?
/Brian
Edit:
Contract:
[ServiceContract(Namespace = "http://www.greenweb.dk/motiondetection")]
public interface IMotionDetection
{
[OperationContract]
bool GetMotionDetected();
}
App.Config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings />
<client />
<services>
<service name="GreenWebPlayerMotionDetectionService.MotionDetected" behaviorConfiguration="MotionDetectionBehavior">
<host>
<baseAddresses>
<add baseAddress="net.pipe://localhost/GreenWebMotionDetectionService/"/>
</baseAddresses>
</host>
<endpoint address="" contract="GreenWebPlayerMotionDetectionService.IMotionDetection" binding="netNamedPipeBinding"/>
<endpoint address="mex" contract="IMetadataExchange" binding="mexNamedPipeBinding"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MotionDetectionBehavior">
<serviceMetadata httpGetEnabled="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Edit 2 Security will not be a problem, no security is neeed, the computer on which it runs is already isolated from everything else.
EDIt 3
Have set <security mode="None"></security>
on both the client and the server, now im getting this error: "There was an error reading from the pipe: Unrecognized error 109 (0x6)"
I can't figure out whether this is a step in the right direction
The problem seems to be the security. Instead of None i set the client and server to be "EncryptAndSign". This however wasnt enough when the host was a windows service. I abandoned the windows service approach and hosted it in a windows application instead - then it worked immediately...go figure!
The issue is with the
netNamedPipeBinding
.This binding is used to communicate inside a machine. Please check the link.Its for on-machine .
If you want to communicate between 2 machine which uses .net select net.tcp .If you want to communicate between .Net and Java apps use basicHttpBinding.
http://msdn.microsoft.com/en-us/library/system.servicemodel.netnamedpipebinding.aspx
精彩评论