1

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.

2 Answers 2

1

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)

Sign up to request clarification or add additional context in comments.

2 Comments

By "need to", I mean "want to", of course -- depends how much you like the consumers of your service...
Ah, i was missing the fact that it's the proxy that needs the constructor. I will make the Webservice authenticate every request, and create a wrapper for the proxy for use on the client that has a constructor taking authentication details. Cheers
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.