axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Leitner <noz...@sbox.tugraz.at>
Subject Sending more than just beans (Best Practice?)
Date Wed, 07 Aug 2002 11:19:16 GMT
Hi again,

now that I have sessions working correctly I am now trying to implement a simple Client/Server
combo.

I understand from the docs that references cannot be transmitted via soap. So that in the
following scenario (server side):

class MyService
{
	Person getPersonByName (String name)
	{	
		... lookup person in db and return reference to it...
	}

}
class Person
{
	private String name;
	private String tel;
	public String getName () {return name}
	public String getTel () {return tel}
	public void setName (String name) {this.name = name;}
	public void setTel (String tel) {this.tel = tel;}
}
--

I would get on the client side:
--
class MyService
{
	Person getPersonByName (String name)
	{ ... do proxy stuff ...}
}
--
which is ok, but class Person would carry only public data and no operations.
--
class Person
{
	public String name;
	public String tel;
}
--

Now I can imaging this will work for simple cases, but as classes get more complex, I surely
will need more than plain structs. Even if no operations are permitted, a client may not be
allowed to set all attributes of an object at will.

Of course such a plain struct has the advantage, that setting an attribute does not require
a SOAP call on the other hand.

If I want class Person on the client side to have operations, do I need to write custom serializers/deserializers?
How have others solved this problems? Can I combine server webserices - like one webservice
for MyService and one for Person, where 'getPersonByName' would somehow return a reference
to the WebService 'Person'?

many thanks in advance,
Andreas


Mime
View raw message