none
Why isn't the dataContractSerializer not resolving the System.ServiceModel.Dispatcher.NetDispatcherFaultException? RRS feed

  • Question

  • I got the following exception when working with XMLs in a WCF application:

    System.ServiceModel.Dispatcher.NetDispatcherFaultException: The formatter threw an exception while trying to deserialize the message:

    After adding the following part of DataContractSerializer it doesn't work. Still getting the error. My app.config looks like this after adding DataContractSerializer:

    configuration>
        <system.serviceModel>
          <behaviors>
            <endpointBehaviors>
              <behavior name="Graph">
                <dataContractSerializer maxItemsInObjectGraph="1000000000"/>
              </behavior>
            </endpointBehaviors>
          </behaviors>
            <bindings>
              
                <basicHttpBinding>
                  
                    <binding name="BasicHttpBinding_IBrokerService" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <security mode="None">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="UserName" algorithmSuite="Default" />
                        </security>
                      
                    </binding>
                  
                </basicHttpBinding>
              
            </bindings>
            <client>
              <endpoint address="http://test/test2/TestBroker.svc" binding="basicHttpBinding"
                  bindingConfiguration="BasicHttpBinding_TestService" contract="Proxy.TestService"
                  name="BasicHttpBinding_TestService" behaviorConfiguration="Graph" />
            </client>
          
         
          
        </system.serviceModel>
    </configuration>


    mayooran99


    • Edited by Mayooran99 Tuesday, June 24, 2014 4:52 AM
    Tuesday, June 24, 2014 4:50 AM

Answers

  • Hi,

    First please try to enter your service address in the IE to make sure that the service works.

    Then I see that you have used the following:

    <basicHttpBinding> <binding name="BasicHttpBinding_IBrokerService"

    ................

    But in your client endpoint you have used the following:

      <endpoint .....              
    bindingConfiguration="BasicHttpBinding_TestService"
    ............/>


    So please use the this for instead:
    bindingConfiguration="BasicHttpBinding_IBrokerService"



    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 25, 2014 9:54 AM
    Moderator