I am required to learn asp.net web services with web forms. I have a web form project that has a web service added as a Web Reference. The problem is, whenever I change anythin开发者_JAVA百科g about the web service (add new methods/services for example), it is not reflected in the application that has the web reference and tells me the new method doesn't exist. How do I fix this?
You have to right-click the web reference and click Update Web Reference to update it manually when the web service contract changes.
Visual Studio will then re-download the wsdl from the service and use it to re-generate the service proxy classes in the client.
Note
Check that you rebuild your web service first, and that those changes are available on the URL used by the web reference in the client project (i.e. if the client app is referencing http://server.mydomain.local/services/CI/myservice/myservice.asmx
then just re-building locally won't be enough, you'll need to either deploy the webservice changes or point your client to localhost
before you update the web reference.
You probably have to re-import the reference to the webservice. I doubt this definition constantly gets updated like it's a class in your project.
精彩评论