Using jax-ws-catalog.xml for resolving imported xsd:s in wsdl
I would like to deploy a Web Service using JAX-WS 2.1 on Weblogic where the wsdl imports a schema but I would prefer to have it in another location than together with the wsdl, preferrably it should be loaded from the classpath.
I was hoping I could use jax-ws-catalog.xml to map this but I cannot seem to get Weblogic to pick it up when deploying the application which then fails when the xsd cannot be found.
Maybe what I want to do is not possible and the catalog mapping is only use开发者_运维知识库d for Web Service clients, I have not found any clear documentation regarding this.
The import in the wsdl looks like this:
<xs:import namespace="com.xyz.common/1.0"
schemaLocation="com.xyz.Common.1.0.xsd" />
The jax-ws-catalog.xml placed in the WEB-INF folder looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
prefer="system">
<system systemId="com.xyz.Common.1.0.xsd"
uri="classpath:com.xyz.Common.1.0.xsd" />
</catalog>
As I said, this usage may not even be supported. I would be grateful for any pointers.
Thanks.
I think the JAX-WS jax-ws-catalog.xml
is supported if you publish your endpoint via sun-jaxws.xml
(that means via com.sun.xml.ws.transport.http.servlet.WSServletContextListener
et al). Looking at JAX-WS source code, I see that catalog is supported if one uses W3CEndpointReferenceBuilder
/ Provider.createW3CEndpointReference()
(maybe this article will give you more information).
What I suggest you to do is to start Weblogic AS in debug mode and put breakpoints on two public static parse() methods of class com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser
.
精彩评论