我有一个 WCF,我需要动态创建此配置,因为我的 app.config 在客户端计算机中永远不会更改。
任何身体帮助?
<behaviors>
<endpointBehaviors>
<!-- REST -->
<behavior name="restBehavior">
<webHttp defaultOutgoingResponseFormat="Json" defaultBodyStyle="Wrapped"/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="defaultBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<client>
<endpoint name="json" address="http://localhost:8080/json"
binding="webHttpBinding"
bindingConfiguration="webBinding"
behaviorConfiguration="restBehavior"
contract="ServiceReference.ServiceClientContract" />
</client>