Solved

add a function to web service

Posted on 2011-03-23
7
266 Views
Last Modified: 2012-05-11
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
Comment
Question by:minglelinch
  • 4
  • 3
7 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 35198658
Yes. Of course any consumers of your service will need to re-import the WSDL if they want to use the new method.
0
 
LVL 1

Author Comment

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

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35198759
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:minglelinch
ID: 35199073
I got it. Thanks a lot !
0
 
LVL 1

Author Comment

by:minglelinch
ID: 35201192
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
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 35201214
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
 
LVL 1

Author Closing Comment

by:minglelinch
ID: 35220172
Great answer.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now