Hello!
I have a problem if I want to share some schema files between services.

Suppose I have the following structure:

The WSDLs for MyService1 and MyService2 are in the following folders, respectively:
contextpath/WEB-INF/services/MyService1/META-INF/
contextpath/WEB-INF/services/MyService2/META-INF/

I want them to share Common.xsd: where should I put it?
If I put it here:
contextpath/WEB-INF/services/
and the xsd:import schemaLocation in the WSDLs points to "../../Common.xsd", Axis2 can find them and processes the services correctly, but when it substitutes the link to it in the WSDLs, it generates the following links:

MyService1?xsd=../../Common.xsd (in MyService1 WSDL)
MyService2?xsd=../../Common.xsd (in MyService2 WSDL)

The problem is that from an HTTP client point of view, this translates to path contextpath/Common.xsd: in fact, if you try to write the link:

http://server:8080/contextpath/services/MyService1?xsd=../../Common.xsd
a "file not found" error is given.
Another clue is that if I try to generate a client pointing to
http://server:8080/contextpath/services/MyService1?wsdl, Java2WSDL says that it cannot retrieve the schema.

By manually typing:
http://server:8080/contextpath/services/MyService1?xsd=../Common.xsd
I see that the schema can actually be found; but if I replace the xsd:import in the original WSDL so that the schemaLocation points to "../Common.xsd", then Axis2 can't find it anymore, because it searches for it in contextpath/WEB-INF/services/MyService1/ and the generation of the WSDL fails.

How to face this problem? Where should I put the shared schemas? How to reference them from within the original WSDLs?

Thanks in advance.

--
Mauro Molinari
Software Developer
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to