views:

12

answers:

0

All we are using web services. I want to send generic result from my function as a result. I can set its return type as an object type. I wonder that, can i create(generate) xml schema of my return type runtime?

for ex:

 [Serializable]
 class NewClass{}

 [Serializable]
 class OldClass{}

 [WebMethod]        
 public object fFunctionName(){ 

    object returnObject;

    // create result from 
    if(bla == bla)
      returnObject = new NewClass();
    else
      returnObject = new OldClass();

    // and do something to create xml schema for returnObject
    // and attach to the result of this web method
 }

Is there any way to send every object which has Serializable attribute of its type?