Link to home
Start Free TrialLog in
Avatar of ipjyo
ipjyoFlag for United States of America

asked on

How to pass network credentials to a web service using WCF framework?

HI,
I am using WCF to communicate with a web service. I need to do use network credentials to communicate with the web service. I have the below two lines to create the channel. Is there any property on the ChannelFactory to set the network credentials? Thank you.

System.ServiceModel.ChannelFactory<FFWebService.FFChannel> channelFactory = new System.ServiceModel.ChannelFactory<FFChannel>("FFOrderPort");
            FFWebService.FFChannel channel = channelFactory.CreateChannel();
ASKER CERTIFIED SOLUTION
Avatar of Vel Eous
Vel Eous

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ipjyo

ASKER

Thank you.
Avatar of Victor Sagayaraj
Victor Sagayaraj

How to send credentials from silverlight to web service....
Everytime i'm getting the authentication dialog when i run my application
Below is my code:

BasicHttpBinding AdminService_Binding = new BasicHttpBinding();
EndpointAddress WM_AdminService_Endpoint = new EndpointAddress(ConfigManager.WM_AdminServiceURL);

WebRequest.RegisterPrefix("https://", WebRequestCreator.ClientHttp);
                MyAdminService.ClientCredentials.UserName.UserName = ConfigManager.ListenerServiceUserName;
                MyAdminService.ClientCredentials.UserName.Password = ConfigManager.ListenerServicePassword;