none
Consuming a HTTPS web service in WCF RRS feed

  • Question

  • Hi,

    I have a web service which is SSL enabled (https://xxx).. I assume the data is encrypted. 

    We need to consume it in WCF.. and I have only the public key.. This means, I use the public key to encrypt and the web service decrypts the data. I am don't really know what binding and modes should be used here.

    Could anybody pls guide me.

    I don't have any private keys with me.



    Praveen Behara
    MCST : BizTalk Server 2006 R2, 2010

    Thursday, December 5, 2013 6:14 PM

Answers

  • Hello Praveen,

    You should not need any private keys and you can accomplish this all via WCF binding.  There is more than 1 way to secure the service you might need to get more information from the service owners, but a common way to secure this is shown here http://msdn.microsoft.com/en-us/library/ff650785.aspx.

    Take a look at step 8.  Most likely you will not get it right the first time; so turn on wcf tracing to determine how far it is getting (e.g., make sure the certificate is found and loaded from the appropriate certificate store).

    Good luck. 


    Jeff

    Thursday, December 5, 2013 9:38 PM

All replies

  • Hello Praveen,

    You should not need any private keys and you can accomplish this all via WCF binding.  There is more than 1 way to secure the service you might need to get more information from the service owners, but a common way to secure this is shown here http://msdn.microsoft.com/en-us/library/ff650785.aspx.

    Take a look at step 8.  Most likely you will not get it right the first time; so turn on wcf tracing to determine how far it is getting (e.g., make sure the certificate is found and loaded from the appropriate certificate store).

    Good luck. 


    Jeff

    Thursday, December 5, 2013 9:38 PM
  • Hi,

    If you want to consume a https web service in wcf, you can use many kinds of binding, the following is the basichttpbinding, please try to check it:

    <bindings>
      <basicHttpBinding>
        <binding name="PurchaseOrderSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
            receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
            bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="Transport" />
        </binding>
      </basicHttpBinding>
    </bindings>

    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.


    Friday, December 6, 2013 8:38 AM
    Moderator
  • Hi Jeff,

    I ensured that my binding is exactly what is present in step 8, however no luck. I got a response that the SOAP header is not understood.. Since it is a piece of hardware (printer) exposing the web service, I can't even ask the other side as to what the problem is.

    @Amy,

    I tried your way with no luck. I got what Jeff / site he pointed out .. it was clearly specifying the certificate to use. However, your above binding doesn't even specify that.. How does it work in such scenarios?

    Any other ideas would be welcome.


    Praveen Behara
    MCST : BizTalk Server 2006 R2, 2010

    Saturday, December 7, 2013 6:46 PM