Bindings Package Customization and case sensitivity
---------------------------------------------------
Key: JBWS-1998
URL:
http://jira.jboss.com/jira/browse/JBWS-1998
Project: JBoss Web Services
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: tools-jaxws
Affects Versions: jbossws-2.0.1.SP2
Reporter: Magesh Kumar B
Priority: Trivial
When we customize the package through the bindings tag inside the wsdl and using wsconsume
the Exception wrapper is generated with the same name and causes "duplicate
class" error while compiling.
Consider the following wsdl:
<definitions name='TestEndpointService'
targetNamespace='http://org.jboss.ws/jaxws/asynchronous'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.ws/jaxws/asynchronous'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<jaxws:bindings>
<jaxws:package name="ws.jboss.org.jaXWS.asynchronous"/>
</jaxws:bindings>
<types>
<xsd:schema targetNamespace="http://org.jboss.ws/jaxws/asynchronous"
xmlns:tns="http://org.jboss.ws/jaxws/asynchronous">
<xsd:element name="Exception" type="tns:Exception"/>
<xsd:element name="echo" type="tns:echo"/>
<xsd:element name="echoResponse" type="tns:echoResponse"/>
<xsd:complexType name="echo">
<xsd:sequence>
<xsd:element minOccurs="0" name="String_1"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="echoResponse">
<xsd:sequence>
<xsd:element minOccurs="0" name="result"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Exception">
<xsd:sequence>
<xsd:element minOccurs="0" name="message"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name='TestEndpoint_echoResponse'>
<part name='echoResponse' element='tns:echoResponse'/>
</message>
<message name='TestEndpoint_echo'>
<part name='echo' element='tns:echo'/>
</message>
<message name="Exception">
<part name="Exception" element='tns:Exception'/>
</message>
<portType name='TestEndpoint'>
<operation name='echo' parameterOrder='echo'>
<input message='tns:TestEndpoint_echo'/>
<output message='tns:TestEndpoint_echoResponse'/>
<fault name="Exception" message="tns:Exception"/>
</operation>
</portType>
<binding name='TestEndpointBinding' type='tns:TestEndpoint'>
<soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='echo'>
<soap:operation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
</binding>
<service name='TestEndpointService'>
<port binding='tns:TestEndpointBinding'
name='TestEndpointPort'>
<soap:address
location='http://tdvaio:8080/jaxws-samples-asynchronous/TestEndpoint'/>
</port>
</service>
</definitions>
The generation happens like below:
parsing WSDL...
generating code...
ws\jboss\org\jaxws\asynchronous\Echo.java
ws\jboss\org\jaxws\asynchronous\EchoResponse.java
ws\jboss\org\jaxws\asynchronous\Exception.java
ws\jboss\org\jaxws\asynchronous\ObjectFactory.java
ws\jboss\org\jaxws\asynchronous\package-info.java
ws\jboss\org\jaXWS\asynchronous\Exception.java
ws\jboss\org\jaXWS\asynchronous\TestEndpoint.java
ws\jboss\org\jaXWS\asynchronous\TestEndpointService.java
I:\dev\IssueTracker\cases\161559\out4\ws\jboss\org\jaXWS\asynchronous\Exception.java:14:
duplicate class: ws.jboss.org.jaXWS.asynchronous.Exception
public class Exception
^
This is purely because of the package name containing the UPPER case characters
"jaXWS". This is very trivial but neverthless it works with the same package
name from the command line switch "-p".
%JBOSS_HOME%\bin\wsconsume -k -p ws.jboss.org.jaXWS.asynchronous -o out4 TestService.wsdl
parsing WSDL...
generating code...
ws\jboss\org\jaXWS\asynchronous\Echo.java
ws\jboss\org\jaXWS\asynchronous\EchoResponse.java
ws\jboss\org\jaXWS\asynchronous\Exception.java
ws\jboss\org\jaXWS\asynchronous\Exception_Exception.java
ws\jboss\org\jaXWS\asynchronous\ObjectFactory.java
ws\jboss\org\jaXWS\asynchronous\TestEndpoint.java
ws\jboss\org\jaXWS\asynchronous\TestEndpointService.java
ws\jboss\org\jaXWS\asynchronous\package-info.java
The generator is strict on case sensitivity on one side and ignores the case on other side
hence the error perhaps. The code for generation should be re-used rather than having
different path for different methods.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira