You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Mahendra Babu <ba...@geometricsoftware.com> on 2001/01/30 15:26:09 UTC
Help needed...Passing object as parameter.
Hi All,
In the addressbook example we have an object of AddressBook being passed as
a parameter.
In a similar fashion I am trying to send an object of my class Numbers. But
the values
for the member variables which I set on the client side seem to get lost on
the server
side.
Please do advise.
The Numbers class is as follows,
package samples.addressbook;
public class Numbers
{
private int x;
private int y;
public Numbers()
{
}
public Numbers(int a, int b)
{
this.x = a;
this.y = b;
}
public int getX()
{
return this.x;
}
public int getY()
{
return this.y;
}
public String toString()
{
return x + " " + y;
}
Thanks in advance,
Mahendra Babu
Re: Help needed...Passing object as parameter.
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi,
I tried using the BeanSerializer as below,
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes( Constants.NS_URI_SOAP_ENC,new
QName("urn:xml-soap-address-demo", "numbers"),
Numbers.class, beanSer, beanSer);
I set the values of the member variables x and y as 5 and 6. But when I pass
the parameter, on the
client side the values of both x and y become 0.
I have attached the PutAddress.java file and the Numbers.java file with this
mail.
Thanks,
Mahendra Babu
> Shouldn't you be able to accomplish this using a Bean serializer /
> deserialzer, similar to the way have in the address book example ?
>
> -Priya
>
>
>
>
> -----Original Message-----
> From: Mahendra Babu [mailto:babum@geometricsoftware.com]
> Sent: Tuesday, January 30, 2001 9:26 AM
> To: soap-user@xml.apache.org
> Subject: Help needed...Passing object as parameter.
>
>
> Hi All,
>
> In the addressbook example we have an object of AddressBook being passed
as
> a parameter.
>
> In a similar fashion I am trying to send an object of my class Numbers.
But
> the values
> for the member variables which I set on the client side seem to get lost
on
> the server
> side.
>
> Please do advise.
>
> The Numbers class is as follows,
>
> package samples.addressbook;
>
> public class Numbers
>
> {
>
> private int x;
>
> private int y;
>
>
> public Numbers()
>
> {
>
> }
>
> public Numbers(int a, int b)
>
> {
>
> this.x = a;
>
> this.y = b;
>
> }
>
>
> public int getX()
>
> {
>
> return this.x;
>
> }
>
> public int getY()
>
> {
>
> return this.y;
>
> }
>
> public String toString()
>
> {
>
> return x + " " + y;
>
> }
>
>
>
> Thanks in advance,
>
> Mahendra Babu
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
Re: Help needed...Passing object as parameter.
Posted by Mahendra Babu <ba...@geometricsoftware.com>.
Hi,
I tried using the BeanSerializer as below,
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
smr.mapTypes( Constants.NS_URI_SOAP_ENC,new
QName("urn:xml-soap-address-demo", "numbers"),
Numbers.class, beanSer, beanSer);
I set the values of the member variables x and y as 5 and 6. But when I pass
the parameter, on the
client side the values of both x and y become 0.
I have attached the PutAddress.java file and the Numbers.java file with this
mail.
Thanks,
Mahendra Babu
> Shouldn't you be able to accomplish this using a Bean serializer /
> deserialzer, similar to the way have in the address book example ?
>
> -Priya
>
>
>
>
> -----Original Message-----
> From: Mahendra Babu [mailto:babum@geometricsoftware.com]
> Sent: Tuesday, January 30, 2001 9:26 AM
> To: soap-user@xml.apache.org
> Subject: Help needed...Passing object as parameter.
>
>
> Hi All,
>
> In the addressbook example we have an object of AddressBook being passed
as
> a parameter.
>
> In a similar fashion I am trying to send an object of my class Numbers.
But
> the values
> for the member variables which I set on the client side seem to get lost
on
> the server
> side.
>
> Please do advise.
>
> The Numbers class is as follows,
>
> package samples.addressbook;
>
> public class Numbers
>
> {
>
> private int x;
>
> private int y;
>
>
> public Numbers()
>
> {
>
> }
>
> public Numbers(int a, int b)
>
> {
>
> this.x = a;
>
> this.y = b;
>
> }
>
>
> public int getX()
>
> {
>
> return this.x;
>
> }
>
> public int getY()
>
> {
>
> return this.y;
>
> }
>
> public String toString()
>
> {
>
> return x + " " + y;
>
> }
>
>
>
> Thanks in advance,
>
> Mahendra Babu
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>
RE: Help needed...Passing object as parameter.
Posted by Priya <pm...@orbit-e.com>.
Shouldn't you be able to accomplish this using a Bean serializer /
deserialzer, similar to the way have in the address book example ?
-Priya
-----Original Message-----
From: Mahendra Babu [mailto:babum@geometricsoftware.com]
Sent: Tuesday, January 30, 2001 9:26 AM
To: soap-user@xml.apache.org
Subject: Help needed...Passing object as parameter.
Hi All,
In the addressbook example we have an object of AddressBook being passed as
a parameter.
In a similar fashion I am trying to send an object of my class Numbers. But
the values
for the member variables which I set on the client side seem to get lost on
the server
side.
Please do advise.
The Numbers class is as follows,
package samples.addressbook;
public class Numbers
{
private int x;
private int y;
public Numbers()
{
}
public Numbers(int a, int b)
{
this.x = a;
this.y = b;
}
public int getX()
{
return this.x;
}
public int getY()
{
return this.y;
}
public String toString()
{
return x + " " + y;
}
Thanks in advance,
Mahendra Babu
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org
RE: Help needed...Passing object as parameter.
Posted by Priya <pm...@orbit-e.com>.
Shouldn't you be able to accomplish this using a Bean serializer /
deserialzer, similar to the way have in the address book example ?
-Priya
-----Original Message-----
From: Mahendra Babu [mailto:babum@geometricsoftware.com]
Sent: Tuesday, January 30, 2001 9:26 AM
To: soap-user@xml.apache.org
Subject: Help needed...Passing object as parameter.
Hi All,
In the addressbook example we have an object of AddressBook being passed as
a parameter.
In a similar fashion I am trying to send an object of my class Numbers. But
the values
for the member variables which I set on the client side seem to get lost on
the server
side.
Please do advise.
The Numbers class is as follows,
package samples.addressbook;
public class Numbers
{
private int x;
private int y;
public Numbers()
{
}
public Numbers(int a, int b)
{
this.x = a;
this.y = b;
}
public int getX()
{
return this.x;
}
public int getY()
{
return this.y;
}
public String toString()
{
return x + " " + y;
}
Thanks in advance,
Mahendra Babu
---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org