tags:

views:

30

answers:

0

I have the following code:

        _WSPassword = Config.Get("pwinconfig");
        _WSUsername = Config.Get("uninconfig");
        UsernameToken token = new UsernameToken(_WSUsername, _WSPassword, PasswordOption.SendPlainText);

        MyService serviceProxy = new MyService();
        //serviceProxy.Url = Config.Get("urlinconfig");

        serviceProxy.RequestSoapContext.Security.Tokens.Add(token);

When I uncomment out the line setting the URL my service fails to send the credentials over. When I let it use its own method to get the URL (which it won't let me change via the web.config) it works fine (ie, the code above works fine).

Would love some direction on how to set the security.