How to specify a package name when generating java classes from a WSDL with wsconsume.sh
Issue
In the following WSDL, which references an external schema types.xsd, I would like to set the java package name to com.acme.bar for the types defined in types.xsd, and com.acme.foo for all other classes. However, using the -p option with JBOSS_HOME/bin/wsconsume.sh changes the package name for all generated classes, which does not meet this requirement. How can I specify a different package name specifically for the externally referenced schema?
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://soap.example.gss.redhat.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ExampleService"
targetNamespace="http://soap.example.gss.redhat.com/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://soap.example.gss.redhat.com/">
<xsd:import namespace="http://soap.example.gss.redhat.com/" schemaLocation="types.xsd"/>
</xsd:schema>
</wsdl:types>
...
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 8
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.