Skip to content

Allow alternative schema location in XsdBasedSoap11Wsdl4jDefinitionBuilder [SWS-104] #259

Closed
@gregturn

Description

@gregturn

Aleksei Valikov opened SWS-104 and commented

I am using XsdBasedSoap11Wsdl4jDefinitionBuilder to generate WSDL for my schema.
The schema itself imports another schema via a relative path:

<xsd:import namespace="https://hyperjaxb2.dev.java.net/pows/po/schema" schemaLocation="../../po/schema/po.xsd"/>

The WSDL itself is generated quite fine. However the schema itself is simply inserted into wsdl:types while schemaLocation in xsd:import remains the same. However, this location, when resolved against the wsdl location, points to an invalid URL.

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions ...>
wsdl:types
<xsd:schema ...>
...
<xsd:import namespace="https://hyperjaxb2.dev.java.net/pows/po/schema" schemaLocation="../../po/schema/po.xsd"/>
...
</xsd:schema>
</wsdl:types>
...
</wsdl:definitions>

This problem can be easily resolved if instead of inserting the whole schema in wsdl:types we simply insert an xsd:schema with xsd:import pointing to the location of the actual schema. This location can be configured in the wsdl builder:

<wsdl:definitions ...>
wsdl:types
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="https://hyperjaxb2.dev.java.net/pows/ws/schema"
schemaLocation="resources/ws/schema/ws.xsd"/>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>

I have implemented this solution based on the XsdBasedSoap11Wsdl4jDefinitionBuilder. Could you please review the code and maybe add this to the main code base.


Affects: 1.0 M3

Attachments:

Issue Links:

Referenced from: commits fcdcf61

6 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions