Webservice questions.

F

farseer

Hi, I have a few webservice questions i'd like to bounce of you...

1. Can a webservice contain a paramterized contructor ( can't the
contructor take parameters )?


2. If two users make an initial call to a webservice, will diferent
instances of the webservice object be instantiated on the server?
(assuming the service is not designed to be a singleton)

3. The reason i ask these question is that we have some java based
webservices which return some simple array of beans type objects. The
webservice takes two string parameters in it's constructor. However,
when i auto-generate the C# proxy classes using wsdl.exe and the
webservice's .wsdl file, all goes well, except that the contructor of
the auto-generated C# proxy classes does not take any parameters, as
does the actual webservice that reside on the server.

thanks
 
S

S.M. Altaf [MVP]

Hi,

1. The only thing you can expose to clients, are the web methods. So a web
service could have parameterized constructors, but I doubt they'd be of much
use unless they are a web method. It really depends what you need them for.
You can, additionally, modify the generated proxy class to take parameters
in the constructor, but note that you'll need to do this everytime you
update the web reference.

2. Yes. Web services are stateless, remember that.

3. See #1 and #2.

HTH,
S.M. Altaf
[MVP - VB]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top