当我调用具有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>