473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with my my Hello World web service

I created my first simple web service on my local PC> I tested it using the
test page that is generated for you. I then created a standalone app, and
in the IDE, set a reference to the local web service. I was able to call it
successfully.

The next step, I want to move it to a remote server and try to call that. I
expect that that shoudl work.

What I do not know how to do is this:

I would like to make the URL of the location of the web service
dynamic/parameterized or read from a file, so when I release the web app
consumer program, I can change the consumer to point to either the
production or development web service.

Many thanks for any feedback


Jan 27 '06 #1
1 1451
You have a couple options. In the properties of your WebReference, you can
set the UrlBehavior property to Dynamic. This will create an entry in the
web.config file for your web service that you can edit.

A better way IMO is to leave the WebReference UrlBehavior set to Static but
after you instantiate the proxy in your application you can simply set the
Url property to whatever you want. In the environment where I work, we do
this to configure for local, development, test, or production environments.

In web.config, add an entry:

<add key="WSUrl-Production"
value="http://mywebserver/mywebserviceapp/my.asmx">

Then, in code we get the url for the environment we're in:

MyWebService.Proxy proxy = new MyWebService.Proxy();
proxy.Url = System.Configuration.ConfigurationSettings.AppSett ings["WSUrl-"
+ currentEnvironment];

While I do it in we.config in my environment, you could do it in app.config
the same way for WinForms.

That's all there is to it.

HTH
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Chad" wrote:
I created my first simple web service on my local PC> I tested it using the
test page that is generated for you. I then created a standalone app, and
in the IDE, set a reference to the local web service. I was able to call it
successfully.

The next step, I want to move it to a remote server and try to call that. I
expect that that shoudl work.

What I do not know how to do is this:

I would like to make the URL of the location of the web service
dynamic/parameterized or read from a file, so when I release the web app
consumer program, I can change the consumer to point to either the
production or development web service.

Many thanks for any feedback


Jan 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Martin | last post by:
I am a PHP newbie (just got my "Hello World" page working this morning). I'm doing some R&D work to see if PHP is viable for a situation I have. To accomplish what I want to do, I have to have the...
0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
1
by: Ragnar Midtskogen | last post by:
Hello, I am trying to get an ASP.NET application to run on a new Windows Server 2003 Standard box. I know very little about ASP.NET applications, but we have the same application running fine...
2
by: Mike R | last post by:
Hi, I've used the wizard to create the "Hello World" webservice it compiles and I can access it via the http://server/site/myws.asmx However, when I try and access it via a soap call, soap...
1
by: John Thompson | last post by:
Hello, I recently developed the hello world web service in Visual Studio 2005. If I right-click on the Service.asmx file that is created, everything works fine in Visual Studio. After...
2
by: Ken Crismon | last post by:
Hello, I am currently working on an embedded systems project where by I have written a small web server that is being hosted on our internet appliance (running on an Atmega128 chip and doing...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: pritch20001 | last post by:
Hi, I have been asked to build a simple web service by Friday and wondered if someone could help me out with a couple of questions. All I need to do is pass the contents of an XML file to...
11
by: cj | last post by:
Perhaps someone knows how to do this. When I open a new ASP.NET web service application in VS 2008, it opens with a simple Hello World web service already written. I want to see this work. ...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.