I have quite a few endpoints on my WCF REST Service. They all have the same body style, request format and response format.
[WebGet(BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = xxx)]
Is there anyway to set those attributes in the web.config?
You can set the default value for the body style and for the outgoing response format (not for the request format) in the
<webHttp>
endpoint behavior (see below). Notice that if you're in a service (which seems to be your case), that doesn't matter, since WCF REST endpoints can receive requests in both XML and JSON - the RequestFormat property is only used when it's being used within a client, to decide in which format to send the request.