开发者

Remove XML format from auto-generated help in WCF 4 REST service

开发者 https://www.devze.com 2023-01-30 13:21 出处:网络
I\'m using WCF 4 and WCF REST C# templates to build out an API using JSON as the transport mechanism.

I'm using WCF 4 and WCF REST C# templates to build out an API using JSON as the transport mechanism.

From the web.config:

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <standardEndpoints>
      <webHttpEndpoint>
        &l开发者_运维问答t;standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" defaultOutgoingResponseFormat="Json"/>
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

As you can see, I've disabled the automaticFormatSelection and specified the default format as JSON.

However, when the help files get generated they include both XML and JSON formats in the endpoint method examples:

(I can't upload a picture to StackOverflow yet sadly... so here's a snippet)

Url: https://awesome.myapi.com/1.0/account/

HTTP Method: POST

Message direction       Format      Body
Request               Xml         Example,Schema
Request               Json        Example
Response                 Xml         Example,Schema
Response                 Json        Example

So the question: Is it possible to have the auto-generated help not include XML?

Thanks.

0

精彩评论

暂无评论...
验证码 换一张
取 消