Unexpected values in the IncomingRequest.UriTemplateMatch.BaseUri
I am making web service and wanted to create an output document that used a
portion of the request URI in the output of the content. Anyway, I did find
the BaseUri class within the the IncomingRequest.UriTemplateMatch, however,
what was in there was not what I expected.
For example, if my service request was:
http://localhost/services/test.svc
I would have expected that the BaseUri would have been
http://localhost/services/test.svc, however, the BaseURI was changed to
http://[machinename].[host].[domain]/services/test.svc .
Strictly speaking, I do not think is wrong, but I do not think that is
should have been changed either. As my use for this was to determine how the
client resolved this address, and it was resolved by âlocalhostâ not
â[machinename].[host].[domain]â (Yes, I know that local host is kinda
special..) So I tested this from an external machine and had it point back to
my dev box via IP, so the address was
http://[xxx].[xxx].[xxx].[xxx]/services. Again, I was surprised, as the value
in the BaseUri was again
http://[machinename].[host].[domain]/services/test.svc. Even the
OrginalString property of the Uri was
âhttp://[machinename].[host].[domain]/services/test.svcâ, which is clearly
wrong.
Anyway, I am very curious as to why this is done. I have taken to using a
configuration property as I am distrustful of what I am getting back in the
IncomingRequest object.
Is there another Uri property in the WCF context that has an unaltered
version of the orginal request?
Thanks for any helpâ¦
date: Wed, 16 Jul 2008 13:56:00 -0700
author: Kurt