locked
how to ask a credential calling a service RRS feed

  • Question

  • User-1674296013 posted

    hi;

    I am using a WCF service and everything looks good ,

    I just want to ask a credential When someone add a service via VisualStudio

    Thursday, February 25, 2021 12:02 PM

All replies

  • User475983607 posted

    I just want to ask a credential When someone add a service via VisualStudio

    Host the WSDL in a site with basic authentication or write a handler that trigger basic authentication when some tries to download the WSDL.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

    Thursday, February 25, 2021 12:50 PM
  • User1535942433 posted

    Hi alya14,

    As far as I think,when calling a WCF service from a COM application, you can use the IChannelCredentials interface to specify credentials.

    1.Run the Setup.bat file in the Message Security directory to create and install the required test certificates.

    2.Open the Message Security project.

    3.Add [ServiceBehavior(Namespace="http://Microsoft.ServiceModel.Samples")] to the ICalculator interface definition.

    4.Add bindingNamespace="http://Microsoft.ServiceModel.Samples" to the endpoint tag in the App.config for the service.

    5.Build the Message Security Sample and run Service.exe. Use Internet Explorer and browse to the service's URI (http://localhost:8000/ServiceModelSamples/Service) to ensure that the service is working.

    More details,you could refer to below article:

    https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-specify-channel-security-credentials

    Best regards,

    Yijing Sun

    Friday, February 26, 2021 2:21 AM