Am Donnerstag, den 10.04.2008, 23:08 +0200 schrieb
[EMAIL PROTECTED]:

> It works just fine until I realize that I want to import XSD schemas
> in my
> WSDLs to allow validation of the SOAP requests.
> Now, I have several webservices sharing XSDs (one entity model for
> several
> services and so on) so I don't want to package the XSDs in the JAR
> that
> contains the implementation code and the WSDL for the actual service.

I would reconsider.  Just because the XSDs are there does not mean that
you have to maintain them in separate places, only that they need to get
copied there when you create the WAR file.  It would certainly speed
things up and reduce network traffic, no?  Since it's on localhost
(i.e., your Tomcat server) already, perhaps you can make a file system
or JAR reference anyway.

JSR-109[1] recommends placing the WSDLs and XSDs in the WEB-INF/wsdl
directory, in Section 8.2.5, "Publishing the Deployed WSDL":  "The
recommended practice is to place WSDL files referenced by a wsdlLocation
element in the Web service annotations or wsdl-
file element and their relative imported documents under the
[WEB-INF/]wsdl directory."

Further, section 4.2.12 of JSR-109 also suggests that you should be
using OASIS XML Catalogs for XSDs URI resolution.  They refer you to
Section 4.4 of the JAX-WS specification[2], which AFAICT mandates that
JAX-WS implementations like CXF send URI resolution first through the
catalog if present.

[1] http://jcp.org/aboutJava/communityprocess/mrel/jsr109/index.html
[2] http://jcp.org/en/jsr/detail?id=224



> This method totally ignores that my URI starts with 'http' it just
> assumes a
> JAR, CLASSPATH or FILESYSTEM path. This seems kind of silly? Any URL should
> be possible to resolve? 

You can check if Metro performs more to your liking in this regard:
http://www.jroller.com/gmazza/date/20071019 (I don't know personally,
I've never tested this.)

Keep in mind, a direct http:// resolution might be burdensome to
external servers not related to your company.  If I have an
EmployeeData.xsd that I have downloadable from my site, I would want you
to download it *once* and place it on your machine, not hit my machine
everytime someone requests your WSDL.  A server can't rely on everyone
properly using caching.

Regards,
Glen


Reply via email to