I have set up a WCF service that will accept both JSON and XML in the same method, and that supports both SOAP and REST.
The JSON works fine, but I do not know how the XML should look.
The interface looks like this:
[ServiceContract]
public interface IWebService
{
[OperationContract]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare)]
string[] EchoArray(string[] stringArray);
}
If possible, I would like to keep the XML as simple as possible, without namespaces, like this:
<stringArray>
<string>hello</string>
<string>hola</string>
</stringArray>
The response should be simple as well.
If it makes any difference, I am doing it all in code, without any web.config.
This is so I can use an Azure worker role.