users@jax-ws.java.net

Re: turning on JAXB validation inside of JAX-WS endpoint

From: Mark Hansen <mark_at_javector.com>
Date: Fri, 17 Mar 2006 11:08:02 -0500

Thanks Doug.

Yes, I have actually written such a handler to experiment with this.
What I want to do is validate the incoming SOAP request agains the
WSDL. The basic idea of my handler is to strip the schema elements out
of the WSDL and use these to create a JAXP Validator. Is that what you
are suggesting?

One problem with this approach is that my code needs to know where to
find the WSDL. For a servlet endpoint, if I package the WSDL in the
/WEB-INF, I can get to it from WebServiceContext --> MessageContext -->
ServletContext. But, how do I get to it if its an EJB endpoint and the
WSDL is packaged in an EJB-JAR? Or what if the WSDL isn't packaged, but
rather generated from the annotations by the JAX-WS runtiem? Maybe my
handler can use the http://<endpoint>?wsdl convention, but that is not a
JAX-WS standard, and it assumes that the handler can figure out the URL
where its endpoint has been deployed.

Any suggestions you have would be appreciatied. Thanks.

-- Mark

Doug Kohlert wrote:

> No, this was a goal of the spec that we were not able to achieve
> in this version. You can certainly write a handler and use JAXP to
> do the validation.
>
> Mark Hansen wrote:
>
>> With a JAXB Marshaller or Unmarshaller, I can use the
>> setSchema(javax.xml.validation.Schema schema) method to turn on
>> validation and have JAXB validate against the provided schema.
>>
>> How can I do something similar on a JAX-WS endpoint (or a client,
>> i.e., BindingProvider). Is it possible?
>> The JAX-WS 2.0 specification (Chapter 1, Section 1.1) says:
>>
>> "JAX-WS 2.0 will allow full use of JAXB provided facilities including
>> binding customization and optional schema validation."
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>>
>