Web Services and Inheritance [message #173304] |
Thu, 06 July 2006 10:33 |
Eclipse User |
|
|
|
Originally posted by: callumurquhart.gmail.com
This is my first web service (although not my first use of Eclipse), so
bear with me if this is an obvious question.
I'm wanting to know if there are rules around inheritance and [testing]
web services. I'm asking because I have a class from which I create the
web service that initialises a class that is the child of another, however
when testing the client I'm not seeing the expected "input" fields.
I have a class "LoginService" which is the class from which I want to
create a web service:
public class LoginService
{
public LoginService ()
{
}
public String login (String u, String p)
{
Child child = new Child () ;
return u + " " + p ;
}
}
And the Child class and its parent (Base):
public class Child extends Base
{
public Child ()
{
}
}
public class Base
{
protected Data myData = new Data () ;
public Base ()
{
}
}
So Child extends Base, and Base has the class Data which some fields:
package com.bsn.icrm2;
public class Data
{
private String forename, surname ;
/* set and get methods for forename and surname here
*/
}
Data has two string members, along with set/get methods for those.
So, when I create a web service of LoginService class I was expecting to
be able to set the forename and surname in the Test Client.
Quite a long story, but after looking for a reference to this I've found
nothing - does anyone know of a link to rules of web services,
inheritance, etc? I know for a method to be available to a web service it
must be public (login() in my case), but that's about it.
Thanks
--
CUrquhart
|
|
|
Re: Web Services and Inheritance [message #173816 is a reply to message #173304] |
Mon, 10 July 2006 20:06 |
Peter Moogk Messages: 15 Registered: July 2009 |
Junior Member |
|
|
In your posting the LoginService class has one method login. Therefore,
the webservice will only have one operation for login. The implementation
of the login method uses the Child class. This Child class as defined in
your example is just part of the implementation and therefore none of its
methods will appear as operations for the web service. I hope this help.
Peter Moogk
C Urquhart wrote:
> This is my first web service (although not my first use of Eclipse), so
> bear with me if this is an obvious question.
> I'm wanting to know if there are rules around inheritance and [testing]
> web services. I'm asking because I have a class from which I create the
> web service that initialises a class that is the child of another, however
> when testing the client I'm not seeing the expected "input" fields.
> I have a class "LoginService" which is the class from which I want to
> create a web service:
> public class LoginService
> {
> public LoginService ()
> {
> }
> public String login (String u, String p)
> {
> Child child = new Child () ;
> return u + " " + p ;
> }
> }
> And the Child class and its parent (Base):
> public class Child extends Base
> {
> public Child ()
> {
> }
> }
> public class Base
> {
> protected Data myData = new Data () ;
> public Base ()
> {
> }
> }
> So Child extends Base, and Base has the class Data which some fields:
> package com.bsn.icrm2;
> public class Data
> {
> private String forename, surname ;
> /* set and get methods for forename and surname here
> */
> }
> Data has two string members, along with set/get methods for those.
> So, when I create a web service of LoginService class I was expecting to
> be able to set the forename and surname in the Test Client.
> Quite a long story, but after looking for a reference to this I've found
> nothing - does anyone know of a link to rules of web services,
> inheritance, etc? I know for a method to be available to a web service it
> must be public (login() in my case), but that's about it.
> Thanks
> --
> CUrquhart
|
|
|
Powered by
FUDForum. Page generated in 0.02701 seconds