简体   繁体   中英

ASP.Net Webservice - Constructors with Parameters

I'm fairly new to WebService developement and have just set up my own webservice (ASP.Net 3.5, Visual Studio 2008 .asmx file). I can not find a way of setting up my webservice to take parameters on the constructor. If i create a constructor that takes parameters, it is not then shown when i hook up to the webservice from my application (it only shows a parameterless constructor). Am i missing something blatently obvious, or is this not possible (and why not)?

Thanks.

When you say "constructor for my webservice", do you mean "constructor for the proxy that communicates with my webservice"?

You may need to write a wrapper for the proxy if you need to handle authentication tokens and the like (this is the approach that the Flickr.Net open source project took)

it is meaningless to have parameters of web service constructor. web service communicate with client only on requests. constructor is called by web server internals automatically

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM