[
http://jira.codehaus.org/browse/XFIRE-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90003
]
Sameer Rao commented on XFIRE-902:
----------------------------------
I am facing similar error- Rought setup info
1. Using a existing WSDL to expose a service. (i.e. using wsdlURL in the
serviceBean)
2. WSDL imports multiple schemas (using relative path). Call these
service-level schemas
3. The Service schemas internally import other schemas...(Domain schemas).
Project structure-
MyWebServicePrj +
+ web +
+ META-INF/xfire +
+
services.xml
+ WEB-INF +
+ classes
+ MyWebService.WSDL
+ schema +
+
ServiceSchema-1.xsd
+
ServiceSchema-2.xsd
+
DomainSchema-A.xsd
+
DomainSchema-B.xsd
+
DomainSchema-C.xsd
+
DomainSchema-D.xsd
The entry in services.xml for the wsdl looks like-
<wsdlURL>WEB-INF/MyWebService.wsdl</wsdlURL>
The import in the MyWebService.wsdl looks like-
<import ... schemaLocation=schema/ServiceSchema-1.xsd/>
<import ... schemaLocation=schema/ServiceSchema-2.xsd/>
The imports in the ServiceSchemas look like-
<import ... schemaLocation=DomainSchema-A.xsd/>
<import ... schemaLocation=DomainSchema-B.xsd/>
<import ... schemaLocation=DomainSchema-C.xsd/>
<import ... schemaLocation=DomainSchema-D.xsd/>
These import in the Serviceschemas are relative and since all schemas are in
the same folder, the above import should work.
But it seems that XFire uses the same BaseURI to resolve all the relative urls.
Instead shouldn't it resolve relative URL based on what is the URI of the
current resource. So when its processing a imported service schema the relative
URL should be able to handle and load schemas present in the same folder.
> ResolverWSDLLocator cannot find external xsd
> --------------------------------------------
>
> Key: XFIRE-902
> URL: http://jira.codehaus.org/browse/XFIRE-902
> Project: XFire
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.2.4
> Environment: tomcat 5.5, sun jvm 1.5.0_10
> Reporter: Jeroen Verellen
> Assigned To: Dan Diephouse
> Priority: Minor
> Attachments: ObjectServiceFactory.txt, Resolver.txt,
> ResolverWSDLLocator.txt, ResourceWSDL.txt
>
>
> I have a wsdl document which uses external xsd elements via an import
> statement.
> My service configuration looks like:
> <service>
> <name>MCMDemandV1</name>
> <serviceBean>#mcmDemandServiceV1</serviceBean>
> <serviceFactory>#jaxbServiceFactory</serviceFactory>
> <schemas>
> <schema>xsd/common/RequestReplyTemplateV1.xsd</schema>
> <schema>xsd/mcm/DemandV1.xsd</schema>
> </schemas>
> <wsdlURL>classpath:wsdl/mcm/DemandV1.wsdl</wsdlURL>
> <inHandlers>
> <handler
>
> handlerClass="be.securex.ws.xfire.JaxbValidationEnablingHandler" />
> </inHandlers>
> <faultHandlers>
> <handler
>
> handlerClass="be.securex.ws.xfire.JaxbValidationFaultHandler" />
> </faultHandlers>
> </service>
> When I do not set the wsdl url the server starts and xsd validation works, but
> the wsdl generation does not give a WS-I compliant wsdl.
> When I start up the server with the wsdlurl I get the following:
> Retrieving document at 'null'.
> Retrieving schema at '../../xsd/mcm/DemandV1.xsd'.
> 2007-02-26 13:34:04,953 [main] WARN
> org.codehaus.xfire.wsdl11.ResolverWSDLLocator - Source:
> ../../xsd/mcm/DemandV1.xsd failed to find input source with exception:
> java.io.IOException: Could not find resource '../../xsd/mcm/DemandV1.xsd
> at org.codehaus.xfire.util.Resolver.<init>(Resolver.java:53)
> at
> org.codehaus.xfire.wsdl11.ResolverWSDLLocator.getImportInputSource
> (ResolverWSDLLocator.java:72)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> ...
> And a bit further:
> 2007-02-26 13:34:04,984 [main] ERROR
> org.codehaus.xfire.transport.http.XFireServlet - Error initializing
> XFireServlet.
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'org.codehaus.xfire.spring.ServiceBean' defined in class path
> resource
> [META-INF/xfire/services.xml]: Initialization of bean failed; nested exception
> is org.codehaus.xfire.XFireRuntimeException: Could not load WSDL.. Nested
> exception is
> javax.wsdl.WSDLException: WSDLException (at
> /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: Unable to
> locate with a locator the schema referenced at '../../xsd/mcm/DemandV1.xsd'
> relative to document base 'null'
> org.codehaus.xfire.XFireRuntimeException: Could not load WSDL.. Nested
> exception
> is javax.wsdl.WSDLException: WSDLException (at
> /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: Unable to
> locate with a locator the schema referenced at '../../xsd/mcm/DemandV1.xsd'
> relative to document base 'null'
> WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema):
> faultCode=OTHER_ERROR: Unable to locate with a locator the schema referenced
> at
> '../../xsd/mcm/DemandV1.xsd' relative to document base 'null':
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> ...
> I changed some code so that the wsdl is allowed to point to external xsd
> files. Patches are attached.
> regards,
> jeroen
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email