0

I have a contract for which i have an basicHttpBinding.

            <endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
            </endpoint>

I want to add another endpoint with wsHttpBinding, for the same binding. What are the steps I have to take? What would be the resulting address?

SaravananArumugam
  • 3,680
  • 6
  • 33
  • 45

2 Answers2

2

Just add another endpoint with a different address, it should look like this:

<endpoint address="http://localhost:49654/BookShopService.svc" binding="basicHttpBinding" contract="BookShop.IBookShopService">
</endpoint>
<endpoint address="http://localhost:49654/BookShopServiceWS" binding="wsHttpBinding" contract="BookShop.IBookShopService">
</endpoint>

There is a primer on MSDN.

Greg Sansom
  • 20,442
  • 6
  • 58
  • 76
1

If you are running in IIS, then you shouldn't supply a fully qualified address - the address will be determined by IIS and so supply one can cause deployment problems. So, using Greg Sansom's answer as a foundation, I'd suggest

<endpoint address="" 
    binding="basicHttpBinding" 
    contract="BookShop.IBookShopService" /> 
<endpoint address="ws" 
    binding="wsHttpBinding" 
    contract="BookShop.IBookShopService" />

where ws is a relative addresses to the service location.

e.g.

Kirk Broadhurst
  • 27,836
  • 16
  • 104
  • 169