Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17806
Modified Files:
WebServiceExporter.cs
Log Message:
Allow web service base type to be configurable in WebServiceExporter. Added tests.
Added tests for the same feature in WebServiceProxyFactory (already implementated).
Index: WebServiceExporter.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** WebServiceExporter.cs 3 Dec 2007 09:07:43 -0000 1.27
--- WebServiceExporter.cs 7 Dec 2007 15:44:01 -0000 1.28
***************
*** 62,65 ****
--- 62,66 ----
#region Fields
+ private Type webServiceType = typeof(WebService);
private string _targetName;
private string _description;
***************
*** 91,94 ****
--- 92,107 ----
/// <summary>
+ /// Gets or sets the base type that web service should inherit.
+ /// </summary>
+ /// <remarks>
+ /// Default is <see cref="System.Web.Services.WebService"/>
+ /// </remarks>
+ public Type WebServiceType
+ {
+ get { return webServiceType; }
+ set { webServiceType = value; }
+ }
+
+ /// <summary>
/// Gets or sets the name of the target object that should be exposed as a web service.
/// </summary>
***************
*** 230,234 ****
/// this factory.
/// </returns>
! public object GetObject()
{
// no sense to call this method, because the web service type
--- 243,247 ----
/// this factory.
/// </returns>
! public virtual object GetObject()
{
// no sense to call this method, because the web service type
***************
*** 247,251 ****
/// <see langword="null"/> if not known in advance.
/// </summary>
! public Type ObjectType
{
get { return (proxyType != null ? proxyType : objectFactory.GetType(TargetName)); }
--- 260,264 ----
/// <see langword="null"/> if not known in advance.
/// </summary>
! public virtual Type ObjectType
{
get { return (proxyType != null ? proxyType : objectFactory.GetType(TargetName)); }
***************
*** 255,259 ****
/// Is the object managed by this factory a singleton or a prototype?
/// </summary>
! public bool IsSingleton
{
get { return false; }
--- 268,272 ----
/// Is the object managed by this factory a singleton or a prototype?
/// </summary>
! public virtual bool IsSingleton
{
get { return false; }
***************
*** 316,319 ****
--- 329,333 ----
IProxyTypeBuilder builder = new WebServiceProxyTypeBuilder(TargetName, Description, Name, Namespace);
builder.Name = this.objectName;
+ builder.BaseType = webServiceType;
builder.TargetType = objectFactory.GetType(TargetName);
if (Interfaces != null && Interfaces.Length > 0)
***************
*** 355,361 ****
// Creates a WebServiceAttribute from configuration info
this.webServiceAttribute = CreateWebServiceAttribute(description, name, ns);
-
- // Optional
- BaseType = typeof(WebService);
}
--- 369,372 ----
|