aspose file tools*
The moose likes Web Services and the fly likes WSDL to Java issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WSDL to Java issues" Watch "WSDL to Java issues" New topic
Author

WSDL to Java issues

Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
I a web service deployed which exposes an API that takes the parameter of type "java.Util.Date" and returns a list -

public java.util.List getUsersCreatedOn(Java.util.Date date)

However, when i tried to create the stubs from the WSDL of this web service, the stub has an API like this -

Object[] getUsersCreatedOn(GregorianCalendar date)

Why the List is treated as Object array and Date as GregorianCalendar?
How can I avoide this?
I am using Weblogic Server's clientgen ant task to create the stubs from WSDL. Is it the clientgen's limitations?
which other utlity does not have this limitation?
Rashmi Tambe
Ranch Hand

Joined: Aug 07, 2001
Posts: 418
can anybody please answer this?
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Rashmi Tambe:
I a web service deployed which exposes an API that takes the parameter of type "java.Util.Date" and returns a list -

public java.util.List getUsersCreatedOn(Java.util.Date date)

However, when i tried to create the stubs from the WSDL of this web service, the stub has an API like this -

Object[] getUsersCreatedOn(GregorianCalendar date)

Why the List is treated as Object array and Date as GregorianCalendar?
How can I avoide this?

IMHO, not sure whether i can help you, but..

how was your webservice deployed says for this webservice, in particular to what api the objects java.util.List and Date is mapped to ??

Were you able to communicate with the stubs you have without losing/converting any data ??


Spritle Software Blogs
Sandeep Bhagavatula
Greenhorn

Joined: Jul 25, 2004
Posts: 8
I had the same problem. Java to soap mapping is like that. I ended up having to change the method signature in wrapper. I think I used java.util.calendar and did .gettime() I am not sure.
Rik Sha
Greenhorn

Joined: Jul 13, 2004
Posts: 6
Originally posted by Sandeep Bhagavatula:
I had the same problem. Java to soap mapping is like that. I ended up having to change the method signature in wrapper. I think I used java.util.calendar and did .gettime() I am not sure.


If you are using AXIS (or otherwise), please refer to http://ws.apache.org/axis/java/user-guide.html and look for "How your Java types map to SOAP/XML types". May be that is the reason the stub that is auto generated has different datatype.
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
"java.Util.Date" is a java construct. SOAP is "bigger" than just java, and doesn't provide datatypes for all java constructs. There's .NET too, and it doesn't have the same data objects as java in all cases.

SOAP does provide datatypes for very standard datums, like integers, and strings. You can also aggregate these primary datatypes into a complex construct and name it, and use that in SOAP.

That's what you need to look into.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: WSDL to Java issues