Click here to Skip to main content
15,510,484 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +

I have started with wcf web service & i am stuck with something.Scenario is like i have a https wsdl file which is authenticated with a password & username.It has 3 parts Contract,implementation & service.In implementation i am adding up the service reference and the app.config gets changed according to that having basichttpwinding.

As the wsdl file is authenticated i would have to pass username & password.So i have done that.

DCService.DCClient cli = new DCService.DCClient(bind, ep);
  //pass custom credentials
  cli.ClientCredentials.UserName.UserName = "Arvind";
  cli.ClientCredentials.UserName.Password = "Silver";

Now do i need to create another authentication solution containg class for usernamepasswordvalidator????
Which binding shall i use basic httpbinding or wshttpbinding and what about the
<security mode="TransportWithMessageCredential">

<message clientCredentialType="UserName"/>

One more thing when i add the service reference as we know app.config changes automatically specially the binding part.It shows two bindings in one binding the the security mode = "transport credentials" & in other binding security binding =none .
I know these questions could be very lame but have gone through some articles but these doubts remain.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900