0

I have a WSDL file. I want to consume webservice from this WSDL. I have added service reference by using this WSDL and created proxy. I have created required parameter for invoking my service method. Actually webservice is protected by a basic authentication. But in the client proxy no option found to provide the user name and password. How could I invoke webservice? I want to provide basic authentication credentials.

I am getting the following error when invoking service method without giving credentials.

 System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. 
---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

Please help me

1 Answer 1

2

Try this:

client.ClientCredentials.UserName.UserName = "xxxxxx";
client.ClientCredentials.UserName.Password = "xxxxx";

https://msdn.microsoft.com/en-us/LIbrary/ms733775.aspx

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.