WCF offers two options for ResponseFormat attribute in WebGet annotation in ServiceContract.
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "greet/{value}", BodyStyle = WebMessageBodyStyle.Bare)]
string GetData(string value);
[OperationContract]
[WebGet(UriTemplate = "foo", ...
Hello
I have a WCF restul service and I want to allow the user to choose what request format they want, i have the decorations
[OperationContract]
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Xml,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "getstreamurl?ch={ch}&format=xml")...
I'm using JavaScript to access a ScriptService method called GetPerson().
The problem is that it is returning a fairly empty JSON string instead of an actual object string.
The same happens when I return a new DateTime object so the class is out of question I hope.
This is returned:
{"d":{"__type":"Person"}}
this is my WebService.cs...