I'm relatively new to WCF, specifically the WCF 4 REST Online开发者_StackOverflow Template.
I am testing a basic method:
[WebGet(UriTemplate = "Test")]
public string Test() 
{
    return "Test";
}
The response generated is:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hello World</string>
Is there any way to send back anything other than XML or JSON, or is there any way to modify the response?
You could return Stream; WCF won't apply formatting and you would be free to write whatever content you wanted to the Stream.
This article may help.
Edit:
Also, keep in mind that if you are going to use this method to serve up a file, for example, then  you'll need to find some way to set the MIME type appropriately. This thread should give you some ideas. Personally, I prefer the Registry Read method suggested by @Serguei.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论