0

Scenario:

.Net application has web service reference and has proxy class. The web service is Java webservice. The payload is pretty huge and I've bumped up the maxBufferSize, MessageSize etc to 2147483647 .

Having done above I'm still getting the exception below:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter urn:ConsumptionProcessWSVi:Response. The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '.

Could anyone please suggest what else needs to be configured in web.config?

Nil Pun
  • 17,035
  • 39
  • 172
  • 294

1 Answers1

1

Managed to fix this issue with config below:

 <behaviors>
      <endpointBehaviors>
        <behavior name="maxItemsInObjectGraph">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>

 <endpoint address="http://xxx"
                binding="basicHttpBinding" bindingConfiguration="bidingname" behaviorConfiguration="maxItemsInObjectGraph"
                contract="Yourcontract" name="ConfigPort" />
Nil Pun
  • 17,035
  • 39
  • 172
  • 294