Creating WCF Services in Mono 2.8.2

I had mono-2.6.7 installed and the WCF service:

<system.serviceModel>
    <behaviors>
        <endpointBehaviors>
             <behavior name="RestB"><webHttp/></behavior>
        </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service name="Rest">
        <endpoint address="" behaviorConfiguration="RestB" binding="webHttpBinding" contract="Rest" />
      </service>
    </services>
</system.serviceModel>

It worked.

I wanted to use several endpoints, and I kept getting errors as soon as I specified the address, so I decided to try mono 2.8.2. After installing 2.8.2 (after adding the serviceBehavior mono complained about), I started getting:


"HttpListenerContext does not match any of the registered channels"
System.InvalidOperationException: HttpListenerContext does not match any of the registered channels
  at System.ServiceModel.Channels.Http.HttpListenerManager.ProcessNewContext (System.ServiceModel.Channels.Http.HttpContextInfo ctxi) [0x00000] in :0 
  at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in :0 
  at System.Web.HttpApplication+c__Iterator2.MoveNext () [0x00000] in :0 
  at System.Web.HttpApplication.Tick () [0x00000] in :0 

when trying to access URLs that worked in mono-2.6.7.

I tried using both mod-mono-server2 and mod-mono-server4.

I tried to find this problem but found nothing.

Can someone show me a working example of a WCF service in a mono-2.8.2 or mono-2.6.7 configuration with multiple endpoints?

UPDATE: after returning to mono-2.6.7, my Rest service, shown above, works again.

Thanks in advance guru

Thanks Tymek

+3
2

( 2.10) , UriTemplate/{var1}/{var2} 2.8 2.10.1. UriTemplate? X = {var1} & y = {var2}. , .

+1

Source: https://habr.com/ru/post/1792160/


All Articles