[Mono-dev] Problem in SvcHttpHandler.cs ?

Thiago Padilha tpadilha84 at gmail.com
Tue Jun 29 08:46:51 EDT 2010


   Hi,

   I'm hosting a WCF service using asp.net/mono from trunk (r159644)
but encountered a problem when accessing the service from a virtual
machine :

"
  The argument HTTP context did not match any of the registered
listener manager (could be mismatch in URL, method etc.)
http://172.16.122.2:8080/Person.svc

Description: HTTP 500. Error processing request.

Stack Trace:

System.InvalidOperationException: The argument HTTP context did not
match any of the registered listener manager (could be mismatch in
URL, method etc.) http://172.16.122.2:8080/Person.svc
  at System.ServiceModel.Channels.SvcHttpHandler.FindBestMatchListener
(System.Web.HttpContext ctx) [0x00120] in
/home/thiago/monotrunk/mcs/class/System.ServiceModel/System.ServiceModel.Channels/SvcHttpHandler.cs:141
  at System.ServiceModel.Channels.SvcHttpHandler.ProcessRequest
(System.Web.HttpContext context) [0x0000d] in
/home/thiago/monotrunk/mcs/class/System.ServiceModel/System.ServiceModel.Channels/SvcHttpHandler.cs:156
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext ()
[0x00ce5] in /home/thiago/monotrunk/mcs/class/System.Web/System.Web/HttpApplication.cs:1344
  at System.Web.HttpApplication.Tick () [0x00000] in
/home/thiago/monotrunk/mcs/class/System.Web/System.Web/HttpApplication.cs:914
"

 I think this happened because I tried to access the service trough
the "172.16.122.0" network which is the virtual network for my VMs.
The service works well if I access it on the local machine using the
"http://127.0.0.1:8080/Person.svc" Url, but fails with the same error
if I use "http://localhost:8080/Person.svc". After looking into the
source code I think the problem may be on the following conditionals
(method 'FindBestMatchListener') :

"
if (l.Uri.Equals (ctx.Request.Url)) {
					best = l;
					break;
				}
//
if (!ctx.Request.Url.ToString ().StartsWith (l.Uri.ToString (),
StringComparison.Ordinal))
					continue;
"

Maybe it should check the Uris for all the network interfaces?(I have
no idea on how to do that).


More information about the Mono-devel-list mailing list