I have two new questions.
1. my exception handling codes works well when I synchronously call a web
service,but How can I use it in asynchronously calling? I tried in the same
way,but when error happened,my main programe is always waiting the response
from the service,but nothing is returned,until I terminate it by myself.Any
help on "how to" ,thanks.
2.I found the web.config file in asp.net somewhat confusing.I work under the
version 2 of dotnet framework. and I noted the machine.config has been
seperated into two files in my system directory. a machine.config file and a
new global web.config file,and the latter configs some web application
features.I want to add authentication and authorization features in my web
service.And I found the global web.config file has a <authorization><allow
users="*"></authorization> section.
I've read the .net framework SDK, and know this global configuration can
affect my own app-level configuration(also a web.config file).for example,I
config in my own web.config file like this:
<authentication mode= "Windows">
</authentication>
<authorization>
<deny users="administrator">
</authorization>
But it doesn't work when I use administrator to request the service. for the
global configuration allows "*",that is everyone can use this web service.So
I get rid of the global allow section use "<!-- -->",and keep my own
configuration.I think this is correct,but the result is that all request to
the service is now turned to be "unauthorized".
Now the trouble is When I keep the global configuration, my service is work
for everyone,but When I forbid the it, my service is also forbid everyone. I
cannot understand the usage of global<authorization> section. need your
help, thank you.