What is the difference between using a WebGet attribute
[WebGet( ResponseFormat = WebMessageFormat.Xml )]
and manually setting the content type?
WebOperationContext.Current.OutgoingResponse.ContentType = "application/xml";
I have a Silverlight app that is making this request to WCF. I'm looking at the traffic and the request/response for the ClientAccessPolicy.xml file looks exactly the same to me.
The problem is, manually setting the content type works fine in all browsers, but using WebGet will cause the Silverlight app to not be able to connect to the WCF services on FireFox only. It works in all other browsers. And again, doing it manually works fine in FireFox.
Doing it manually is a problem when unit testing, because WebOperationContext.Current is null during the test.