Calling mtom-encoded Java web service from WCF client results in error for large files

620 Views Asked by At

When I call a Java web service which has an mtom encoding, I get the following exception:

The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

I can send small files, but I can't send huge data over service. Also my client is a WCF service.

Web config file:

<?xml version="1.0"?>
<configuration>
  <system.serviceModel>
        <bindings>
      <basicHttpBinding>
        <binding name="MyWebServicesSoapHttp"/>
        <binding name="basicHttpBinding_IUpload" transferMode="Streamed"
      messageEncoding="Mtom"
      maxReceivedMessageSize="10067108864"
      maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
          <readerQuotas
        maxDepth="32"
        maxStringContentLength="2147483647"
        maxArrayLength="2147483647"
        maxBytesPerRead="4096"
        maxNameTableCharCount="16384" />
        </binding>
      </basicHttpBinding>
      <customBinding>
        <binding name="MyWebServicesSoap12Http" sendTimeout="00:10:00">
          <mtomMessageEncoding messageVersion="Soap12" writeEncoding="utf-8">
          </mtomMessageEncoding>
          <httpTransport  />
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="http://10.72.33.48:80/fileupload/MyWebServices"
        binding="customBinding" bindingConfiguration="MyWebServicesSoap12Http"
        contract="MyFileUploadWS.MyWebServices" name="MyWebServicesSoap12HttpPort"/>
      <endpoint address="http://172.19.4.60/Myws/MyWebServices" 
        binding="basicHttpBinding" bindingConfiguration="MyWebServicesSoapHttp"
        contract="getDataWS.MyWebServices" name="MyWebServicesSoapHttpPort"/>
    </client>
    <services>
      <service behaviorConfiguration="MyFileUploadWCF.ServiceBehavior"
        name="MyFileUploadWCF.Service">
        <endpoint address="" binding="basicHttpBinding"
          bindingConfiguration="basicHttpBinding_IUpload" contract="MyFileUploadWCF.IService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MyFileUploadWCF.ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="clientEndpoint">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>
  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="4294967295" />
      </requestFiltering>
    </security>
  </system.webServer>
  <system.web>
    <compilation debug="true"/>
    <httpRuntime maxRequestLength="2097151"/>
  </system.web>
</configuration>
0

There are 0 best solutions below