Posted by (JavaScript must be enabled to view this email address) on Tue 10 Mar 2009

I am working on a project where a service application needs to interface with a webservice that implements a WS-Security authentication model.

WSE 2.0 provides the functionality for message level authentication, however WSE 2.0 does not integrate with Visual Studio 2008.

In order to get this to work I created the proxies using the WSDL command line utility and changed the base class from System.Web.Services.Protocols.SoapHttpClientProtocol to Microsoft.Web.Services2.WebServicesClientProtocol.
Here is an example of the code to set the username and password for the request object.


  1. namespace YourApplication.Helper
  2. {
  3. public static class RequestHelper
  4. {
  5.  
  6. public static void PrepRequest(WebServicesClientProtocol si)
  7. {
  8. //get username and password for service request from config file
  9. string _password = ConfigurationManager.AppSettings["password"];
  10. string _username = ConfigurationManager.AppSettings["username"];
  11.  
  12. //create the user token
  13. UsernameToken token = new UsernameToken(_username, YourApplication.Helper.Cryptography.CryptographyHelper.DoHash(_password), PasswordOption.SendHashed);
  14.  
  15. //carry out the request
  16. SoapContext requestContext = si.RequestSoapContext;
  17. requestContext.Security.Tokens.Add(token);
  18.  
  19. }
  20. }
  21. }



Posted by (JavaScript must be enabled to view this email address) on Mon 09 Mar 2009

Occasionally you will find that your user account doesn’t have a default database associated with it, this will stop you logging into SQL using Windows Authentication regardless of being a local administrator.

To be able to log in do the following:

1. Create a local user (as you have administrative access this is fine)
2. Add the user to local administrators and to the SQL Server Users group something like this (SQLServer2005MSSQLUser$MACHINENAME$INSTANCENAME)
3. Restart the SQL Server
4. Log into the laptop as the new local user
5. Run SQL Server
6. Go to security and right click on the user account which does not have access to SQL Server and select properties
7. Set the default database as master
8. Set the user role as required
9. Ensure that the user has access to the correct databases
10. Click ok
11. Log out of the pc
12. Log in as the original user.

You will now have access to log into the SQL Server.



Page 3 of 3 pages  <  1 2 3

About our Blog

Brantas Limited specialise in Dynamics CRM, SharePoint and System Integration using the Microsoft Platform. We are all experienced developers in various fields with our own specialities complementing those of our team.

We have been working with SharePoint since 2003, including Installation and Administration, Migration, Development and Support.

RSS Feed