tags:

views:

458

answers:

1

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

A: 

Can you please translate "De pipe is beëindigd" into English?

Also, should you be using WebGet with NetNamedPipeBinding?

John Saunders
'De pipe is beëindigd' is dutch for saying ' The pipe is closed'I already use WebGet with NetNamedPipeBinding! Do I miss something?
Asghar Panahy
I don't know, but since WebGet is for HTTP, try to remove it and let's see what happens.
John Saunders
OK. I now understand your point.I tried it removing the WebGet attribute and did not go well. So I tried again as follows :[OperationContract] [WebInvoke(Method = "GET", UriTemplate = "developer")] Person GetDeveloper(); [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "architect")] Person GetArchitect(); and still got the same error
Asghar Panahy