Bruno Baia
03-28-2007, 12:16 PM
There's only one IFactoryObject implementation to create a Web Service proxy anymore, WebServiceProxyFactory.
If we are wrapping a .NET generated proxy class (or another custom proxy), use the ProxyType property to specify its type which allows you to code against an interface, and not directly against the proxy generated :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ProxyType" value="Spring.Calculator.ClientApp.MyProxyType, Spring.Calculator.ClientApp"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
If you want to generate dynamically the proxy from an url or a WSDL file, use the ServiceUri property :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
For both case, you can use the ProductTemplate property to configure the result of the factory, the generated/wrapped proxy :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<!--<property name="ProxyType" value="Spring.Calculator.ClientApp.MyProxyType, Spring.Calculator.ClientApp"/>-->
<!--<property name="ServiceUri" value="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2005/calculatorService.wsdl"/>-->
<!--<property name="ServiceUri" value="file://~/MyWsdlFile.wsdl"/>-->
<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
<!-- Dependency injection on Factory's product : the proxy instance of type SoapHttpClientProtocol -->
<property name="ProductTemplate">
<object>
<property name="Timeout" value="10000" /><!-- 10s -->
<!-- etc... -->
</object>
</property>
</object>
Configuration parser incoming...
If we are wrapping a .NET generated proxy class (or another custom proxy), use the ProxyType property to specify its type which allows you to code against an interface, and not directly against the proxy generated :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ProxyType" value="Spring.Calculator.ClientApp.MyProxyType, Spring.Calculator.ClientApp"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
If you want to generate dynamically the proxy from an url or a WSDL file, use the ServiceUri property :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
</object>
For both case, you can use the ProductTemplate property to configure the result of the factory, the generated/wrapped proxy :
<object id="calculatorService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services">
<!--<property name="ProxyType" value="Spring.Calculator.ClientApp.MyProxyType, Spring.Calculator.ClientApp"/>-->
<!--<property name="ServiceUri" value="assembly://Spring.Calculator.ClientApp/Spring.Calculator.ClientApp.Config.WebServices2005/calculatorService.wsdl"/>-->
<!--<property name="ServiceUri" value="file://~/MyWsdlFile.wsdl"/>-->
<property name="ServiceUri" value="http://localhost:1643/Spring.Calculator.Web.2005/calculatorService.asmx"/>
<property name="ServiceInterface" value="Spring.Calculator.Interfaces.IAdvancedCalculator, Spring.Calculator.Contract"/>
<!-- Dependency injection on Factory's product : the proxy instance of type SoapHttpClientProtocol -->
<property name="ProductTemplate">
<object>
<property name="Timeout" value="10000" /><!-- 10s -->
<!-- etc... -->
</object>
</property>
</object>
Configuration parser incoming...