You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Eros Dalla Lana (JIRA)" <ji...@apache.org> on 2009/07/29 18:14:15 UTC

[jira] Issue Comment Edited: (AXIS2-4447) Axis2 - ADB - xs:date tag conversion in stub throws RuntimeException - ConverterUtil.convertToString() problem

    [ https://issues.apache.org/jira/browse/AXIS2-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736684#action_12736684 ] 

Eros Dalla Lana edited comment on AXIS2-4447 at 7/29/09 9:13 AM:
-----------------------------------------------------------------

I may add there are some trouble when ConverterUtil works with xs:date object.
Problems are due to different format pattern notation between STUB and service.

Stub usually use ConverterUtil.convertToString(Date value);
this method send to the server a date follows as default pattern '-'? yyyy '-' mm '-' dd zzzzzz? 

Service usually use ConverterUtil.convertToDateTime(String source); 
this method try to translate the string follow as default pattern '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?

So, if you use ADB in order to obtain a Stub for service with Date as parameter (using axis2 both client and server side) it dosen't work, and all you can see is:
<soapenv:Text xml:lang="en-US">date string can not be less than 19 charactors</soapenv:Text> in service response.

      was (Author: sakazaki):
    I may add there are some trouble when ConverterUtil work with xs:date object.
Problems are due to different format pattern notation between STUB and service.

Stub usually use ConverterUtil.convertToString(Date value);
this method send to the server a date follows as default pattern '-'? yyyy '-' mm '-' dd zzzzzz? 

Service usually use ConverterUtil.convertToDateTime(String source); 
this method try to translate the string follow as default pattern '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?

So, if you use ADB in order to obtain a Stub for service with Date as parameter (using axis2 both client and server side) it dosen't work, and all you can see is:
<soapenv:Text xml:lang="en-US">date string can not be less than 19 charactors</soapenv:Text> in service response.
  
> Axis2 - ADB - xs:date tag conversion in stub throws RuntimeException - ConverterUtil.convertToString() problem
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-4447
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4447
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP - Workshop 10.3 - Axis2 1.4.1 - ADB Data Binding 
>            Reporter: Andrea Pacini
>
> In a schema I have the following type:
> <xs:simpleType name="dateType">
> 	<xs:restriction base="xs:date">
> 		<xs:pattern value="\d{4}-\d{2}-\d{2}"/>
> 	</xs:restriction>
> </xs:simpleType>
> When I generate the STUB (using Oracle Workshop 10.3 which points to an Axis2 1.4.1 external installation), the generated stub (ADB Data Binding) has the following source code :
> [...]
> public void setDateType(java.util.Date param){
>                             
>                                             if (org.apache.axis2.databinding.utils.ConverterUtil.convertToString(param).matches("\\d{4}-\\d{2}-\\d{2}")) {
>                                                 this.localDateType=param;
>                                             }
>                                             else {
>                                                 throw new java.lang.RuntimeException();
>                                             }
>  }
> [...]
> This method always throws RuntimeException because the ConverterUtil.convertToString() method returns a String in a different format than "yyyy-mm-dd".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.