fspirit
02-13-2007, 11:56 AM
Hi All!
I'm trying to expose a PONO like:
public class CustomerService : ICustomerService
{
IStorage<Customer> m_storage;
public CustomerService( IStorage<Customer> m_storage )
{
this.m_storage = m_storage;
}
public Customer Get( long id )
{
return (Customer) m_storage.Get( id );
}
}
as WebService, but Customer is an abstract class and actual return objects will be Individual or Organization.
If it was a common WebService i would use XmlInclude arttribute like:
[WebMethod()]
[XmlInclude(typeof(Individual)), XmlInclude(typeof(Organization))]
public Customer Get( long id )
{
return (Customer) m_storage.Get( id );
}
what can i use when exposing such an object by the means of Spring.NET?
there's an example like:
<object id="HelloWorldExporter" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="HelloWorld"/>
<property name="Namespace" value="http://myCompany/services"/>
<property name="Description" value="My exported HelloWorld web service"/>
<property name="MemberAttributes">
<dictionary>
<entry key="HelloWorld">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="My Spring-configured HelloWorld method."/>
<property name="MessageName" value="ZdravoSvete"/>
</object>
</entry>
</dictionary>
</property>
</object>
but i need smth, that looks similar to:
<object id="CustomerWebService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="CustomerService"/>
<property name="Namespace" value="http://Prototype/WebServices"/>
<property name="Description" value="Prototype Web Service"/>
<property name="MemberAttributes">
<dictionary>
<entry key="Get">
<list>
<object type="System.Xml.Serialization.XmlIncludeAttribute, System.Xml">
<constructor-arg index="0" expression=""/>
</object>
<object type="System.Xml.Serialization.XmlIncludeAttribute, System.Xml">
<constructor-arg index="0" expression=""/>
</object>
</list>
</entry>
</dictionary>
</property>
</object>
I just dont khow howto specify params of type [System.Type]. Can anyone help?
I'm trying to expose a PONO like:
public class CustomerService : ICustomerService
{
IStorage<Customer> m_storage;
public CustomerService( IStorage<Customer> m_storage )
{
this.m_storage = m_storage;
}
public Customer Get( long id )
{
return (Customer) m_storage.Get( id );
}
}
as WebService, but Customer is an abstract class and actual return objects will be Individual or Organization.
If it was a common WebService i would use XmlInclude arttribute like:
[WebMethod()]
[XmlInclude(typeof(Individual)), XmlInclude(typeof(Organization))]
public Customer Get( long id )
{
return (Customer) m_storage.Get( id );
}
what can i use when exposing such an object by the means of Spring.NET?
there's an example like:
<object id="HelloWorldExporter" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="HelloWorld"/>
<property name="Namespace" value="http://myCompany/services"/>
<property name="Description" value="My exported HelloWorld web service"/>
<property name="MemberAttributes">
<dictionary>
<entry key="HelloWorld">
<object type="System.Web.Services.WebMethodAttribute, System.Web.Services">
<property name="Description" value="My Spring-configured HelloWorld method."/>
<property name="MessageName" value="ZdravoSvete"/>
</object>
</entry>
</dictionary>
</property>
</object>
but i need smth, that looks similar to:
<object id="CustomerWebService" type="Spring.Web.Services.WebServiceExporter, Spring.Web">
<property name="TargetName" value="CustomerService"/>
<property name="Namespace" value="http://Prototype/WebServices"/>
<property name="Description" value="Prototype Web Service"/>
<property name="MemberAttributes">
<dictionary>
<entry key="Get">
<list>
<object type="System.Xml.Serialization.XmlIncludeAttribute, System.Xml">
<constructor-arg index="0" expression=""/>
</object>
<object type="System.Xml.Serialization.XmlIncludeAttribute, System.Xml">
<constructor-arg index="0" expression=""/>
</object>
</list>
</entry>
</dictionary>
</property>
</object>
I just dont khow howto specify params of type [System.Type]. Can anyone help?