You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Ricky Ho <ri...@cisco.com> on 2002/09/12 19:39:22 UTC

Re: Feature request - WSDL2Java - enforcing Schema - restrictions

Adding the constraint seems will make WSDL2Java more complex and duplicate 
what JAXB is doing.

I think AXIS can support Schema Validation using another approach rather 
than at the generated Java code.  Here is one possibility ...
1) Add an inbound request handler to validate the incoming XML message 
based on XML schema.  Throw an exception if the validation fails
2) Add an outbound response handler to validate the outgoing XML message 
based on XML schema.  Throw an exception if the validation fails

This works well in literal encoding, but may be challenging in SOAP 
encoding which use "reference" extensively.

Best regards,
Ricky

At 05:05 PM 9/12/2002 +0200, Jesper Söderlund wrote:
>Wouldn't it be really cool if Axis supported the XML Schema constraints 
>that you can specify in you WSDL-file during WSDL2Java generation? That 
>would really fulfill the vision of WebService programming, define your 
>constrains on a logical level and then generate an API that enforces these 
>so that you WebService doesn't have to deal with all that error checking 
>which we all know can take up the bulk of your code.
>
>I don't think that a simple implementation would be that hard. It seems 
>that you should be able to save the schema into the WSDL2Java generated 
>files and then use that to verify the SOAP-message (letting the XML-parser 
>do the job) when it arrives at the server. Sure it might not give you a 
>very detailed error message, beeing limited to what the SAX-parser would 
>emitt as an error text but it beats not having any checks.
>
>Are there any Axis developers out there that has any oppions on the topic? 
>Any user seconding this request?
>
>Regards,
>/Jesper

Re: Feature request - WSDL2Java - enforcing Schema - restrictions

Posted by Steve Loughran <st...@iseran.com>.

Of course, JAXB doesnt do anything useful with Schema in its current
implementation.

Castor serialisers do validate inbound and outbound XML against their
schema, I have Oliver Brands stuff that I will slip into Axis at some point
in the near future, once I've played with it some more.

----- Original Message -----
From: "Ricky Ho" <ri...@cisco.com>
To: <ax...@xml.apache.org>
Sent: Thursday, September 12, 2002 10:39 AM
Subject: Re: Feature request - WSDL2Java - enforcing Schema - restrictions


Adding the constraint seems will make WSDL2Java more complex and duplicate
what JAXB is doing.

I think AXIS can support Schema Validation using another approach rather
than at the generated Java code.  Here is one possibility ...
1) Add an inbound request handler to validate the incoming XML message
based on XML schema.  Throw an exception if the validation fails
2) Add an outbound response handler to validate the outgoing XML message
based on XML schema.  Throw an exception if the validation fails

This works well in literal encoding, but may be challenging in SOAP
encoding which use "reference" extensively.

Best regards,
Ricky

At 05:05 PM 9/12/2002 +0200, Jesper Söderlund wrote:
>Wouldn't it be really cool if Axis supported the XML Schema constraints
>that you can specify in you WSDL-file during WSDL2Java generation? That
>would really fulfill the vision of WebService programming, define your
>constrains on a logical level and then generate an API that enforces these
>so that you WebService doesn't have to deal with all that error checking
>which we all know can take up the bulk of your code.
>
>I don't think that a simple implementation would be that hard. It seems
>that you should be able to save the schema into the WSDL2Java generated
>files and then use that to verify the SOAP-message (letting the XML-parser
>do the job) when it arrives at the server. Sure it might not give you a
>very detailed error message, beeing limited to what the SAX-parser would
>emitt as an error text but it beats not having any checks.
>
>Are there any Axis developers out there that has any oppions on the topic?
>Any user seconding this request?
>
>Regards,
>/Jesper