WCF 3.5 Service and multiple http bindings

Posted by mortenvpdk on Stack Overflow See other posts from Stack Overflow or by mortenvpdk
Published on 2010-04-15T04:43:04Z Indexed on 2010/06/13 13:32 UTC
Read the original article Hit count: 443

Filed under:
|
|

Hi

I can't get my WCF service to work with more than one http binding.

In IIS 7 I have to bindings http:/service and http:/service.test both at port 80

In my web.config I have added the baseAddressPrefixFilters but I can't add more than one

<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://service"/>
<add prefix="http://service.test"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>

This gives almost the same error "This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. " as if no filers were specified at all (This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. Parameter name: item)

If I add only one filter then the service works but only responds on the added filter address.

I've also tried with specifing multiple endpoints like (and only one filter):

<endpoint address="http://service.test" binding="basicHttpBinding" bindingConfiguration="" contract="IService" />
<endpoint address="http://service" binding="basicHttpBinding" bindingConfiguration="" contract="IService" />

Then still only the address also specified in the filter works and the other returns this error: Server Error in Application "ISPSERVICE" HTTP Error 400.0 - Bad Request

Regards Morten

© Stack Overflow or respective owner

Related posts about wcf

Related posts about wcfservice