Reputation: 12538
I'm trying to generate a Java Client with the axis using wsdl2java
(wrapped by the maven axistools).
I downloaded the wsdl and the corresponding schema.
The wsdl has the following schema definitions:
<wsdl:types>
<xsd:schema
targetNamespace="http://example.com/CM_IntegrationService/"
xmlns:pref="http://example.com/CM_IntegrationService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://example.com//CM_IntegrationService"
schemaLocation="CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd"/>
In short:
schemaLocation="CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd"
The error shows as:
[ERROR] Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default) on project wsclient-cm: Error generating Java code from WSDL. error running file:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl:
WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd', relative to 'file:/C:/workspace/ws/wsclient-reactor/shop-wsclient-wsdl/src/main/wsdl/CM_IntegrationService.wsdl'.:
This file was not found: file:/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd -> [Help 1]
In short file not found for:
/C:/workspace/ws/wsclient-reactor/wsclient-wsdl/src/main/wsdl/CM_IntegrationService?xsd=ServiceModel_CM_IntegrationService.xsd
Is there a way to specify which schema to use? I saved the schema as ServiceModel_CM_IntegrationService.xsd
. However its searching for the full path including =
and ?
which I cannot emulate on the file system.
I don't want to modify the wsdl as suggested in: WSDL to Java -client creation error
Why is axistools-maven-plugin trying to access this relative schema location? looks similar however using the useEmitter=true
option didn't help.
Upvotes: 1
Views: 1823
Reputation: 9154
This is currently not possible without modifying the WSDL. Doing this without modifying the WSDL (BTW, why don't you want to do that?) would require support for XML catalogs, as described in AXIS-1984.
Upvotes: 1