10/26/2011

Deploying a web service to IIS

Web services can be used in IIS without publishing it.Even virtual directory may not be necessary if IIS is working properly. I just copy asmx files, config and bin directory. Web service dll are created when studio builds the solution. Therefore publishing is not necessary for dll file. After copying files to wwwroot(or any virtual directory) we are okay to run it in browser.

Possible errors that you may encounter:
1)sgen.exe error : If you get sgen error while dealing with web services, you should change Generate Serialization Assembly option to Off. It is found in solution properties>Build tag.

2)File directory permission error: Most servers do not allow programs to create folders or files without permission. In our case, web service creates a file in TEMP directory because web service is used without publishing it. We need to allow all users to modify this folder.(WINDOWS>TEMP)

3)web.config error : The web.config that we copied may cause error in IIS. Changing appropriate lines fixes the problem. In my case web.extentions caused an error in config. I just deleted these lines because i didnt use any extention components in my web service.

No comments:

Post a Comment