axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [axis2] Validating Messages :: WSDL :: <choice>
Date Fri, 07 Jul 2006 08:03:02 GMT
Since there was no reply, I'll try again...

Thanks for your time


-----Urspr├╝ngliche Nachricht-----
Gesendet: 03.07.06 14:52:54
Betreff: [axis2] Validating Messages :: WSDL :: <choice>

Hi everbody,

I encounter the following:

- specified the request-message for my service-method as the following (WSDL-File):

<xsd:element name="getSingleUserRequest">
<xsd:element ref="xsd1:kid" minOccurs="1" maxOccurs="1"/>
<xsd:element name="names" type="xsd1:names" minOccurs="1" maxOccurs="1"/>

where kid-Element and names-type are:

<xsd:element name="myFault" type="xsd:string"/>

<xsd:complexType name="names">
<xsd:element name="sn" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="givenname" type="xsd:string" minOccurs="0" maxOccurs="1"/>

As using the <choice>-keyword I exspect the request being just a 'kid'-element OR a

- I use doc/lit style for the SOAP-messages
- I now built 2 sort of clients to query the service, just to check what's going on there

a) Client using AXIOM: What I encountered here, is that I could send messages, that send 'kid'
AND 'names' AND also some other elements I like (didn't define in WSDL).
So the request is never validated against the schema. It seems, that Axis2 doens't do any
validating job.

b) Code generated client (Stubs with XMLBeans), which uses documents, that are filled before
sending over the wire:
While using this, it's clear that I can only set 'kid' and 'names' - that's what the xxxDocument-Interfaces
propose ;).
If my client sets both type 'kid' AND 'names' the request only takes the first element to
be set. So the further settings are ignored. This somehow makes sense, as <choice> accepts
only ONE of its elements.
So far, with using stubs and the XMLBeans there seems to happen some 'validation', because
of the databinding.
What I wonder about, there's no hint of the schema rejecting the second parameter.
Is this the wanted behaviour af Axis2 ?

The second question is:
Does AXIOM propose a possibilty to validate the messages?

Since using document/literal SOAP-Messages there's the general possibility to validate messages
against the schema-definition.
If Axis doens't has such a feature, I suggest placing my validating component in the MessageReceiver
- am I right ?
If I now include my 'manual' messagevalidation, I have to parse the whole message (in case
of a valid one ;) ), which then takes off the smart advantages of the pull-parsing, that is
given with AXIOM.
As I haven't implemented such a validating mechanism; I would appreciate any hints, of how
this can be done in a performant way. Do I have to use StaX (or DOM), assuming AXIOM does
not provide such techniques.

I hope I made myself somehow clear...

Thanks for any advice

Mit WEB.DE iNews werden Sie ├╝ber die Ergebnisse der wichtigsten WM-Begegnungen
per SMS informiert:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message