Cannot access web service.

I have built and tested a web service using Localhost, and I have successfully published the service to another machine that is the IIS machine.  That is, the publish function in VS 2008 completed successfully and the files were correctly moved to the web server machine.

Now, if I attempt to access the web service (called 'service') with the string:
http://<ip addr of IIS machine>/Service.asmx
the following error occurs: (attached image) web service error
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

First try and run the web service from the local machine if you have access.  That may give you a descriptive error that will help you.  Otherwise to see the error on the machine you are currently accessing it from, follow the instructions in the error to edit the web.config file on the web server/folder you published to.

If you have trouble with that error or don't understand it, post that error.
mdreedAuthor Commented:
I tried running it on the web server, where the service was published to, and get the error shown in the attached image. Error on web server
Check in IIS and make sure that the .Net framework Version is the same as the one you developed for.  Under IIS get the properties for the website and go to the ASP.NET tab Make sure that the ASP.NET version is what you developed under.
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

mdreedAuthor Commented:
I saw from the bottom of the error display that it was referencing .NET Framework 1.1 so I installed 3.5, but the error persists.

I am now uninstalling IIS and reinstalling to see if that corrects the error.  Is there a certain sequence that these components must be installed?
Hmmmm...don't know sounds possible I wouldn't think an IIS reinstall should be needed.  Maybe a server re-start at most.
mdreedAuthor Commented:
Also, when I went to the ASP.NET tab as you suggested, 3.5 wasn't even listed, even though I had installed it.
You have to register the framework to IIS, did it just have 1.1?
mdreedAuthor Commented:
The dropdown list showed 1.1 and 2.0 but not 3.5.  How do I force it to use 3.5?
If I have to register it, how do I do that?
On your server, browse to \WINDOWS\Microsoft.NET\Framework
 in each version folder you should be able to find aspnet.regiis.exe

from a cmd window you will run

\microsoft.NET\Framework\--version--\aspnet_regiis.exe -i
If 2.0 is listed just choose that, 3.5 is an extension of 2 so it should work, there is no aspnet_iis.exe for 3.5 but there is for 4.0 if you developed using 3.5 choose 2.0xx
Just to clarify: if you developed under the 3.5 framework, choose 2.0.50727 as your AS.Net framework on the ASP.NET tab in IIS Website properties.
mdreedAuthor Commented:
I have reinstalled IIS; rebooted the web server; changed the ASP.NET tab to select .NET Framework 2.0; and registered 2.0.
Now, when I publish the app to the web server from my dev machine the publish fails (doesn't say why).
And if I just copy the asmx file, etc to wwwroot on the web server, it now says that the web page cannot be found, instead of throwing the error I mentioned before.
This is REALLY frustrating.
Ok, I never use the publish feature, not that it is good or bad, I just have no experience with it.  What version of windows server is your IIS server 2003, 2008?

How complicated is your webservice?

Does it access a network database?

How many files, what sub folders, files are in your project folder?
mdreedAuthor Commented:
The web server is XP.
The web service does access a DB on a different machine.
The Project tree is attached. Web service project tree
Supposing Windows Server 2003:

Copy your project folder and contents to the server drive, for arguments sake let's say c:\mywebservice

Start IIS
On the left pane open the server tree
expand the "web sites" folder tree
if there are other sites installed, (not likely since you re-installed IIS) right click and stop them.
Right-click on the "web sites: folder icon and choose "New---Web Site
Follow the wizard:
Name your Webservice something
IP Address and ports are probably the default unless you know differently.
Browse to the folder you copied your project directory to earlier - choose the folder that contains your .asmx file
Web site permissions - default "read"
Now your site will appear in the Web Site - Tree
Right click-Properties on your website
ASP.NET tab make sure 2.0.x is chose.
Documents Tab: add yourfile.asmx to the list and move it to the top delete others.

That should do it.  you can even right clik your asmx file in the right pane and "Browse" to see if it works.

Okay so the above instructions will work.

when copying files, copy The app_code, app_data service.asmx and web.config to the director on the IIS machine
mdreedAuthor Commented:
If I right-click 'web sites' I do not show what you describe.  See attached.
Ok, so on XP the default one is already there...
hold on....
do this:
Right-Click Default Site - Properties
Under the "Home Directory" tab browse to the directory with your files
"ASP.NET" tab make sure 2.0.x is chose.
"Documents" Tab: add yourfile.asmx to the list and move it to the top delete others.

Right click on Default Website Choose - "Stop" if available then go back and do "Start".
if the site isn't running - "Start" will be available and just do that.

in the right pane right click on service.asmx and choose "browse"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mdreedAuthor Commented:
It's magic !  All is well with the world.

So when you create a new service, you just copy the 'build' structure to the web server an point to it ?

If I want to create a new web site, so that I don't have to use the 'Default Web Site', how do I do that?


Well the restrictions on XP IIS are that you can only have one site.  Also you can only have one concurrent connection to the server at a time.
if you have additional web services you need to run, you can add to your existing asmx file and have more than one routine on that web service.
mdreedAuthor Commented:
Thanks for all your help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.