Multiple endpoints for a service hosted in IIS

Is it possible to have a service hosted in IIS to have multiple endpoints I suppose WCF services hosted on IIS only support HTTP. But, can I have a scenario whose config is shown below :

<system.serviceModel>

<services>

<service type="PaymentGatewayService.Payment">

<endpoint address="" binding="basicHttpBinding" contract="PaymentGatewayService.IPayment"/>

<endpoint address="wse" binding="wsHttpBinding" contract="PaymentGatewayService.PaymentWSE"/>

</service>

</services>

</system.serviceModel>

Basically, I would like to host a service is IIS which caters to WSE clients over wsHttpBinding and ASMX clients over basicHttpBinding.

The problem I am facing is that if I provide the endpoint address in the config, that url is not accessible. If I donot provide the same, WCF complains that the endpoint address is already existing.

Thanks in Advance,

Manoj




Answer this question

Multiple endpoints for a service hosted in IIS

  • Jitin Batra

    I just tested Javier solution and it is working

    IIS hosting cases,all these end point address has to be virtual directory addres or relative to virtual directory address.

    -Thank you

    Madhu



  • iSreenivasRao.K

    WCF service will have 2 addresses,base address and end point address

    base address is used for meta data(to get wsdl file and to know what kind of contracts and bindings your service going to support) =This is .SVC address=we will have only one base address for service=when you are buiding proxy with svcutil,svcutil will use this address to get wsdl info from your service

    inside your service,you can have multiple end point address,when you are actually calling the service,we will use this address

    for IIS hosting,base address and end point address is same(or end point address has to be relative to base address)

    from browser,you can browse only base address,thats why you are able to browse only

    http://myMachine/Payments/PaymentService.svc

    when you are calling service from client app,you can use both address

    http://myMachine/Payments/PaymentService.svc

    http://myMachine/Payments/PaymentService.svc/wse

    please try self host sdk sample,self host sample will help us to understand difference between base address and endpoint address

    -Thank you

    Madhu



  • Brad Wood

    Thanks Madhu and Javier.

    The doubt I still have is - what will be the endpoint addresses (URLs) Will it be

    http://myMachine/Payments/PaymentService.svc and

    http://myMachine/Payments/PaymentService.svc/wse

    The issue is the second URL isnt working. Is there another way to access the second endpoint



  • elsae

    Yes it is possible.

    I have running in the IIS but with the same contract:

    <services>

    <service type="MieresServer.ACSService">

    <endpoint contract="MieresServer.IACSService" binding="basicHttpBinding"/>

    <endpoint address="reliable" contract="MieresServer.IACSService" binding="wsHttpBinding"/>

    </service>

    </services>


  • SHL

    Thanks Madhu.

    That was my mistake. I was trying to access the URL of the second endpoint from the browser.

    All is well now!



  • Multiple endpoints for a service hosted in IIS