You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ronald Pieterse <ro...@gmail.com> on 2007/11/19 12:45:31 UTC

Date object input parameter 'argument type mismatch'

I have my services running almost perfectly now, just one weird thing
happening now that used to work in a previous version; it definitely worked
in XFire.

Problem:
I have an interface and implementation for my service and use annotations to
create the wsdl file. This all works fine except in my method where I use a
Date object
as input parameter. 
First of all I noticed that the generated (Axis 1) client accepts a Calendar
object instead of a Date object. 
Then when I envoke the method a 'java.lang.IllegalArgumentException:
argument type mismatch' is thrown. What should I do to get this working?
In SoapUI it works fine! So I suspect it's in the client code?

I have been looking and trying for 2 days now and need to get it fixed asap.

I use CXF 2.0.2-incubator with Java 5

THNX
-- 
View this message in context: http://www.nabble.com/Date-object-input-parameter-%27argument-type-mismatch%27-tf4835686.html#a13834424
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Date object input parameter 'argument type mismatch'

Posted by James Mao <ja...@iona.com>.
BTW, the generated binding file should looks like [1] *Q: How to map 
xsd:dateTime to java.util.Date?*

[1] this http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html


> I have my services running almost perfectly now, just one weird thing
> happening now that used to work in a previous version; it definitely worked
> in XFire.
>
> Problem:
> I have an interface and implementation for my service and use annotations to
> create the wsdl file. This all works fine except in my method where I use a
> Date object
> as input parameter. 
> First of all I noticed that the generated (Axis 1) client accepts a Calendar
> object instead of a Date object. 
> Then when I envoke the method a 'java.lang.IllegalArgumentException:
> argument type mismatch' is thrown. What should I do to get this working?
> In SoapUI it works fine! So I suspect it's in the client code?
>
> I have been looking and trying for 2 days now and need to get it fixed asap.
>
> I use CXF 2.0.2-incubator with Java 5
>
> THNX
>   

Re: Date object input parameter 'argument type mismatch'

Posted by James Mao <ja...@iona.com>.
If you have a java.util.Date in your SEI, the java2wsdl tool should 
generate a jaxws binding file for you along with the wsdl
With the wsdl and binding files you can generate the types, and in the 
types code, it will include a jaxb annotation which convert the Date type
You can try this approach, and see if it works

I think it's been included into the 2.0.2

Regards,
James

> I have my services running almost perfectly now, just one weird thing
> happening now that used to work in a previous version; it definitely worked
> in XFire.
>
> Problem:
> I have an interface and implementation for my service and use annotations to
> create the wsdl file. This all works fine except in my method where I use a
> Date object
> as input parameter. 
> First of all I noticed that the generated (Axis 1) client accepts a Calendar
> object instead of a Date object. 
> Then when I envoke the method a 'java.lang.IllegalArgumentException:
> argument type mismatch' is thrown. What should I do to get this working?
> In SoapUI it works fine! So I suspect it's in the client code?
>
> I have been looking and trying for 2 days now and need to get it fixed asap.
>
> I use CXF 2.0.2-incubator with Java 5
>
> THNX
>