WCF, WSDL and tempUri.org

· April 11, 2008

It’s back! Just when we thought that we’ve seen the dreadful namespace http://tempuri.org is coming back at us with full power.

The feeling you get when a web service is exposed under the namespace tempUri.org is that the developer of that web service is either sloppy or don’t now what he is doing.

Well, well - don’t be like that when it comes to using WCF. Here is an article describing how to do it. The key points are quite easy:

  • Use the ServiceBehavior attribute. Note: on the service implementation - not on the contract!
  • Set the namespace-property to the namespace you want.

Here is an example (yes, I know, it’s in dreaded VB.NET):

<ServiceBehavior(Namespace:="<https://www.marcusoft.net/Services/2008/04/MyService>", _)>
Public Class MyServiceImplementation implements IService
...
End Class

Twitter, Facebook