Link to home
Start Free TrialLog in
Avatar of minglelinch
minglelinch

asked on

add a function to web service

I have a web service .asmx file in my project. Now I need to another function. May I just add the one more function in the web service CodeBehind cs file? Can I just add it by

    [WebMethod]
    public int SaveBinraryData(binrary imagedata)
    {
        ... ...
        ... ...
    }
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of minglelinch
minglelinch

ASKER

My first time to web service. How to do this process? (re-import the WSDL if they want to use the new method)

In Visual Studio, you just need to right-click on the "Web Reference" in the solution explorer and choose "Update Web Reference". That will the trigger Visual Studio into regenerating the proxy class from the WSDL of the service.
I got it. Thanks a lot !
One further question please. Some functions in asmx ahead with  [WebMethod], while some ahead with [WebMethod(EnableSession=true)], and some with nothing. Why? EnableSession=true is it used when making DB updates? Thanks.
No, it means that that particular method is able to store state information that can be used on subsequent requests from the same caller.
Great answer.