Élodie Petit
Élodie Petit

Reputation: 5914

Wsdl never updates

No matter what I change in an asmx service in Visual Studio, the WSDL file stays always the same. Deleting methods, changing method signatures don't have any effect when I browse to service definition.

Upvotes: 3

Views: 4439

Answers (4)

pholpar
pholpar

Reputation: 1785

I had today the very same issue. It was caused by a GACed version of the assembly that contained the type definitions exposed by the web service. I had to remove the assembly from the Global Assembly Cache first, like:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" /u YourAssemblyNameWithouthDllExtebsion /f

Be sure to restart the web server hosting the web service to reload the new version of the assembly, for example, in case of IIS Express, you can kill the former process instance by PowerShell:

(Get-Process -Name iisexpress).Kill()

After that, the updated WSDL version was displayed as expected.

Upvotes: 0

Daniel S.
Daniel S.

Reputation: 11

I have had a simular problem.

When removing an enum and replacing it by a string, the enum wouldn't go away from the wsdl. No matter what I tried (clean, rebuild, clear browser cache, other browser), it kept returning the enum as a complex type within the WSDL.

The solution in my case was remove the local folders of the project via windows explorer, then perform a get latest from TFS. After this the problem was solved.

Of course this solution only aplies when using a sourcecontrol system.

Upvotes: 1

DWRoelands
DWRoelands

Reputation: 4940

I have encountered this problem and have a solution.

Cause: When you create a new "Web Service" project in Visual Studio, it automatically adds a "Service1.asmx" file to your project. You rename this file and change the class declaration inside of it, but Studio still thinks it's "Service1" wnd will only ever display the web service definition for "Service1".

Solution:

  1. Delete all "bin" and "obj" folders in your project.
  2. Copy the methods from your existing asmx file to notepad.
  3. Remove the service from your project.
  4. Add a new service to your project, with the name you want.
  5. Paste the code from Notepad into the new service.
  6. Rebuild All

Your asmx should now accurately reflect your web service and update normally on future builds.

Upvotes: 0

John Saunders
John Saunders

Reputation: 161781

After changing your service, you must build it and ensure that the new version is running. One shortcut would be to build it (and make sure there are no errors), then right-click the .ASMX file and choose "View in Browser".

Also, although I'm sure you're aware of it, you should not be using ASMX web services for new development. Microsoft now considers ASMX to be a legacy technology. Use WCF instead.

Upvotes: 0

Related Questions