Thanks for the clarification, Dan.

Unfortunately, I didn't get it work using the jax-ws-catalog.xml.
It somehow seems to me that resolving the schemas for creating the services works different then resolving them for validation of incoming requests at runtime. The former worked for me using jax-ws-catalog.xml, but the latter didn't.

Anyway, I finally found the following workaround: In line 72 (cxf 2.6.0), the BusApplicationContextResolver tries to lookup a Spring Bean of type URL with the name of the schema namespace. Consequently, the following Spring config did its job

import java.net.URL;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class LocalSchemaConfig {

public static final String XMLDSIG_SYSTEM_ID = "http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd";;

        @Bean(name = LocalSchemaConfig.XMLDSIG_SYSTEM_ID)
        public URL xmldsigSchema() {
                return 
this.getClass().getResource("/META-INF/xmldsig-core-schema.xsd");
        }

}

Best regards,
Marco




On 07.05.2012 17:43, Daniel Kulp wrote:
On Monday, May 07, 2012 01:50:42 PM Marco Zapletal wrote:
Hi folks,


I would like to know how to provide a resolver for XSDs to my Web
Service endpoints. One of our service requests include a reference to
the XMLDSIG schema, which takes some time to resolve from w3.org.

I am aware of XML Catalogs and we use it at compile time for generating
JAXB classes for our schemas. However, using XML Catalogs at runtime
gave me a hard time so far. Moreover, there are now 3 copies of the
XMLDSIG in our sources - one for generating the bindings, one for the
integration tests using jetty and one for the schema validation at
runtime when the services are deployed to tomcat.

At this point, the only method is via the META-INF/jax-ws-catalog.xml thing.
I keep wanting to enhance this to allow configuring extra catalog locations
on the bus or similar to make this easier to use in OSGi or others where
relying on the classloader kind of sucks, but haven't gotten around to it.

  :-(

Patches welcome.  :-)
Dan



Thus, I would like to know whether there is the possibility to plugin a
custom resolver for the parser that is used under the hood similar to
providing a custom LSResourceResolver to a JAXP validator.

Thanks,
Marco

Reply via email to