[ 
https://issues.apache.org/jira/browse/AXIS2-5048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen resolved AXIS2-5048.
------------------------------------

    Resolution: Fixed

Applied the patch. Thanks for your contribution.

> Missing typeof "duration" in class org.apache.axis2.databinding.types.Union
> ---------------------------------------------------------------------------
>
>                 Key: AXIS2-5048
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5048
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.5.4, 1.6.0
>         Environment: all platforms
>            Reporter: Juan Angel Fuentes
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.7.0
>
>         Attachments: Test.wsdl, Union.patch
>
>
> I'm using axis2 1.5.4, but I also tried this with the last snapshot of 
> version 1.5.5.
> I think there' s a missing typeof in class 
> org.apache.axis2.databinding.types.Union
> I'm trying to use this type in my webservice:
> <simpleType name="relativeOrAbsoluteDateType">
>                 <annotation>
>                     <documentation>Absolute and relative time</documentation>
>                 </annotation>
>                 <union memberTypes="dateTime duration"/>
>             </simpleType>
> When I try to send a message from  my  ws client using dateTime it works 
> smooth. But when i try to use duration i get this exception:
> org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Error 
> in parsing value
>     at 
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:446)
>     at 
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
>     at 
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
>     at 
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
>     at 
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
>     at 
> com.naevatec.www.testws.definitions.NaevatecTestStub.testSubmit(NaevatecTestStub.java:181)
>     at com.naevatec.Test.main(Test.java:59)
> I have attached the wsdl prepared to show you the maybe "possible bug".
> To patch this issue I would include this lines in the Union class:
> else if ("duration".equals(type)) {
>             setObject(ConverterUtil.convertToDuration(value));
> }
> More info:
> This is the way I'm using this type in the object  I create in the ws client:
>  It causes the excepction i've posted a few lines up;
> import org.apache.axis2.databinding.types.Duration;
>       RelativeOrAbsoluteDateType date= new RelativeOrAbsoluteDateType();
>       Duration dur= new Duration(false, 0, 0, 0, 1, 0, 0);
>       date.setObject(dur);
> If i create the object RelativeOrAbsoluteType  using Calendar It works:
> import java.util.Calendar;
>   RelativeOrAbsoluteDateType date1= new RelativeOrAbsoluteDateType();
>   Calendar cal= Calendar.getInstance();
>   cal.set(2011, Calendar.MAY, 18, 10, 0, 0);
>   date1.setObject(cal);
> It should work both ways.
> Thanks for your help.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org
For additional commands, e-mail: java-dev-h...@axis.apache.org

Reply via email to