none
WCF hosted in windows service. Error: The pipe has been ended. (109, 0x6d). RRS feed

  • Question

  • Hi,

    I'm developing WCF service that's hosted in windows service. Configuring and running the service goes well. but trying to add the  service to client as service reference results in an exception

    [ServiceContract]
        interface IWCFServiceSoap
        {
            [OperationContract]
            string GreetUser(string userName);
        }


    public class WCFServiceSoap: IWCFServiceSoap { public string GreetUser(string userName) { return string.Format("Hi {0}, the time is: ", userName, DateTime.Now.ToString()); } }

    my app.config is:

    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
      </startup>
      <system.serviceModel>
        <services>
          <service behaviorConfiguration="WCFServiceHostNetPipeBehaviour"
            name="WCFServiceSoap.WCFServiceSoap">
            <endpoint address="" binding="netNamedPipeBinding" bindingConfiguration=""
              name="WCFServiceHostNetPipeEndPoint" contract="WCFServiceSoap.IWCFServiceSoap" />
            <endpoint address="mex" binding="mexNamedPipeBinding" bindingConfiguration=""
              name="WCFServiceHostMexPipeEndPoint" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="net.pipe://localhost/WCFServiceSoap" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="basicHttpBindingClient" transferMode="Streamed" messageEncoding="Mtom" maxReceivedMessageSize="10067108864" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" closeTimeout="01:00:00" openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <binding name="myWebBinding"  maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Streamed" />
          </webHttpBinding>
        </bindings>
        <extensions>
          <behaviorExtensions>
            <add name="crossOriginResourceSharingBehavior" type="WCFAPI.EnableCrossOriginResourceSharingBehavior, TransferWorker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          </behaviorExtensions>
        </extensions>
        <behaviors>
          <endpointBehaviors>
            <behavior name="jsonBehavior">
              <webHttp />
              <crossOriginResourceSharingBehavior />
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="SimpleService">
              <serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="WCFServiceHostNetPipeBehaviour">
              <serviceDebug includeExceptionDetailInFaults="true" />
              <serviceMetadata />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    </configuration>

    when trying to add it to client as service reference i encounter an error: 

    The URI prefix is not recognized.
    Metadata contains a reference that cannot be resolved: 'net.pipe://localhost/WCFServiceSoap'.
    There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
    There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
    If the service is defined in the current solution, try building the solution and adding the service reference again.

    trace log: 

    The message with Action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

    stack trace:

    System.ServiceModel.Dispatcher.ErrorBehavior.ThrowAndCatch(Exception e, Message message)
    System.ServiceModel.Dispatcher.ChannelHandler.ReplyFailure(RequestContext request, Message fault, String action, String reason, FaultCode code)
    System.ServiceModel.Dispatcher.ChannelHandler.ReplyContractFilterDidNotMatch(RequestContext request)
    System.ServiceModel.Dispatcher.ChannelHandler.EnsureChannelAndEndpoint(RequestContext request)
    System.ServiceModel.Dispatcher.ChannelHandler.TryRetrievingInstanceContextCore(RequestContext request)
    System.ServiceModel.Dispatcher.ChannelHandler.TryRetrievingInstanceContext(RequestContext request)
    System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
    System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)
    System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)
    System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
    System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.OnReceive(IAsyncResult result)
    System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
    System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)
    System.ServiceModel.Channels.SynchronizedMessageSource.ReceiveAsyncResult.OnReceiveComplete(Object state)
    System.ServiceModel.Channels.SessionConnectionReader.OnAsyncReadComplete(Object state)
    System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback()
    System.ServiceModel.Channels.TracingConnection.WaitCallback(Object state)
    System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
    System.ServiceModel.Channels.OverlappedContext.CompleteCallback(UInt32 error, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
    System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
    System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    what does the error mean?


    • Edited by MeTehila Thursday, June 7, 2018 8:38 AM added service trace log
    Tuesday, June 5, 2018 7:08 AM

All replies

  • Found the answer. apparently soap doesn't load after reflection. so i changed the order, loaded soap and  then the reflection
    Monday, July 2, 2018 8:04 AM