[AXIS][WSDL] Type abstraits, Gestion du polymorphisme ?
Bonjour,
Je developpe un webservice a l'aide d'AXIS et d'eclipse sur un serveur tomcat.
Mon soucis est le suivant:
J'ai defini une structure de donnees suivante:
- TypeParent (abstract=true)
--- TypeFils
--- TypeFille
Je manipule des types fils et fille qui ont une classe mere abstraite (TypeParent)
Le soucis, c'est que j'utilise mon type abstrait comme parametre pour certaines operations. De cette facon, je peux choisir d'envoyer l un des deux sous type a mon webservice (TypeFils ou TypeFille).
J'ai genere un client proxy, j ai cree un appel a mon operation en lui passant en parametre l un des deux sous types.
Seulement, lorsque mon client genere le message soap, le type transmis est le TypeParent. Apparement, Axis ne permet pas de gerer les types abstraits (alors que XML Schema prevoit cette possibilité). Par contre, je ne sais pas si passer un type abstrait en parametre d une operation est correct (apparement oui d'apres ce document : http://www-128.ibm.com/developerwork...xsdchoice.html )
ou alors si c'est AXIS qui n'est pas capable de gerer ce cas de figure (bug etc ...?)
Voici l'extrait de mon XSD:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<complexType name="SearchFragmentType" abstract="true">
<annotation>
<documentation>
A Search Fragment define a sequence of tests (binary
comparisons) linked by binary operator (and / Or)
</documentation>
</annotation>
</complexType>
<complexType name="SearchFragmentSequenceType">
<annotation>
<documentation>
A binary operator is a fragment of a Where clause.
It links two statements of a where clause by a binary
operator such as OR or AND.
The current statement contains a Clause (which is a
test) and the next fragment. The BinaryOperator Element
defines how are linked the current clause and the next
fragment (AND or OR)
</documentation>
</annotation>
<complexContent>
<extension base="tns:SearchFragmentType">
<sequence>
<element name="CurrentClause"
type="tns:SearchConditionClauseType" maxOccurs="1"
minOccurs="1">
</element>
<element name="NextFragment"
type="tns:SearchFragmentType" maxOccurs="1" minOccurs="1">
</element>
<element name="BinaryOperator"
type="tns:SearchBinaryOperatorType" maxOccurs="1" minOccurs="1">
</element>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="SearchConditionClauseType">
<annotation>
<documentation>
Search Clause Fragment is a comparison between a field
and a value.
</documentation>
</annotation>
<complexContent>
<extension base="tns:SearchFragmentType">
<sequence>
<element name="Comparator"
type="tns:SearchComparatorType" minOccurs="1" maxOccurs="1">
<annotation>
<documentation>
Comparison operator between the field
and the value. The field is always
compared TO the value. So, the operator
LessThan will match the rows where the
fieldname's values are less than the
submitted value.
</documentation>
</annotation>
</element>
<element name="FieldName" type="string"
maxOccurs="1" minOccurs="1">
<annotation>
<documentation>
FieldName to search. Pay attention,
fieldnames that are not defined by a
type will throw an exception.
</documentation>
</annotation>
</element>
<element name="Values" maxOccurs="unbounded"
minOccurs="1">
<annotation>
<documentation>
Value for the test. When using the Like
operator, the wildcard % can be used.
Multiples values can be tested (via OR
operator)
</documentation>
</annotation>
</element>
</sequence>
</extension>
</complexContent>
</complexType> |
Avez vous deja essayé de travailler avec le polymorphism avec AXIS ? est-ce possible ? si oui, y-a-t'il des preconisations particulieres, ou alors voyez vous une erreur ?
Merci :)