2

当我调用具有mtom编码的 Java Web 服务时,出现以下异常:

服务器没有提供有意义的回复;这可能是由于合同不匹配、会话过早关闭或内部服务器错误造成的。

我可以发送小文件,但不能通过服务发送大量数据。我的客户也是 WCF 服务。

网页配置文件:

<?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>
4

0 回答 0