473,385 Members | 1,958 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,385 software developers and data experts.

dinamic reference to WS

Hello:
I want to create a class that i could use to call a web service without
adding the web reference from Visual Studio. That's because the url to the
..asmx o wsdl document will be given by te user at runtime.
How can i code this? Is it too complex?
Any information, code snippets or links to howtos will be wellcome.
Thanks.
Bye.
Nov 23 '05 #1
5 2201
It's simple.

In the application that consumes the web service go ahead and make the web
reference as usual. The difference is that you set the "URL Behavior"
property to "Dynamic". Doing so within visual stuidio will automatically
modify the proxy class and the web.config (app.config) file to have a key
with the URL to the web service.

The consumer would then just change the value of the key for the location of
the web service to be loaded at runtime.

--
-Demetri
"Javier" wrote:
Hello:
I want to create a class that i could use to call a web service without
adding the web reference from Visual Studio. That's because the url to the
.asmx o wsdl document will be given by te user at runtime.
How can i code this? Is it too complex?
Any information, code snippets or links to howtos will be wellcome.
Thanks.
Bye.

Nov 23 '05 #2
Javier,
You should have a url for a "development" version of that web service. Said
that
, you can add the webreference to VisualStudio to that asmx and then at
runtime change the url to the actual asmx.

at runtime...
dim mywebservice = New webreference.mywebservice
mywebservice.Url = "actualurl.asmx"

Regards,
Alexis

"Javier" wrote:
Hello:
I want to create a class that i could use to call a web service without
adding the web reference from Visual Studio. That's because the url to the
.asmx o wsdl document will be given by te user at runtime.
How can i code this? Is it too complex?
Any information, code snippets or links to howtos will be wellcome.
Thanks.
Bye.

Nov 23 '05 #3
Hello:
Thanks for te answer, but i have a doubt. When i want to call to one method
of the service, the "development" web service must have the same methods than
the service that will be used at runtime, isn't it?
What i want to say is that i can change the url only if the new url points
to a service with the same interface, same methods and parameters for these
methods but i can't use it to call different web services with differents
method names and different parameters, isn't it?
Thanks for the help.
Bye.

"Demetri" wrote:
It's simple.

In the application that consumes the web service go ahead and make the web
reference as usual. The difference is that you set the "URL Behavior"
property to "Dynamic". Doing so within visual stuidio will automatically
modify the proxy class and the web.config (app.config) file to have a key
with the URL to the web service.

The consumer would then just change the value of the key for the location of
the web service to be loaded at runtime.

--
-Demetri
"Javier" wrote:
Hello:
I want to create a class that i could use to call a web service without
adding the web reference from Visual Studio. That's because the url to the
.asmx o wsdl document will be given by te user at runtime.
How can i code this? Is it too complex?
Any information, code snippets or links to howtos will be wellcome.
Thanks.
Bye.

Nov 23 '05 #4
The web service that is used must have the same methods that your proxy class
has defined begin and end points to and those methods must have the same
signature as your proxy class has defined them as. This means that the web
service could have MORE methods than the proxy class has defined, which is
fine.

If you are worried about the signatures not being the same and can forsee
that this could indeed be the case between your dev and prod environments
then perhaps you should look into deprecation rather than changing the
parameters for already established methods that are in dev and prod.

Does that make sense?

--
-Demetri
"Javier" wrote:
Hello:
Thanks for te answer, but i have a doubt. When i want to call to one method
of the service, the "development" web service must have the same methods than
the service that will be used at runtime, isn't it?
What i want to say is that i can change the url only if the new url points
to a service with the same interface, same methods and parameters for these
methods but i can't use it to call different web services with differents
method names and different parameters, isn't it?
Thanks for the help.
Bye.

"Demetri" wrote:
It's simple.

In the application that consumes the web service go ahead and make the web
reference as usual. The difference is that you set the "URL Behavior"
property to "Dynamic". Doing so within visual stuidio will automatically
modify the proxy class and the web.config (app.config) file to have a key
with the URL to the web service.

The consumer would then just change the value of the key for the location of
the web service to be loaded at runtime.

--
-Demetri
"Javier" wrote:
Hello:
I want to create a class that i could use to call a web service without
adding the web reference from Visual Studio. That's because the url to the
.asmx o wsdl document will be given by te user at runtime.
How can i code this? Is it too complex?
Any information, code snippets or links to howtos will be wellcome.
Thanks.
Bye.

Nov 23 '05 #5
hB
check uddi.
goto uddi server, locate the websvc, get asmx...
u can ask for whole interface WSDL of a webservice then.
(u need and interface to call the runtime... identified web svc)(u cant
then generate proxy class of course)

---
hB

Nov 23 '05 #6

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

Similar topics

4
by: raulgz | last post by:
hi I need generate dinamic sql: I need a select sentence with all fields of one table 't1' and all fields of tables which 't1' have foreings keys 't1 ( reflexive ) ,t2,t3,...' Now, l have de...
1
by: dddddd | last post by:
i need do create simple dinamic site - built mainly of pictures(they are the only dinamic part). pictuers differ by the -Location- and by -Time- (in which they were taken)... so on the index...
3
by: Jose Garcia | last post by:
Hi there, Can somebody explain me how can i use matrixes with dinamic memory? I use malloc and free (NOT new & delete). I want to access to the matrix like Matrix but i don't know how to do that...
6
by: gp | last post by:
Hi all, I'm using Microsoft Visual C++ 6.0, I would like to see, debugging my project, all the elements of my dinamic objects.... I have a dinamic array and a STL vector and I need to know...
7
by: Morgan | last post by:
I have read much posts on the argument but no one clearly says if this operation is possible or not. Simply I have a routine which reads from a text file some integer arrays (1 or 2D). The...
10
by: javuchi | last post by:
I just want to share some code with you, and have some comments and improvements if you want. This header file allocates and add and delete items of any kind of data from a very fast array: ...
0
by: Juan Segura | last post by:
Hello: I developing a filter for ISA Server. This filter is a dinamic dll not compatible with clr (Common Language Runtime). I'm trying to make a dimanic dll compatible with clr and call it...
1
by: rutigold | last post by:
i'm looking for a javaScript function to print a dinamic page. and to determine the direction of print (to the width of the page) thanks, Mikalush
4
by: lupus | last post by:
I guess what I have to do is quite simple, but I'm really stuck! I need to create, in a form, a particular number "i" of "Button"s (i is given at runtime), whose reference name should be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.