WSDL Annoyance
This is not imprtant, but I can figure out why this:
namespace Foo
{
[ServiceContract(Namespace = "http://www.test.com")]
public interface IFubar
{
[OperationContract]
void Act();
}
public class Fubar : IFubar
{
public void Act()
{
}
}
}
Result in a WSDL that starts with this:
Adding a [ServiceBehavior] with the correct namespace only move the tempuri to another location. Any ideas?
Comments
You need to set the namespace in three different places:
Namespace property of the ServiceContract attribute like you did.
Namespace property of the ServiceBehaviour attribute.
BindingNamespace of the endpoint
Config example:
<endpoint address=""
I guess Microsoft could have made this a bit easier ;-)
Yep, I believe all you're missing from your code is the trailing backslash on the namespace URL.
Have you tried WSCF yet ? (www.thinktecture.com/wscf)
Just furthor to the first comment..
The service published declares the targetNamespace in the wsdl:definitions, so you mark this with a Namespace property in the [ServiceBehavior] attribute.
The binding also has its own namespace, so you need to set a bindingNamespace attribute in your endpoint definition if you want this to be consistant with the Service namespace.
Lastly, the contract also declares a namespace which is used for defining the operations and the types which is what we use the Namespace property in [ServiceContract] to declare
Comment preview