Why change the Web Service Namespace from tempuri.org

When you create a Web Service the default Namespace is

  [WebService(Namespace = http://tempuri.org/”)]

I was wondering firstly should I change it and secondly what should I change it to.  The default Namespace doesn’t really give you much of an indication or example.

The short answer is all Web Services need a unique namespace to distinguish it from other Web Services on the web and the best way to do this is put the company you work for in it e.g. for me

http://metaphorix.com

Whilst you are developing the Web Service is fine to leave as tempuri.org but don’t forget to change this before you make it public.

I can’t be the only person to wonder about this because Microsoft has a support page dedicated to the question

No recommendation is made to change the http://tempuri.org/ namespace in Visual C++ .NET Managed C++ Web Service applications

Although it’s not really the question I am asking it does provide the answer, there are two useful parts in the article

 

You can change the default namespace by using the Namespace property of the WebService attribute. TheWebService attribute is an attribute that is applied to the class that contains the XML Web service methods. The following example sets the namespace to “http://microsoft.com/webservices/”:

  [WebService(Namespace="http://microsoft.com/webservices/")]
	public __gc 
        class MyWebServiceClass : public System::Web::Services::WebService
    {
        // Implementation     
    };

Identify your XML Web service with a namespace that you control. For example, you can use the Internet domain name of your company as part of the namespace. Many XML Web service namespaces look similar to URLs, however, namespaces do not have to point to actual resources on the Web. (XML Web service namespaces are URIs.)

 

Each XML Web service must have a unique namespace for client applications to distinguish the Web service from other services on the Web. For XML Web services that are under development, “http://tempuri.org/” is available. However, use a more permanent namespace for published XML Web services. For additional information about XML namespaces, see the following World Wide Web Consortium (W3C) Web site:

 

There are also some good forum discussion on the topic.

The two forums discussion I found useful can be read here and here

The first one probably provides the best answer, written by Vipul Modi – MSFT

This web service is using http://tempuri.org/ as its default namespace.

Recommendation: Change the default namespace before the XML Web service is made public.

Each XML Web service needs a unique namespace in order for client applications to distinguish it from other services on the Web. http://tempuri.org/ is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.

Your XML Web service should be identified by a namespace that you control. For example, you can use your company’s Internet domain name as part of the namespace. Although many XML Web service namespaces look like URLs, they need not point to actual resources on the Web. (XML Web service namespaces are URIs.)

For XML Web services creating using ASP.NET, the default namespace can be changed using the WebService attribute’s Namespace property. The WebService attribute is an attribute applied to the class that contains the XML Web service methods. Below is a code example that sets the namespace to “http://microsoft.com/webservices/”:

C#

[WebService(Namespace="http://microsoft.com/webservices/")]
public class MyWebService {
    // implementation
}
- Vipul Modi - MSFT

CRM 2011 – How to apply a security role to multiple users

sometimes when you create a new entity and access the system as Admin you forgot you need to change the security roles to add access to the new entity.

it can be quite a hassle to edit all the security roles to add the correct privileges to all the different security roles.  So you might find this tool useful – Role Updater for Microsoft Dynamic CRM 2011.  This tool and the other CRM 2011 tools shows the value of allowing developers to access values through code, they end up creating lots of free tools for you.

there is another way around this, you can create a new security role and then add this security role to the users you want to access the new entity or you might want to apply this security role to everyone.

I was in this scenario because I wanted to give everyone the new Activity feeds role but how can I give multiple users the same security role.

The answer is

Go to SETTINGS -> Administration -> Users

You will then see a list of users and at the top of the screen you can see a manage roles button

If you press the manage roles you can then select the security roles you want to give to all the selected users.

Click here to visit the Metaphorix homepage to see how Metaphorix uses Microsoft Dynamics CRM and NAV and other products and services.