Question

I am consuming a third party WCF service and its config is below (a portion of it). I wanted to assign serviceBehaviors to endpoint, but there is no <service> tag here. In this case, how do you assign 'serviceBehaviors'?

<client>
  <endpoint address="https://something/someservice.asmx" binding="customBinding" bindingConfiguration="ABCBinding" contract="Democlient.Soap" name="Soap" behaviorConfiguration="SoapEndpointB" />
</client>
<behaviors>
  <endpointBehaviors>
    <behavior name="SoapEndpointB">
      <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="SoapServiceB">
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>
Was it helpful?

Solution

You assign serviceBehaviors to WCF server endpoints, not to client endpoints. You would have to request the 3rd party WCF service host add the service behaviors you seek if you need them changed.

OTHER TIPS

It looks like the configuration you're showing is your client side configuration. That just indicates how you're going to be communicating with the service. It doesn't tell the service anything about your client.

Remember that the service has no knowledge of the client, and the only knowledge that the client has of the service is via metadata exchange.

Unless the service offers some method for doing so (not via any .Net or WCF mechanism), your client can not specify how the service should behave, nor should it. A given service may be handling requests from many different clients, each with their own desires. There's just no good way to handle that kind of situation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top