Skip to main content

jax-rpc issue???

3 replies [Last post]
robl29
Offline
Joined: 2007-07-18
Points: 0

I am consuming a webserivce and the webservice has a method called getPayment(); the method returns a base class Payment. When I call this method, it always return the base class Payment even though the CreditCard class is set. The CreditCard class extends the Payment class. Can someone kindly explain to me why don't I get the actual class back?
BTW, I am using wscompile tool to build the client stub from the wsdl.

Thanks in advance.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sg1973
Offline
Joined: 2007-09-28
Points: 0

I am not sure if you are still having this issue. If so, here are my thoughts.
I assume CreditCard class extends the Payment class. If so, check to make sure that the subclass made it to the WSDL. if not, you may need to follow a top-down approach and create the WSDL with all the types and then generate the java objects from the WSDL. Alternatively, you can create dummy methods in your Java classes including these subclasses so they make to the WSDL and thus to the client.

Let me know how it goes

SG

robl29
Offline
Joined: 2007-07-18
Points: 0

Thanks SG. I took the second approach; I created a dummy method that includes the subclasses. I did not go with the first approach because I don't want to mess with WSDL file.

sg1973
Offline
Joined: 2007-09-28
Points: 0

Good to hear that.

BTW I am having the below issue. Any thoughts?

http://forums.java.net/jive/thread.jspa?threadID=31319&tstart=0

Thanks,
SG

Message was edited by: sg1973