Hey

I was under the impression that it was possible to return an object of a
class from a webservice, and then assign it to an instance of the same
object on the PDA program receiving the returned object.

Example webservice:

namespace WS
{
[WebService(Namespace=http://whatever)]
public class WS : System.Web.Services.WebService
{
retClass retObj = new retClass();
...
...
...
[WebMethod]
public retClass Get_Value(){
...
...
...
retObj.retInt = some value;
retObj.retString = "some string"
retObj.retDS = some dataset;
return retObj;
}
}

public class retClass
{
public int retInt = 0;
public string retString = "";
public DataSet retDS = null;
}
}

And the following is my PDA app.:

{
public class retClass
{
public int retInt = 0;
public string retString = "";
public DataSet retDS = null;
}

mainclass{
WS ws = new WS();
retClass retObj = new retClass();
retObj = ws.Get_Value(); //This is where VS tells me that it cant
convert ws.Get_Value() into a retObj
}
}

Well i left some code out (guess you allready figured out).

Ok, what is going wrong?

Why cant i do this?

--


Jimmy

Re: class to class by casey

casey
Tue May 11 09:09:27 CDT 2004

you can.
search for 'Alternate to Remoting' posted at 5/3 for a guide.

there is not enough code here to tell what is going on.
the problem might be a namespace mismatch in the auto generated proxy.

casey
http://www.brains-N-brawn.com


"Jimmy" <pleasereplyingroup@hotmail.com> wrote in message
news:uJBy4L0NEHA.736@TK2MSFTNGP09.phx.gbl...
> Hey
>
> I was under the impression that it was possible to return an object of a
> class from a webservice, and then assign it to an instance of the same
> object on the PDA program receiving the returned object.
>
> Example webservice:
>
> namespace WS
> {
> [WebService(Namespace=http://whatever)]
> public class WS : System.Web.Services.WebService
> {
> retClass retObj = new retClass();
> ...
> ...
> ...
> [WebMethod]
> public retClass Get_Value(){
> ...
> ...
> ...
> retObj.retInt = some value;
> retObj.retString = "some string"
> retObj.retDS = some dataset;
> return retObj;
> }
> }
>
> public class retClass
> {
> public int retInt = 0;
> public string retString = "";
> public DataSet retDS = null;
> }
> }
>
> And the following is my PDA app.:
>
> {
> public class retClass
> {
> public int retInt = 0;
> public string retString = "";
> public DataSet retDS = null;
> }
>
> mainclass{
> WS ws = new WS();
> retClass retObj = new retClass();
> retObj = ws.Get_Value(); //This is where VS tells me that it cant
> convert ws.Get_Value() into a retObj
> }
> }
>
> Well i left some code out (guess you allready figured out).
>
> Ok, what is going wrong?
>
> Why cant i do this?
>
> --
>
>
> Jimmy
>
>