Ask a Question related to ASP.NET Web Services, Design and Development.
-
sendhil #1
Web References
hi,
There are 10 machines which run the same webservice. I have 10
webreferences in my client. Only during runtime, will i decide which
webservice to call.
I dont want to have a swich case statement and handle the 10
situations separately. Is it possible to create objects of the
webreferences dynamically.
I have created 10 objects and put it in an Arraylist. But i dont
know how to call the Webmethod, by getting the object from the
ArrayList. can anyone solve my problem?
Thanks
sendhil
sendhil Guest
-
Getting references
How does one get a reference to a previously created object? Here's the scenario. I'm writing a web application, so there's a listener object... -
[PHP-DEV] References
The current support for references is mediocre at best. For instance: class foobar { var $variable; function foobar() { $variable =... -
ASP.net using UNC references and IIS 5.0
I am having trouble getting ANY asp.net application (either .aspx or .asmx) working when IIS is configured to use a "share located on another... -
references help
Hi, I need some desperate help with my references usage in the code below. I'd appreciate the help enormously. Following is the input in the... -
references
Ok lets see I have the following two functions one calls the other Function a (&$myref) { ...something... then calls function b b($myref); ... -
Manni #2
Re: Web References
Hi sendhil!
If understand you right you have 10 times the same webservice!
So first of all you can say - you have 1 webservice with 10 different URLs!?
If that is right - you just have to add one refference - and 9 "extra urls"
(or better 10 urls).
So make an array (of strings) with that 10 URLs.
Then call your WS with a 2 lines instead of 1 line
theSvcRef.Url=stringArr[numberYouChose];
theSvcRef.TheMethod();
or if you (why ever) have to call all of them and dont want two lines of
code do:
object [] arrSvcs=new object[10];
arrSvcs[0]=new TheSvcNS.SevName();
((TheSvcNS.SevName)arrSvc[0]).Url=strURL1;
arrSvcs[1]=new TheSvcNS.SevName();
((TheSvcNS.SevName)arrSvc[1]).Url=strURL2;
arrSvcs[2]=new TheSvcNS.SevName();
((TheSvcNS.SevName)arrSvc[3]).Url=strURL3;
and later call it (for an example in a lopp):
for(int nInd=0;nInd<10;nInd++) {
((TheSvcNS.SevName)arrSvc[0]).TheMethod();
}
HTH
Manfred
"sendhil" <report_1979@yahoo.com> schrieb im Newsbeitrag
news:97ce4388.0311271457.5eb69ca5@posting.google.c om...> hi,
> There are 10 machines which run the same webservice. I have 10
> webreferences in my client. Only during runtime, will i decide which
> webservice to call.
>
> I dont want to have a swich case statement and handle the 10
> situations separately. Is it possible to create objects of the
> webreferences dynamically.
>
> I have created 10 objects and put it in an Arraylist. But i dont
> know how to call the Webmethod, by getting the object from the
> ArrayList. can anyone solve my problem?
>
> Thanks
> sendhil
Manni Guest
-
sendhil #3
Re: Web References
hi Manfred,
Iam calling the same WebService 10 times. But they are in 10
different machines. so i will have 10 different Webreferences ..right.
so i can't just change the URL every time with one Webreference.
Thanks
sendhil
"Manni" <pcpohler@hotmail.com> wrote in message news:<#54hY1TtDHA.2456@TK2MSFTNGP12.phx.gbl>...> Hi sendhil!
>
> If understand you right you have 10 times the same webservice!
> So first of all you can say - you have 1 webservice with 10 different URLs!?
>
> If that is right - you just have to add one refference - and 9 "extra urls"
> (or better 10 urls).
>
> So make an array (of strings) with that 10 URLs.
> Then call your WS with a 2 lines instead of 1 line
>
> theSvcRef.Url=stringArr[numberYouChose];
> theSvcRef.TheMethod();
>
> or if you (why ever) have to call all of them and dont want two lines of
> code do:
> object [] arrSvcs=new object[10];
> arrSvcs[0]=new TheSvcNS.SevName();
> ((TheSvcNS.SevName)arrSvc[0]).Url=strURL1;
> arrSvcs[1]=new TheSvcNS.SevName();
> ((TheSvcNS.SevName)arrSvc[1]).Url=strURL2;
> arrSvcs[2]=new TheSvcNS.SevName();
> ((TheSvcNS.SevName)arrSvc[3]).Url=strURL3;
>
> and later call it (for an example in a lopp):
> for(int nInd=0;nInd<10;nInd++) {
> ((TheSvcNS.SevName)arrSvc[0]).TheMethod();
> }
>
> HTH
>
> Manfred
>
>sendhil Guest
-
Manni #4
Re: Web References
Sorry but I don't understand why you need 10 References!!!
Maybe I misunderstood something, but you say it is the same Webservice.
Wich means for me, it has the same functions!
If it is like this - I have only the need for one reference!
Or let's better say I have the need for one "proxy".
And one time this WS runs on [url]http://mymachine1.dom.com/TheSvc/Svc.asmx[/url]
and the other time it runs on
[url]http://othermachine2.otherdom.net/OtherPath/othername.asmx[/url]
If it is like this - there is no need for 10 refs!!
My approach will work in this case!!
We for an example have an application, where every customer owns it's own
database.
This DB is accessed via webservices. This WS can run on our server, or on an
extra
server for the customer.
In simple words - if the customer is small - his DB (and WS) will run on
one of our servers.
If the customer is big, he owns his web- an dbserver.
First of all - the application calls a central server, does authentication
and as a result it gets the
URL of the customers server. The next call goes to this server. Wich it is
will be figured out at
runtime - AND we have only one reference per WS we use!!
So ONE ref 20 and more servers!
Manfred
"sendhil" <report_1979@yahoo.com> schrieb im Newsbeitrag
news:97ce4388.0311281332.54c0884f@posting.google.c om...news:<#54hY1TtDHA.2456@TK2MSFTNGP12.phx.gbl>...> hi Manfred,
> Iam calling the same WebService 10 times. But they are in 10
> different machines. so i will have 10 different Webreferences ..right.
> so i can't just change the URL every time with one Webreference.
>
> Thanks
> sendhil
>
> "Manni" <pcpohler@hotmail.com> wrote in messageURLs!?> > Hi sendhil!
> >
> > If understand you right you have 10 times the same webservice!
> > So first of all you can say - you have 1 webservice with 10 differenturls"> >
> > If that is right - you just have to add one refference - and 9 "extra> > (or better 10 urls).
> >
> > So make an array (of strings) with that 10 URLs.
> > Then call your WS with a 2 lines instead of 1 line
> >
> > theSvcRef.Url=stringArr[numberYouChose];
> > theSvcRef.TheMethod();
> >
> > or if you (why ever) have to call all of them and dont want two lines of
> > code do:
> > object [] arrSvcs=new object[10];
> > arrSvcs[0]=new TheSvcNS.SevName();
> > ((TheSvcNS.SevName)arrSvc[0]).Url=strURL1;
> > arrSvcs[1]=new TheSvcNS.SevName();
> > ((TheSvcNS.SevName)arrSvc[1]).Url=strURL2;
> > arrSvcs[2]=new TheSvcNS.SevName();
> > ((TheSvcNS.SevName)arrSvc[3]).Url=strURL3;
> >
> > and later call it (for an example in a lopp):
> > for(int nInd=0;nInd<10;nInd++) {
> > ((TheSvcNS.SevName)arrSvc[0]).TheMethod();
> > }
> >
> > HTH
> >
> > Manfred
> >
> >
Manni Guest
-
Chris Leffer #5
Web references
Hi.
I wrote two simple web services to start learning about them. When I
called the two web services from an asp.net client, the Add Web
Reference dialog created two entries in my project, localhost and
localhost1. How can I add the two web services inside localhost for
example? Why .NET defines one entry for each web service by default?
Regards,
Chris Leffer
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Chris Leffer Guest
-
Jan Tielens #6
Re: Web references
You must name each Webreference, you can do this in the dialog window when
you add the webrefence, or from the Solution Explorer window (rename the
Webservice node). You cannot name 2 webservices with the same name because
their name will reflect to the namespace the will be in.
--
Greetz,
Jan
__________________________________
Read my weblog: [url]http://weblogs.asp.net/jan[/url]
"Chris Leffer" <chrisl@wank.com> schreef in bericht
news:eCRxax%23vDHA.2540@TK2MSFTNGP10.phx.gbl...> Hi.
>
> I wrote two simple web services to start learning about them. When I
> called the two web services from an asp.net client, the Add Web
> Reference dialog created two entries in my project, localhost and
> localhost1. How can I add the two web services inside localhost for
> example? Why .NET defines one entry for each web service by default?
>
> Regards,
> Chris Leffer
>
>
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Jan Tielens Guest



Reply With Quote

