Part 2: How to Update a Web Service

  • Thread starter Thread starter John Spiegel
  • Start date Start date
J

John Spiegel

Hi all,

How does one update a web service? Should be insanely simple but when I
copy an updated version (with new webmethods) to the server, the test page
("The following operations are supported...") still shows links to the old
versions' methods. It's as though it cached a copy of the old one and
refuses to let it go.

What file am I not updating or not putting in the right place?

TIA,

John
 
John,

If you right click on the web service in your project's references folder
one of the options in the popup menu is: "Update Web Reference"

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Hey, thanks for hopping in! Unfortunately, it doesn't solve the problem.
Whether I update or delete then re-add, it still shows the available methods
as those that it had the first time it was deployed to the server. However,
adding a reference to the local copy DOES show the updated version.

I've copied all files and the bin subfolder to the server, but it still is
returning something that references the old copy???

- John
 
Sometimes, the correct methods don't show up until the project is compiled
(even if you've updated the webreference). You might also want to try
enabling the "Show all files" option, expanding the webservice reference,
right-clicking on reference.map, and choosing "Run Custom Tool".

Also, do the correct methods show up on the test form on the server?

Regards,

Mun
 
Hi & Thanks Mun,

I'm pretty certain there's something on the server that I don't get. This
is my first web service so it's probably something stupid as well. I've
done rebuilds, updates and reupdates of references--all with no luck.

The correct methods DO NOT show up on the test form on the server. I've
tried various things that are admittedly shots in the dark but have inlcuded
overwriting the individual files up to the entire folder and its bin folder.
Every time the test page shows the two methods that existed when first
deployed. Checking the wsdl using the <url>?wsdl shows the old methods as
well???

- John
 
If you change the name of the asmx and the class, does it make a difference?

You could be behind a firewall that is caching very aggressively?
 
Hmm, very weird.

If you haven't done so already, try clearing your browser cache before
viewing the test page... I've often found it to be the source of some
strange problems.

Also, try physically deleting the files and then viewing the test form.
This *should* cause a 404 - page not found error, but sometimes, IIS does
some weird caching, which causes deleted files to keep showing.

I also agree with Ken's suggestion. Try renaming the asmx and class, and
trying it again, in case it's being cached somewhere else in your network
(eg. firewall).

Hope this helps.

Mun
 
Thanks Ken and Mun!

Renaming just the asmx and asmx.cs files along with changing the asmx's
codebehind reference to match up to the new .asmx.cs name had no effect.
Next changing the namespace in the asmx.cs and associated asmx reference
gave the error:

Could not create type 'SignupServicesX.RecentSignup'

All I had done was just add an X to the end of the namespace.

Along the lines of what Mun suggested, I did the following:
1. Copy asmx & codebehind to a new folder on the development box and built
up a mirror project.
2. Changed the namespace.
3. Built and ran until it's working in devl environment.

I then moved the files to the web server (in the orders as listed below)
trying after each step. Each time I received the error Could not create
type 'SignupServicesX.RecentSignup'.
4. FTP asmx, asmx.cs and bin folder to new folder on server along with
copying web.config.
5. FTP .resx
6. FTP global.asax and global.asax.cs
7. FTP glogal.asax.resx: same error
8. FTP AssemblyInfo.cs
9. FTP rest including the other created subfolders.

Am I misunderstanding or forgetting what I did before or in theory should
that have been (more than) enough for it to be deployed?

Thanks again,

John
 
Sounds like some strange things are happening on that machine... ;-)

Everything you've done seems to be correct, and should work. As a bit of a
brute-force solution, I'd suggest trashing virtual directory (in IIS) on the
server, and making sure that all files are deleted. Check this by trying to
surf the webservice test form, which should give you a 404 error. Then
re-create the virtual directory from scratch, and re-upload a basic working
HelloWorld test webservice (i.e. you could just uncomment the default code,
compile, and upload). Test this using the test form. Once this is working,
delete all the test webservice files from the server, upload your 'real'
webservice files, ad try the test form again... which should hopefully work
:-)

Once the test form for your real webservice is working as intended, you
should be able to add the webreference your visual studio project, and get
the correct methods showing up.

Hope this helps :-)

Mun
 
Thanks, yet again.

I have a knack for creating strange issues :) I have to coordinate this
with the people who are actually hosting the site. Thanks for the ideas.

- John
 
Back
Top