WCF offre due opzioni per l'attributo ResponseFormat nell'annotazione WebGet in ServiceContract.WCF ResponseFormat For WebGet
[ServiceContract]
public interface IService1
{
[OperationContract]
[WebGet(UriTemplate = "greet/{value}", BodyStyle = WebMessageBodyStyle.Bare)]
string GetData(string value);
[OperationContract]
[WebGet(UriTemplate = "foo", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
string Foo();
Le opzioni per ResponseFormat sono WebMessageFormat.Json e WebMessageFormat.Xml. È possibile scrivere il mio formato di messaggio Web? Mi piacerebbe che quando il client chiama il metodo foo() ottiene una stringa raw - senza wrapper json o xml.
Nizza. Funziona - sembra ancora che ci dovrebbe essere un WebMessageFormat.Raw. Grazie. –