Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 27th, 2007, 07:46 AM
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding web service at runtime

I would like to know if it is possible to add a web reference at runtime i.e programmatically. the url address of the web service is to be stored in a file to be read at runtime. thank you.

ayo

 
Old August 27th, 2007, 08:31 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't add a reference at runtime, but you can certain change the URL for a web reference.

When you create an instance of the web service proxy class, you can set the "Url" property to the Url you get from the file.

Even better, you can set up a web reference to use the 'Dynamic' "Url Behavior" and the Url will be read from the configuration file:
http://www.codeproject.com/soap/wsdldynamicurl.asp

-Peter
 
Old August 28th, 2007, 02:15 AM
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

many thanks peter. the article was very straightforward and helpful

ayo






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a web service mielniczuk BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 April 16th, 2008 01:14 AM
Adding forms at runtime Bhalchandra Pro VB 6 1 April 17th, 2007 12:45 PM
Adding button at runtime ehabinl ASP.NET 1.0 and 1.1 Professional 2 August 7th, 2006 02:46 PM
Adding a reference to a web service loganscott2000 .NET Web Services 1 April 13th, 2005 09:51 PM
CR . Net As a Web Service (Runtime Customization) lala23 Crystal Reports 1 March 27th, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.