问题
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