为SOAP MTOM配置Spring.Web.Services.WebServiceProxyFactory

时间:2012-08-25 15:49:42

标签: soap proxy spring.net mtom

我使用Spring.NEt frwm为Spring创建代理对象 - Spring.Web.Services.WebServiceProxyFactory。

WCF服务使用SOAP MTOM。配置在这里:

  <basicHttpBinding>
    <binding    name="MTOM_BINDING" 
                maxReceivedMessageSize="10000000000" 
                receiveTimeout="00:10:00" 
                sendTimeout="00:10:00" 
                maxBufferSize="10000000000" 
                maxBufferPoolSize="524288" 
                bypassProxyOnLocal="true" 
                messageEncoding="Mtom">

      <readerQuotas 
                  maxArrayLength="10000000000" 
                  maxBytesPerRead="10000000000"
                  maxDepth="10000000000" 
                  maxNameTableCharCount="10000000000" 
                  maxStringContentLength="10000000000"/>
    </binding>
  </basicHttpBinding>

  <service      name="TestService" 
                behaviorConfiguration="DefaultBehavior">
    <endpoint   address="" 
                binding="basicHttpBinding"
                bindingConfiguration="MTOM_BINDING" 
                contract="TestService.ITestService" 
                bindingNamespace="http://test.com/TEST" 
                behaviorConfiguration="SimpleWSDLBehavior"/>
    <endpoint 
                contract="IMetadataExchange" 
                binding="mexHttpBinding" 
                address="mex"/>
  </service>

Spring.Web.Services.WebServiceProxyFactory代理对象的配置:

  <object id="testProxy"
          type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
    <property name="ServiceUri" value="http://localhost/TestService.svc?wsdl"/>

    <property name="ServiceInterface" value="TestService.ITestService, TestService"/>

    <property name="ProductTemplate">
      <object>
        <property name="Timeout" value="2147483646" />
      </object>
    </property>
  </object>

我无法找到如何为Spring.Web.Services.WebServiceProxyFactory指定WCF服务不使用SOAP而是使用SOAP MTOM。

因为Spring.Web.Services.WebServiceProxyFactory的这个配置除了SOAP mesage之外,它将数据序列化为文本而不是binnary。

1 个答案:

答案 0 :(得分:2)

WebServiceProxyFactory适用于.asmx Web服务。

有关WCF支持,请参阅: http://www.springframework.net/doc-latest/reference/html/wcf.html

相关问题