misterstick
Programmer
i have a web service which marshalls arrays of custom data objects.
you can't pass complex list types across a web service (and rightly so) so the web service unpacks these into simple arrays on the server side.
what i'd like to do is create calls on the client side which wrap these simple arrays in complex lists.
because i'm too lazy and stupid to replicate the code, i'd still like to keep the asynchronous calls, so i've derived a wrapper object from the microsoft provided service object.
however, this makes the "real" web service calls available in code.
is there any way i can hide these calls?
i'd like to force developers to use the methods that return complex lists instead of ones that return simple arrays.
any ideas?
MTIA,
mr s. <
you can't pass complex list types across a web service (and rightly so) so the web service unpacks these into simple arrays on the server side.
what i'd like to do is create calls on the client side which wrap these simple arrays in complex lists.
because i'm too lazy and stupid to replicate the code, i'd still like to keep the asynchronous calls, so i've derived a wrapper object from the microsoft provided service object.
however, this makes the "real" web service calls available in code.
is there any way i can hide these calls?
i'd like to force developers to use the methods that return complex lists instead of ones that return simple arrays.
Code:
// server side
class ComplexService : System.Web.Services.WebService
{
[WebMethod]
public ComplexObject[] GetComplexObjectsWS()
{
List<ComplexObject> list = SomeFactoryClass.ListOfComplexObject();
ComplexObject[] array = new ComplexObject[list.Count];
list.CopyTo(array);
return array;
}
}
Code:
// client side
using MicrosoftGeneratedWebServiceCode;
class ComplexWrapper : ComplexService
{
// want to hide this completely
public new ComplexObject[] GetComplexObjectsWS()
{
return base.GetComplexObjectsWS();
}
// so that developers have to use this
public List<ComplexObject> GetComplexObjects()
{
List<ComplexObject> list = new List<ComplexObject>();
ComplexObject[] array = base.GetComplexObjectsWS();
foreach ( ComplexObject complex in array )
{
list.Add(complex);
}
return list;
}
}
any ideas?
MTIA,
mr s. <