• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

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)
    {
        ... ...
        ... ...
    }
0
minglelinch
Asked:
minglelinch
  • 4
  • 3
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
Yes. Of course any consumers of your service will need to re-import the WSDL if they want to use the new method.
0
 
minglelinchAuthor Commented:
My first time to web service. How to do this process? (re-import the WSDL if they want to use the new method)

0
 
Carl TawnSystems and Integration DeveloperCommented:
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.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
minglelinchAuthor Commented:
I got it. Thanks a lot !
0
 
minglelinchAuthor Commented:
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.
0
 
Carl TawnSystems and Integration DeveloperCommented:
No, it means that that particular method is able to store state information that can be used on subsequent requests from the same caller.
0
 
minglelinchAuthor Commented:
Great answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now