Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25803
Modified Files:
WebServiceExporter.cs
Log Message:
Make WebServiceProxyFactory and WebServiceExporter easily customizable.
Index: WebServiceExporter.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** WebServiceExporter.cs 22 Feb 2008 16:44:47 -0000 1.30
--- WebServiceExporter.cs 24 Feb 2008 19:10:52 -0000 1.31
***************
*** 22,25 ****
--- 22,26 ----
using System;
+ using System.Globalization;
using System.Collections;
using System.Reflection;
***************
*** 62,66 ****
#region Fields
! private Type webServiceBaseType = typeof(WebService);
private string _targetName;
private string _description;
--- 63,67 ----
#region Fields
! private Type _webServiceBaseType = typeof(WebService);
private string _targetName;
private string _description;
***************
*** 71,78 ****
private IDictionary _memberAttributes = new Hashtable();
! private string objectName;
! private IObjectFactory objectFactory;
! private Type proxyType;
! private ConstructorInfo proxyConstructor;
#endregion
--- 72,89 ----
private IDictionary _memberAttributes = new Hashtable();
! /// <summary>
! /// The name of the object in the factory.
! /// </summary>
! protected string objectName;
!
! /// <summary>
! /// The owning factory.
! /// </summary>
! protected IObjectFactory objectFactory;
!
! /// <summary>
! /// The generated web service wrapper type.
! /// </summary>
! protected Type proxyType;
#endregion
***************
*** 99,104 ****
public Type WebServiceBaseType
{
! get { return webServiceBaseType; }
! set { webServiceBaseType = value; }
}
--- 110,115 ----
public Type WebServiceBaseType
{
! get { return _webServiceBaseType; }
! set { _webServiceBaseType = value; }
}
***************
*** 247,256 ****
// no sense to call this method, because the web service type
// will be instantiated by the .NET infrastructure. (ObjectType is used instead)
! if (proxyConstructor == null)
! {
! proxyConstructor = proxyType.GetConstructor(Type.EmptyTypes);
! }
!
! return proxyConstructor.Invoke(ObjectUtils.EmptyObjects);
}
--- 258,264 ----
// no sense to call this method, because the web service type
// will be instantiated by the .NET infrastructure. (ObjectType is used instead)
! // Users should use GetObject("TargetName") instead.
! return new InvalidOperationException(
! "The web service instance is created and managed by the .NET infrastructure.");
}
***************
*** 317,321 ****
#region Protected Methods
! protected void ValidateConfiguration()
{
if (TargetName == null)
--- 325,332 ----
#region Protected Methods
! /// <summary>
! /// Validates the configuration.
! /// </summary>
! protected virtual void ValidateConfiguration()
{
if (TargetName == null)
***************
*** 325,333 ****
}
! protected void GenerateProxy()
{
IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace);
! builder.Name = this.objectName;
! builder.BaseType = webServiceBaseType;
builder.TargetType = objectFactory.GetType(TargetName);
if (Interfaces != null && Interfaces.Length > 0)
--- 336,347 ----
}
! /// <summary>
! /// Generates the web service wrapper type.
! /// </summary>
! protected virtual void GenerateProxy()
{
IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace);
! builder.Name = objectName;
! builder.BaseType = WebServiceBaseType;
builder.TargetType = objectFactory.GetType(TargetName);
if (Interfaces != null && Interfaces.Length > 0)
|