Hej,
I feel like a complete idiot but I don't seem to find an answer.
I'm selfhosting a WCF service in a console application. This is working like a charm, I've done it a million times :)
Consuming this service from another console application or by using wcftestclient is no problem at all.
But when trying to browse to the service I get "strange" behavior.
The service is hosted at http://localhost:50666/MyService.Foo/BarServiceHttp
(with base-address http://localhost:50666/MyService.Foo
).
So when browsing to http://localhost:50666/MyService.Foo/BarServiceHttp
does return a HTTP 400 error in the browser.
Browsing to the base-address gives the output that I expected at the full address.
What's going on? (The space after the http was inserted to bypass the warning concerning localhost...)
Here is the server config:
<service name="FooService" behaviorConfiguration="FooBarServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:50666/MyService.Foo" />
</baseAddresses>
</host>
<endpoint address="BarServiceHttp"
binding="basicHttpBinding"
bindingConfiguration="basicHttpBindingConfiguration"
contract="IBarService" />
<endpoint address="BarServiceHttp/mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
<behavior name="FooBarServiceBehavior">
<!-- Enable MEX http get for this service. -->
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>