After creating a WCF Web Service for IIS and sucessfully testing it in my ASP.NET development server, when I deploy the service to another machine's IIS it always fire the following exception on consumption:
Test method PoolingServiceTest.ProgramTest.MainTaskTest threw exception: System.ServiceModel.CommunicationObjectFaultedException: O objeto de comunicação, System.ServiceModel.Channels.ServiceChannel, não pode ser usado para comunicação porque está no estado Com Falha..
In English: The object cannot be used for communication because it is With Fault (faulted)
Stack trace
System.ServiceModel.Channels.CommunicationObject.Close(TimeSpan timeout) System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) System.ServiceModel.ICommunicationObject.Close(TimeSpan timeout) Close() System.IDisposable.Dispose()
What can I do to avoid this?
With a try catch block surrounding the client code I got a different exception:
[System.ServiceModel.Security.SecurityNegotiationException] {"O chamador não foi autenticado pelo serviço."} System.ServiceModel.Security.SecurityNegotiationException
In English: The caller wasn't authenticated by the service