Bug 7106 - WCF JSON service does not match uri correctly
Summary: WCF JSON service does not match uri correctly
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: 2012-09-12 13:52 UTC by Dylan Borg
Modified: 2012-10-25 02:58 UTC (History)
2 users (show)

See Also:
Tags: wcf json ajax webhttpbinding webhttp
Is this bug a regression?: ---
Last known good build:


Attachments

Description Dylan Borg 2012-09-12 13:52:07 UTC
When I try to call the service through an HTTP POST from a jQuery AJAX call the service fails and returns a html page with:

Application Exception
System.InvalidOperationException
HttpListenerContext does not match any of the registered channels

Description: HTTP 500.Error processing request.

Details: Non-web exception. Exception origin (name of application or object): System.ServiceModel.
Exception stack trace:
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__Iterator6.MoveNext () [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0
Version Information: 2.11.3 (tarball Fri Aug 24 15:12:38 UTC 2012); ASP.NET Version: 4.0.30319.17020

I have specified that the request and response should both be JSON in the service contract and configured a webHttpBinding endpoint in the configuration file.

The uri template was set to "/getcar?id={id}" and the js for the request was:
$(
	function() {
		$.ajax({
		  type: "POST",
  			contentType: "application/json; charset=utf-8",
  			url: "service1/getcar?id=1",
			data: JSON.stringify({}),
  			dataType: "json"
		});
	}
);

When I go to the url for the service it gives me the impression that it is working by showinng the following message:
To create client proxy source, run:

svcutil http://localhost/testsvc/service1.svc?wsdl

The wsdl xml file is made as well  if I go to the indicated url.
Comment 1 Dylan Borg 2012-09-13 06:08:08 UTC
I tried a service method that is parameterless but it still returns the same error.

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