axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anne Thomas Manes <atma...@gmail.com>
Subject Re: rpc/literal and Schema Validation
Date Sat, 25 Feb 2006 20:08:19 GMT
WS-I allows document/literal and rpc/literal. But as I said, many systems
don't support rpc/literal, so I strongly recommend that you change your
specification to use doc/literal instead. If you use the "wrapped"
convention with doc/literal, the messages on the wire and the programming
model are virtually identical to rpc/literal, and you can do validation.

In other words, use wrapped doc/literal.

Anne

On 2/25/06, Rakesh Sanghvi <rakesh.sanghvi@gmail.com> wrote:
>
> Hi Anne
>
>  i think i was doing mistake in my dev. i got it that we can't validate
> input. I got it from your reply that we should avoid to use rpc/literal. but
> we are implementing WS-I profile and according to specification we must have
> to implement rpc/literal. it would be great if you explain which is the best
> solution for validating xml input.
>
> Thanks for your help..
> Rakesh
>
>
> On 2/24/06, Rakesh Sanghvi <rakesh.sanghvi@gmail.com> wrote:
> >
> > Hi Anne
> >
> > Thanks for your valuable reply.
> > Let me explain  in detail...
> >
> > Example:-
> > <xsd:element name="radius" >
> >
> >      <xsd:simpleType>
> >
> >                <xsd:restriction base="xsd:float">
> >
> >                   <xsd:minInclusive value="0.05"/>
> >
> >                  <xsd:maxInclusive value="1.0"/>
> >
> >              </xsd:restriction>
> >
> >    </xsd:simpleType>
> >
> > </xsd:element>
> > if radius element value is not between 0.05 to 1.0 i believe Axis should
> > throw an error. let me know if my understanding is wrong..
> >
> > Thanks
> > Rakesh
> >
> >  On 2/24/06, Anne Thomas Manes <atmanes@gmail.com > wrote:
> > >
> > > Rakesh,
> > >
> > > Axis never automatically performs schema validation, although it will
> > > throw an error if it encounters an element or type that it doesn't expect
> > > when parsing the message. This is true whether you are using doc/lit,
> > > rpc/lit, or rpc/encoded.
> > >
> > > If you would like to add a validation process, then your best bet is
> > > to use doc/lit because you have the schema of the full payload. When using
> > > rpc/lit, you don't have the schema for the full payload, so instead you must
> > > validate each accessor element (the parameters) based on its type
> > > definition. It's very difficult to validate rpc/encoded because even the
> > > types might be changed during the encoding and yet it's still valid based on
> > > the SOAP Encoding datamodel.
> > >
> > > In any case, quite a few SOAP implementations don't support
> > > rpc/literal, so I suggest you not use it. Use wrapped doc/literal instead.
> > > Wrapped doc/literal provides the same programming experience as rpc/literal,
> > > it supports easier validation, and it gives you much better
> > > interoperability.
> > >
> > > I'm not sure why you're thinking that JAXB will help you here. (Are
> > > you perhaps under the common misconception that Axis won't map doc/literal
> > > to Java objects for you? It does.)
> > >
> > > I think it's much easier to use the built-in Axis serialization system
> > > than to use JAXB. (Axis 2 supports a much more pluggable serialization
> > > framework, but not so with Axis 1.) If you want to use an external
> > > serialization framework, then I suggest xmlbeans rather than JAXB. Google
> > > "Axis" and "xmlbeans", and I'm sure you'll find plenty of resources to help
> > > you.
> > >
> > > Anne
> > >
> > > On 2/24/06, Rakesh Sanghvi <rakesh.sanghvi@gmail.com > wrote:
> > > >
> > > > Hi
> > > >
> > > > Just want to confirm if i implemented my WSDL SOAP binding as
> > > > rpc/litteral then I believe Schema validation will not happened
> > > > automatically.
> > > >
> > > > if it is true then will it JAXB will be fine for validating SOAP
> > > > request against schema.  Let me know if any good suggestion.
> > > >
> > > > Thanks
> > > > Rakesh
> > > >
> > > >
> > > >
> > >
> > >
> >
>

Mime
View raw message