Visual Studio “Add Service Reference” - not gets all service settings

半城伤御伤魂 提交于 2019-12-11 07:45:24

问题


my purpose is to ensure that - when someone clicks on "Add Service Reference" in his own Visual Studio, and he adds references to my WCF service - he receives not the default settings, but the settings of the service.

In particular, there is a property of the "binding" class that interests me: useDefaultWebProxy, I need it setted to "false".

I tried this, but with no results: In the Web.config file of the service:

<system.serviceModel>
  <bindings>
   <basicHttpBinding>
    <binding name="NewBinding0" ... useDefaultWebProxy="false">
     <readerQuotas ... />
    </binding>
   </basicHttpBinding>
  </bindings>
  <services>
   <service behaviorConfiguration="NewBehavior0" name="pippo.pluto">
    <endpoint address="" behaviorConfiguration="" binding="basicHttpBinding" 
             bindingConfiguration="NewBinding0" name="pluto" contract="pippo.ipluto" />
    <host>
     <timeouts ... />
    </host>
   </service>
  </services>
  <behaviors>
   <serviceBehaviors>
    <behavior name="NewBehavior0">
     <serviceMetadata ... />
     <serviceDebug ... />
    </behavior>
   </serviceBehaviors>
  </behaviors>
 </system.serviceModel> 

Nothing to do: in the client's Web.config I always get...

<basicHttpBinding>
  <binding name="pluto" ... useDefaultWebProxy="true">
   <readerQuotas ... />
   <security ...>
    <transport ... />
    <message ... />
   </security>
  </binding>
 </basicHttpBinding>

It seems that the bindingConfiguration of the service is completely ignored, not only useDefaultWebProxy but also other properties - for example maxBufferSize - maintain the default values (65536)

How can I do? Pileggi

来源:https://stackoverflow.com/questions/12246892/visual-studio-add-service-reference-not-gets-all-service-settings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!