all groups > dotnet web services > november 2005 >
You're in the

dotnet web services

group:

when to use Proxy object for web services


when to use Proxy object for web services pradeep_TP
11/22/2005 11:46:03 PM
dotnet web services:
I am new to web services.

I created a very simple web service with a method that returns a simple
string object. I added a web reference to this web service from another
project and I could successfully call the method.

Now, I want to understand why many suggests to create a proxy object of the
web service and then call the method using this proxy object. What is the
difference between creating a proxy object using WSDL utility and referencing
to the web service using web reference from Visual studio.net.

What condition will necessitate me for creating a proxy object exclusively
by using WSDL utility.

Thanks
Pradeep_TP

Re: when to use Proxy object for web services Michael Nemtsev
11/23/2005 10:16:20 AM
Hello pradeep_TP,

It's the same stuff, VS IDE calls wsde.exe and generate proxy automatically

p> I am new to web services.
p>
p> I created a very simple web service with a method that returns a
p> simple string object. I added a web reference to this web service
p> from another project and I could successfully call the method.
p>
p> Now, I want to understand why many suggests to create a proxy object
p> of the web service and then call the method using this proxy object.
p> What is the difference between creating a proxy object using WSDL
p> utility and referencing to the web service using web reference from
p> Visual studio.net.
p>
p> What condition will necessitate me for creating a proxy object
p> exclusively by using WSDL utility.
p>
p> Thanks
p> Pradeep_TP
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Re: when to use Proxy object for web services pradeep_TP
11/23/2005 8:26:04 PM
hi michael,

The reason why I asked this question was, I created a web service with a
property get and set. I am able to set the value to the property but when I
am retrieving, then I am getting "Object reference error". On reading
articles, I found that since web services are stateless they will not retain
the value and there for proxy object should be used. so now I am wondering,
if VS IDE is creating a proxy object automatically, then why is it not able
to retain the value of property. Following is the code that i have written
for property

string _property;

public string HelloWorldProperty
{
[WebMethod(EnableSession=true)]
get
{
return _property;
}
[WebMethod(EnableSession=true)]
set
{
_property = value;
}
}


thanks
Pradeep_TP

[quoted text, click to view]
AddThis Social Bookmark Button