Bug 25444 - WCF method with UriTemplate annotation fails with InvalidOperationException
Summary: WCF method with UriTemplate annotation fails with InvalidOperationException
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: WCF assemblies (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-12-17 00:01 UTC by bonhagjeffrey
Modified: 2017-03-17 21:15 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Example WCF method (344 bytes, application/octet-stream)
2014-12-17 00:01 UTC, bonhagjeffrey
Details
Web.config (1.29 KB, application/octet-stream)
2014-12-17 00:02 UTC, bonhagjeffrey
Details

Description bonhagjeffrey 2014-12-17 00:01:30 UTC
Created attachment 9095 [details]
Example WCF method

Hi,
This is on Mono 3.10 on Fedora installed from the official Xamarin repositories,
but also can be reproduced on a Mac with the latest version of Xamarin Studio.

I can't seem to get the UriTemplate annotation to work on my WCF methods.  For the attached example,
I should be able to perform a GET request against /MyService.svc/Books/2,
but that request fails with a 500 error:

<!--
[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 <filename unknown>:0 
  at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0 
-->

The same method works on Windows/.NET, and I don't seem to have any trouble with any other WCF methods --
just those using the UriTemplate annotation.

Testing was done using xsp4, version 0.4.0.0 and curl.

My Web.config:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="UriTemplateTester.MyService">
        <endpoint address="" behaviorConfiguration="UriTemplateTester.MyServiceAspNetHttpBehavior"
          binding="webHttpBinding" contract="UriTemplateTester.MyService" />
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="UriTemplateTester.MyServiceAspNetHttpBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>

</configuration>

Thank you for your consideration.
Comment 1 bonhagjeffrey 2014-12-17 00:02:15 UTC
Created attachment 9096 [details]
Web.config
Comment 2 Roman 2017-03-17 21:15:08 UTC
Hm, It's shown that nobody take problem for resolving! It's very bad!

Note You need to log in before you can comment on or make changes to this bug.