users@jax-ws.java.net

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

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Fri, 17 Mar 2006 09:16:30 -0800

Mark,
Yes that is what I am suggesting. Unfortunately, we don't have
the infrastructure to provide access to the WSDL so there is no
standard way to get at it. You will probably need to write on
handler per endpoint and it will have to know what the schema is.
If you control the client and or endpoint, they could set a property
in the context pointing to the WSDL and then your handler could pick
it up. I am not sure that helps you with EJB endpoints.

Mark Hansen wrote:

> 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
>>>
>>
>
> ---------------------------------------------------------------------
> 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
>

-- 
Doug Kohlert
Java Software Division
Sun Microsystems, Inc.
phone: 503 345-9806