K-Mile
07-26-2007, 08:01 PM
Hi,
I've been trying to create webservices that accept objects that have complex types as members, and even abstract types, since our application relies heavily on them. What we need is a way to enable communications in these objects (so we need to resolve the concrete class, but that's what '__type' is for, right?).
As seen in http://ajax.asp.net/docs/mref/T_System_Web_Script_Services_GenerateScriptTypeAtt ribute.aspx
this should be doable, as long as we can attach the attribute to the webservice proxy. This should be easy to do with spring:
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
<expression value="@[GenerateScriptTypeAttribute(typeof(MyCustomClass))]"/>
</list>
</property>
I've also tried the T() way of inserting the type, instead of typeof()...
I have been going through the ASP.NET AJAX source to figure out how they resolve the types internally, but this code is totally not extensible. But I'm pretty sure the attribute above should do the trick, however...
I've been getting 'Value should not be null, property name type' errors, no matter how I implement the attribute loading (expression, object instantiation, downright adding the attribute to my service)
Does anyone have any insights, or has this working?
Thanks!
I've been trying to create webservices that accept objects that have complex types as members, and even abstract types, since our application relies heavily on them. What we need is a way to enable communications in these objects (so we need to resolve the concrete class, but that's what '__type' is for, right?).
As seen in http://ajax.asp.net/docs/mref/T_System_Web_Script_Services_GenerateScriptTypeAtt ribute.aspx
this should be doable, as long as we can attach the attribute to the webservice proxy. This should be easy to do with spring:
<property name="TypeAttributes">
<list>
<object type="System.Web.Script.Services.ScriptServiceAttribute, System.Web.Extensions"/>
<expression value="@[GenerateScriptTypeAttribute(typeof(MyCustomClass))]"/>
</list>
</property>
I've also tried the T() way of inserting the type, instead of typeof()...
I have been going through the ASP.NET AJAX source to figure out how they resolve the types internally, but this code is totally not extensible. But I'm pretty sure the attribute above should do the trick, however...
I've been getting 'Value should not be null, property name type' errors, no matter how I implement the attribute loading (expression, object instantiation, downright adding the attribute to my service)
Does anyone have any insights, or has this working?
Thanks!