Solved

web service path in asp.net

Posted on 2009-05-13
1
381 Views
Last Modified: 2013-12-17
Hi,
I have created a webservice in VS.NET 2005  and deployed it in IIS (http://localhost/WebService1/Service.asmx)
Now i created a proxy in asp.net application and called a method like
WebApplication3.localhost.Service1 _service = new WebApplication3.localhost.Service1();
           string x = _service.HelloWorld();
           Response.Write(x);
==============
Keepign in mind if this has to be moved to Test Servers/ Production etc . Can I have this path in
web.config of asp.net application   <add key = "WebServicePath"  value = http://localhost/WebService1/Service.asmx

and then call it in asp.net application (Is it necessary in this case to create proxy) or how can I call this and invoke a method (please let me know the best way to deal with keeping in mind about deployment of asp.net and webservice)
0
Comment
Question by:dotnet0824
1 Comment
 
LVL 18

Accepted Solution

by:
Gary Davis earned 300 total points
ID: 24380869
The web reference can be either dynamic or static (a property). If dynamic, the url will be stored in the appsettings in the web.config for you with an appropriate name.
You also have the opportunity to set the Url property programmatically after instantiation of the web service object and before you call the method.
Gary Davis
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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