none
wcf service with secure and unsecure endpoint RRS feed

  • Question

  • Hi,
    I have a service .. let us call it ChoclateOrderService.

    I need to have 2 endpoints.
    1. Using basicHttpBinding - used in testing our functionality
    2. Using customBinding with Mutual Certificate - used with the actual consumer

    Usually, when I have "only" the secured endpoint...
    I decorate my Contract with ProtectionLevel=ProtectionLevel.Sign

    And when testing for myself, I use basicHttpBinding.. I change it to ProtectionLevel.None.

    So, if I want both.. what exactly should I do?
    Or do I need do it in a different manner altogether.



    Praveen Behara
    MCST : BizTalk Server 2006 R2, 2010

    Friday, November 8, 2013 12:21 PM

Answers

  • Hi,

    Because the “Protection-level settings” are controlled by the contract, so it is hard to have a secure and unsecure endpoint.

    One possible solution is to create two service contract, for more information, please try to check as below:

    We can create a service contract interface named as IServiceA with contract with ProtectionLevel=ProtectionLevel.Sign and the other a service contract interface named as IServiceB with contract with ProtectionLevel=ProtectionLevel.None, then the service named as ServiceTest implement the both as below:

    public class ServiceTest : IServiceA,IServiceB
    { }

    Then occording to the different contract, we can use the different the binding.

    #Multiple Service Contracts in WCF Service:
    http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/multiple-service-contracts-in-wcf-service/ .

    Best Regards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 11, 2013 6:19 AM
    Moderator