I am implementing a WCF web service which interacts with a client whose code I do not control. The WSDL was supplied by the client.
I generated C# files from the WSD
The following worked for me (based on this thread):
ServiceContract
)
XmlSerializerFormat
DispatchByBodyBehavior
Add the following to your service interface
[OperationContract(Action = "")]
public void DoNothing()
{
}
For my service the WrapperName and Wrappernamespace are null
for all messages. I had to go into DispatchByBodyBehaviorAttribute
and edit ApplyDispatchBehavior()
to add the following lines to check for this:
if (qname.IsEmpty) {
qname = new XmlQualifiedName(operationDescription.Messages[0].Body.Parts[0].Name, operationDescription.Messages[0].Body.Parts[0].Namespace);
}