tWebService Component - XML GregorianCalendar issue

One Star

tWebService Component - XML GregorianCalendar issue

Hello All,
I'm trying to finalize a test using tWebService componet with a exposed webservice.
Everything work OK, except when I try to pass a non-mandatory date as a variable to tWebService component.
The error I got is this one:
Exception in component tWebService_1
org.apache.commons.beanutils.ConversionException: Should be javax.xml.datatype.XMLGregorianCalendar type or java.util.Date type
at org.talend.webservice.mapper.converter.XMLGregorianCalendarConverter.convert(XMLGregorianCalendarConverter.java:32)
at org.talend.webservice.mapper.converter.ConvertTool.convert(ConvertTool.java:32)
at org.talend.webservice.mapper.SimpleTypeMapper.convertToType(SimpleTypeMapper.java:29)
at org.talend.webservice.mapper.SimplePropertyMapper.setValueTo(SimplePropertyMapper.java:77)
at org.talend.webservice.mapper.ComplexTypeMapper.convertToType(ComplexTypeMapper.java:101)
at org.talend.webservice.mapper.MessageMapperImpl.convertToParams(MessageMapperImpl.java:80)
at org.talend.webservice.mapper.MessageMapperImpl.convertToParams(MessageMapperImpl.java:48)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:195)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:237)
at json_parser.copy_of_ws_test_qas_0_1.Copy_of_WS_TEST_QAS.tFixedFlowInput_1Process(Copy_of_WS_TEST_QAS.java:808)
I've tried to pass this variable as string/date/object, without any success: how can I set a proper XMLGregorianCalendar type of variable?
Thanks in advance for your help. I'll be really appreciated!
THANKS
Seventeen Stars

Re: tWebService Component - XML GregorianCalendar issue

Go into the code view and here to the line 808 (as mentioned in the stack trace).
Figure out which column it is and check in the schema editor if this column is of Date type.
A String as date is not capable here.
One Star

Re: tWebService Component - XML GregorianCalendar issue

Hello JLolling, first thanks for your reply!
Even If I change in the scheme editor, using a Date, a String or a generic Object, it does not work.
Here the lines from 805 to 813:
805 java.util.Map<String, Object> results_tWebService_1 = null;
806 try {
807 results_tWebService_1 = serviceInvokerHelper_tWebService_1
808 .invoke(serviceName_tWebService_1,
809 portName_tWebService_1,
810 "MEASUREM_DOCUM_RFC_SINGLE_001",
811 inMap_tWebService_1);
812 } catch (java.lang.Exception e) {
813 throw (e);

That's the error I got when I select Date type:
Exception in component tWebService_1
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.talend.webservice.mapper.SimplePropertyMapper.setValueTo(SimplePropertyMapper.java:77)
at org.talend.webservice.mapper.ComplexTypeMapper.convertToType(ComplexTypeMapper.java:101)
at org.talend.webservice.mapper.MessageMapperImpl.convertToParams(MessageMapperImpl.java:80)
at org.talend.webservice.mapper.MessageMapperImpl.convertToParams(MessageMapperImpl.java:48)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:195)
at org.talend.webservice.helper.ServiceInvokerHelper.invoke(ServiceInvokerHelper.java:237)
at json_parser.copy_of_ws_test_qas_0_1.Copy_of_WS_TEST_QAS.tFixedFlowInput_1Process(Copy_of_WS_TEST_QAS.java:808)

I thought there was possibility to pass to WB an object "XMLGregorianCalendar".
Do you have a suggestion for a workaround?
Thanks
Regs
One Star

Re: tWebService Component - XML GregorianCalendar issue

Hello, do you know any possibility to define XMLGregorianCalendar schema in Talend?
Thx.