Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSDL to Java issues

 
Rashmi Tambe
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody please answer this?
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Sandeep Bhagavatula
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic