Gerben van Loon

Random thoughts on Microsoft Software Development and other related stuff

WCF Best Practice #2: Don't forget XmlNamespace settings

In addition to the WCF Best Practices that are already around. WCF Best Practice #2: Don't forget XmlNamespace settings:

By default WCF puts the “http://tempuri.org/”  namespace in your wsdl and contracts. Normally you don’t want this. You can control this from three places:

- In your config file in the services/service/endpoint/bindingNamespace attribute
- In your servicecontract: [ServiceContract(Namespace="http://myuri.net/")] 
- In your servicebehavior: [ServiceBehavior(Namespace="http://myuri.net/")]

Update: Ron Jacobs also has a nice step by step article on this one: http://blogs.msdn.com/b/rjacobs/archive/2011/05/12/how-to-eliminate-tempuri-org-from-your-service-wsdl.aspx

Posted: Mon, Feb 1 2010 3:51 PM by Gerben van Loon | with 1 comment(s)
Filed under:

Comments

Gerben van Loon said:

Whooo... it's done! Had these articles in the pipeline for quite a while :-). They come from my years

# February 1, 2010 4:47 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Please add 2 and 6 and type the answer here: