You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Tariq Chalabi <ta...@yahoo.co.uk> on 2007/03/02 15:28:41 UTC

Invalid gYearMonth Exception

 Hi

I've generated stub classes for a 3rd-party webservice we've installed,  
using Axis 1.4 wsdl2java.

When one of the Web Service methods is invoked, the response constains 
data of <xs:gYearMonth> - which causes the following exception:

java.lang.NumberFormatException: Invalid gYearMonth
    at 
org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
    at 
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
    at 
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
    at 
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
    at 
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
    at 
org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
    at org.apache.axis.client.Call.invoke(Call.java:2467)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)

When I switch logging on, I get the following output:

4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - 
Exit: DeserializationContext::startElement()
4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - 
Enter: DeserializationContext::endElement(http://www.qas.com/web-2006-02, 
From)
4781 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  - 
org.apache.axis.i18n.resource::handleGetObject(popHandler00)
4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - 
Popping handler org.apache.axis.encoding.ser.SimpleDeserializer@178c178c
4781 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  - 
org.apache.axis.i18n.resource::handleGetObject(badYearMonth00)
4781 [main] DEBUG org.apache.axis.utils.NSStack  - NSPop (32)
4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - 
Popped element stack to 
org.apache.axis.message.MessageElement:PicklistEntry
4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  - 
Exit: DeserializationContext::endElement()
4781 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  - 
org.apache.axis.i18n.resource::handleGetObject(exception00)

The actual data that is causing the problem is the following text: 

<qas:From>2001 (Jun)</qas:From>
          

Can anyone tell me if this is a valid gYearMonth format.

If not what format should it be in, and can I configure Axis to 
understand the given format.

Cheers

tc



   



 		
---------------------------------
 Now you can scan emails quickly with a reading pane. Get the new Yahoo! Mail.

Re: Invalid gYearMonth Exception

Posted by donald yang <do...@googlemail.com>.
as far as know, this is not valid format for gYearMonth, it should be
"yyyy-mm". The web service should send back the value that must comply with
this format. I don't know how to configure it in axis to make axis client
understand that format.

On 3/2/07, Tariq Chalabi <ta...@yahoo.co.uk> wrote:
>
>  Hi
>
> I've generated stub classes for a 3rd-party webservice we've installed,
> using Axis 1.4 wsdl2java.
>
> When one of the Web Service methods is invoked, the response constains
> data of <xs:gYearMonth> - which causes the following exception:
>
> java.lang.NumberFormatException: Invalid gYearMonth
>     at
> org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement(SimpleDeserializer.java:176)
>     at
> org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.java:502)
>     at
> org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>     at
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:171)
>     at
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
>     at
> org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
>     at
>
> org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
>     at org.apache.axis.client.Call.invoke(Call.java:2467)
>     at org.apache.axis.client.Call.invoke(Call.java:2366)
>     at org.apache.axis.client.Call.invoke(Call.java:1812)
>
> When I switch logging on, I get the following output:
>
> 4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  -
> Exit: DeserializationContext::startElement()
> 4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  -
> Enter: DeserializationContext::endElement(http://www.qas.com/web-2006-02,
> From)
> 4781 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  -
> org.apache.axis.i18n.resource::handleGetObject(popHandler00)
> 4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  -
> Popping handler org.apache.axis.encoding.ser.SimpleDeserializer@178c178c
> 4781 [main] DEBUG
>  org.apache.axis.i18n.ProjectResourceBundle  -
> org.apache.axis.i18n.resource::handleGetObject(badYearMonth00)
> 4781 [main] DEBUG org.apache.axis.utils.NSStack  - NSPop (32)
> 4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  -
> Popped element stack to
> org.apache.axis.message.MessageElement:PicklistEntry
> 4781 [main] DEBUG org.apache.axis.encoding.DeserializationContext  -
> Exit: DeserializationContext::endElement()
> 4781 [main] DEBUG org.apache.axis.i18n.ProjectResourceBundle  -
> org.apache.axis.i18n.resource::handleGetObject(exception00)
>
> The actual data that is causing the problem is the following text:
>
> <qas:From>2001 (Jun)</qas:From>
>
>
> Can anyone tell me if this is a valid gYearMonth format.
>
> If not what format should it be in, and can I configure Axis to
> understand the given format.
>
> Cheers
>
> tc
>
>
>
>
>
>  ------------------------------
> Now you can scan emails quickly with a reading pane<http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/reading_pane/*http://us.rd.yahoo.com/evt=40565/*http://uk.docs.yahoo.com/nowyoucan.html>.
> Get the new Yahoo! Mail<http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/reading_pane/*http://us.rd.yahoo.com/evt=40565/*http://uk.docs.yahoo.com/nowyoucan.html>.
>
>
>