axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gogon (JIRA)" <>
Subject [jira] [Created] (AXIS2-5575) ConverterUtil.convertToToken method can't handle String value with trailing spaces
Date Sat, 18 May 2013 04:25:15 GMT
Gogon created AXIS2-5575:

             Summary: ConverterUtil.convertToToken method can't handle String value with trailing
                 Key: AXIS2-5575
             Project: Axis2
          Issue Type: Bug
          Components: databinding
    Affects Versions: 1.6.2
         Environment: Windows 7
            Reporter: Gogon
            Priority: Minor

I used wsdl2java.bat to generate client class from wsdl and xsd. The xsd contains token type

In my application, I used the client class to call the webservice and I got this error:

org.apache.axis2.AxisFault: data=[ENG ]
	at org.apache.axis2.AxisFault.makeFault(
	at com.example.MyWebServiceStub.fromOM(
Caused by: java.lang.IllegalArgumentException: data=[ENG ]
	at org.apache.axis2.databinding.types.Token.<init>(
	at org.apache.axis2.databinding.utils.ConverterUtil.convertToToken(
	at com.example.MyWebServiceStub$Transaction$Factory.parse(

The error is in this line inside the


The element value retrieved from webservice contains String value with trailing spaces ("ENG
"). What I can understand is the class tried to convert the String value to Token for generating
response, but since Token doesn't accept trailing spaces so that's why it throws error.

Meanwhile, to fix this problem, I added trim() to the code:


This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message