I do not think you can do this directly, one trick is to define a any
content for the type, so you can put your additional data there.
However web services usally check the type of parameter and I do not
think it will accept a sub type.


In my opinion Web services are not an effort to implement ditributed
OOP, you can not and should not expect all oop concept applicable.
With web services you have to think in terms of services and messages,
not in terms of objects.

Thanks
Srinath

On 10/31/06, Muzaffer Ozakca <[EMAIL PROTECTED]> wrote:
Hello all,

I'm new to this list and to WSDL, web services, axis, xsd, xml, soap,
etc. I'm a total newbie. I'm trying to do a few things over web services
that are usually taken for granted by OO programmers. I have a class
hierarchy, say:
O (abstract base)
O1, O2, O3 (extends O)

I define a web service that provides such a service:
getItem(String id) that returns "O".
But "O" is actually one if O1, O2 or O3. If this was an OO language, I
could say:

if O is actually an O1, type cast it to O1,
if O is actually an O2, type cast it to O2,
etc.

My question is then is this possible with web services? I.e. Can it
return subtypes? I generated a WSDL that includes a definition for "O"
that looks like:

   <complexType abstract="true" name="Item">
     <sequence>
      <element name="ID" nillable="true" type="soapenc:string"/>
      <element name="lastMod" nillable="true" type="xsd:dateTime"/>
      <element name="metadata" nillable="true" type="tns2:Mets"/>
      <element name="relatedItems" nillable="true"
type="impl:ArrayOfItemId"/>
      <element name="status" nillable="true" type="xsd:anyType"/>
     </sequence>
    </complexType>

I hope I'm clear enough. Is there a way to generate WSDL from the
subtypes? I should probably try to try this out but I was wondering if
you have any ideas.

Thanks,
Muzaffer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
============================
Srinath Perera:
  Indiana University, Bloomington
  http://www.cs.indiana.edu/~hperera/
  http://www.bloglines.com/blog/hemapani

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to