Hi, I am getting the following error on my client app
There was an error reading from the pipe: De pipe is beëindigd. (109,0x6d).
when using a specific implementation of my OperationContract. The following is a sample cut down to the point. My DataContracts as like this:
[DataContract]
public class Person
{
[DataMember]
public string FirstName { get; set; }
[DataMember]
public string LastName { get; set; }
}
[DataContract]
public class Employee : Person
{
[DataMember]
public string Function { get; set; }
}
And my ServiceContract looks like this:
[ServiceContract] public interface IAuthentication {
[OperationContract]
[WebGet]
Person GetDeveloper();
[OperationContract]
[WebGet]
Person GetArchitect();
}
I implement this service like the following class:
public class Authentication : IAuthentication
{
public Person GetDeveloper()
{
Person architect = new Person()
{
FirstName = "Asghar",
LastName = "Panahy"
};
return architect;
}
public Person GetArchitect()
{
Employee architect = new Employee()
{
FirstName = "Asghar",
LastName = "Panahy",
Function = "Architect"
};
return architect;
}
}
Note: Both methods return the same type, only one instanciates a Person and returns it while the second method instanciates an Employee which is a Person too.
When I call it from the client I do not get any error on the server but on the client side:
Console.WriteLine(" Connecting to Authenticate service... ");
NetNamedPipeBinding myBinding = new NetNamedPipeBinding("Authentication.Endpoint"); ;
EndpointAddress myEndpoint = new EndpointAddress("net.pipe://localhost/authentication"); ;
var myChannelFactory = new ChannelFactory<IAuthentication>(myBinding, myEndpoint);
IAuthentication proxy = myChannelFactory.CreateChannel();
Person person = proxy.GetDeveloper();
Console.WriteLine(String.Format("GetDeveloper OK : {0} {1} ", person.FirstName, person.LastName));
person = proxy.GetArchitect();
Console.WriteLine(String.Format("GetArchitect OK : {0} {1} ", person.FirstName, person.LastName));
and the output is:
Connecting to Authenticate service... GetDeveloper OK : Asghar Panahy There was an error reading from the pipe: De pipe is beëindigd. (109, 0x6d).
Could anyone please help me on this? Asghar