473,775 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic WebReference URL

Hi.

Using VStudio I have developed a WebService which I placed onto several
servers. However my application can only access one on server.

During runtime, I tried to change the URL of the webreference to the other
server but that does not work -- the webreference still thinks it is the old
one and errors out.

I need to be able to dynamically switch from one server to the other, but
have the same service on both servers. It seems that VS webreferences do
not allow this.

Any insight into this problem is much appreciated.

I hope I was clear enough in describing it.

Thanks,

Kimba
Feb 20 '06 #1
5 6218
Set the URL property to Dynamic and the generated proxy code will retrieve
the value from the application config file (check the proxy code to see
under hwihc key it should be stored).

Else you can also change programmaticaly the url property (perhaps write
down this just before calling the service in case you mistakenly changed
this not at the right location, especially if you create the service several
times).

--
Patrice

"Kimba" <ki***@nospam.n ospam> a écrit dans le message de
news:uS******** ******@TK2MSFTN GP11.phx.gbl...
Hi.

Using VStudio I have developed a WebService which I placed onto several
servers. However my application can only access one on server.

During runtime, I tried to change the URL of the webreference to the other
server but that does not work -- the webreference still thinks it is the old one and errors out.

I need to be able to dynamically switch from one server to the other, but
have the same service on both servers. It seems that VS webreferences do
not allow this.

Any insight into this problem is much appreciated.

I hope I was clear enough in describing it.

Thanks,

Kimba

Feb 20 '06 #2
Your suggestion works if I change them and then recompile my application.

But I need to do this while the application is running.

With SOAP 3.0 you could specify the WSDL (file, string, or url) during
initialization. Then you could reference the WebServices. My code use to
work with SOAP 3.0. I need the same functionality.
When I change the URL in my basic code (where sURL refers to the desired
Server not the "compiled" server name):
My.Settings.Web SignServicesURL = sURL

svcWebSign = New WebSignConsole. WebSignServer.S ervice

svcWebSign.Cred entials = cc

svcWebSign.Url = sURL

The WSDL does not seem to change and the old server is still referenced.
Then I get the following exception:

"System.Web.Ser vices.Protocols .SoapException: Server did not recognize the
value of HTTP Header SOAPAction: https://wst0002/WebSignServices/UserVerify.

at System.Web.Serv ices.Protocols. Soap11ServerPro tocolHelper.Rou teRequest()

at
System.Web.Serv ices.Protocols. SoapServerProto col.RouteReques t(SoapServerMes sage
message)

at System.Web.Serv ices.Protocols. SoapServerProto col.Initialize( )

at System.Web.Serv ices.Protocols. ServerProtocolF actory.Create(T ype type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing )"



"Patrice" <a@bc.c> wrote in message
news:um******** ******@TK2MSFTN GP11.phx.gbl...
Set the URL property to Dynamic and the generated proxy code will retrieve
the value from the application config file (check the proxy code to see
under hwihc key it should be stored).

Else you can also change programmaticaly the url property (perhaps write
down this just before calling the service in case you mistakenly changed
this not at the right location, especially if you create the service
several
times).

--
Patrice

"Kimba" <ki***@nospam.n ospam> a écrit dans le message de
news:uS******** ******@TK2MSFTN GP11.phx.gbl...
Hi.

Using VStudio I have developed a WebService which I placed onto several
servers. However my application can only access one on server.

During runtime, I tried to change the URL of the webreference to the
other
server but that does not work -- the webreference still thinks it is the

old
one and errors out.

I need to be able to dynamically switch from one server to the other, but
have the same service on both servers. It seems that VS webreferences do
not allow this.

Any insight into this problem is much appreciated.

I hope I was clear enough in describing it.

Thanks,

Kimba


Feb 20 '06 #3
Hi Kimba,

Normally, if the webservice on different servers are exactly the same ones,
we can just use the single webservice client proxy by programmaticall y
change its Url property at runtime(or change the config file). However,
there are something which may prevent the generated client proxy from
sharing accross multiple webservices on different server. In your case, the
error message indicate that the SOAP Action http header is not recognized
by the server, is the below soap header the one works on your another
server but different from the current server where you get error?

"https://wst0002/WebSignServices/UserVerif"

Or in other words, is the webservice on current server apply a different
namespace from the original server's webservice code?

If this is the case, we do need to regenerate webservice proxy since SOAP
Action header is compiled into the proxy code from the service(WSDL)'s
namespace...

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Feb 21 '06 #4
My suggestion is not about recompiling. It's just to tell that it should
work either :
- by letting the proxy read the web service location from the application
config file (the service has a property to include the appropriate code)
- by changing yourself this property at runtime based on whatever you want
(for exemple the location of the code)

Here it looks like to me that you have a problem in talking to a different
webservice. Are you sure that both services are exactly the same or could
you have different versions on those two servers ?

Also I don't see why you would expect the WSDL to change ? The WSDL is
create server side and having the client connect to a service doesn't change
the WSDL description ?

I'm strating to wxonder if you try to connect to services that are *not* the
same on those twoservers ?

It works fine here...

--
Patrice

"Kimba" <ki***@nospam.n ospam> a écrit dans le message de
news:OC******** ******@TK2MSFTN GP14.phx.gbl...
Your suggestion works if I change them and then recompile my application.

But I need to do this while the application is running.

With SOAP 3.0 you could specify the WSDL (file, string, or url) during
initialization. Then you could reference the WebServices. My code use to
work with SOAP 3.0. I need the same functionality.
When I change the URL in my basic code (where sURL refers to the desired
Server not the "compiled" server name):
My.Settings.Web SignServicesURL = sURL

svcWebSign = New WebSignConsole. WebSignServer.S ervice

svcWebSign.Cred entials = cc

svcWebSign.Url = sURL

The WSDL does not seem to change and the old server is still referenced.
Then I get the following exception:

"System.Web.Ser vices.Protocols .SoapException: Server did not recognize the
value of HTTP Header SOAPAction: https://wst0002/WebSignServices/UserVerify.
at System.Web.Serv ices.Protocols. Soap11ServerPro tocolHelper.Rou teRequest()

at
System.Web.Serv ices.Protocols. SoapServerProto col.RouteReques t(SoapServerMes s
age message)

at System.Web.Serv ices.Protocols. SoapServerProto col.Initialize( )

at System.Web.Serv ices.Protocols. ServerProtocolF actory.Create(T ype type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing )"



"Patrice" <a@bc.c> wrote in message
news:um******** ******@TK2MSFTN GP11.phx.gbl...
Set the URL property to Dynamic and the generated proxy code will retrieve the value from the application config file (check the proxy code to see
under hwihc key it should be stored).

Else you can also change programmaticaly the url property (perhaps write
down this just before calling the service in case you mistakenly changed
this not at the right location, especially if you create the service
several
times).

--
Patrice

"Kimba" <ki***@nospam.n ospam> a écrit dans le message de
news:uS******** ******@TK2MSFTN GP11.phx.gbl...
Hi.

Using VStudio I have developed a WebService which I placed onto several
servers. However my application can only access one on server.

During runtime, I tried to change the URL of the webreference to the
other
server but that does not work -- the webreference still thinks it is the
old
one and errors out.

I need to be able to dynamically switch from one server to the other,

but have the same service on both servers. It seems that VS webreferences do not allow this.

Any insight into this problem is much appreciated.

I hope I was clear enough in describing it.

Thanks,

Kimba



Feb 21 '06 #5
Case Closed.

Thanks so much for your persistent help.

You were correct in all aspects.

The WebService namespace was different on each server's .ASMX -- my bad.

Now my application users can "login" to any server and expect (and get) the
same web services.

I have to really compliment the VStudio team on their latest version.

I have been porting: GUI, SQL Server database, WinHTTP, and SOAP code from
the VStudio 6.0 to VStudio 2005.

There are so many great improvements -- I am really quite astounded and
pleased.



"Patrice" <a@bc.c> wrote in message
news:uo******** *****@TK2MSFTNG P15.phx.gbl...
My suggestion is not about recompiling. It's just to tell that it should
work either :
- by letting the proxy read the web service location from the application
config file (the service has a property to include the appropriate code)
- by changing yourself this property at runtime based on whatever you want
(for exemple the location of the code)

Here it looks like to me that you have a problem in talking to a different
webservice. Are you sure that both services are exactly the same or could
you have different versions on those two servers ?

Also I don't see why you would expect the WSDL to change ? The WSDL is
create server side and having the client connect to a service doesn't
change
the WSDL description ?

I'm strating to wxonder if you try to connect to services that are *not*
the
same on those twoservers ?

It works fine here...

--
Patrice

"Kimba" <ki***@nospam.n ospam> a écrit dans le message de
news:OC******** ******@TK2MSFTN GP14.phx.gbl...
Your suggestion works if I change them and then recompile my application.

But I need to do this while the application is running.

With SOAP 3.0 you could specify the WSDL (file, string, or url) during
initialization. Then you could reference the WebServices. My code use
to
work with SOAP 3.0. I need the same functionality.
When I change the URL in my basic code (where sURL refers to the desired
Server not the "compiled" server name):
My.Settings.Web SignServicesURL = sURL

svcWebSign = New WebSignConsole. WebSignServer.S ervice

svcWebSign.Cred entials = cc

svcWebSign.Url = sURL

The WSDL does not seem to change and the old server is still referenced.
Then I get the following exception:

"System.Web.Ser vices.Protocols .SoapException: Server did not recognize
the
value of HTTP Header SOAPAction:

https://wst0002/WebSignServices/UserVerify.

at
System.Web.Serv ices.Protocols. Soap11ServerPro tocolHelper.Rou teRequest()

at

System.Web.Serv ices.Protocols. SoapServerProto col.RouteReques t(SoapServerMes s
age
message)

at System.Web.Serv ices.Protocols. SoapServerProto col.Initialize( )

at System.Web.Serv ices.Protocols. ServerProtocolF actory.Create(T ype type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing )"



"Patrice" <a@bc.c> wrote in message
news:um******** ******@TK2MSFTN GP11.phx.gbl...
> Set the URL property to Dynamic and the generated proxy code will retrieve > the value from the application config file (check the proxy code to see
> under hwihc key it should be stored).
>
> Else you can also change programmaticaly the url property (perhaps
> write
> down this just before calling the service in case you mistakenly
> changed
> this not at the right location, especially if you create the service
> several
> times).
>
> --
> Patrice
>
> "Kimba" <ki***@nospam.n ospam> a écrit dans le message de
> news:uS******** ******@TK2MSFTN GP11.phx.gbl...
>> Hi.
>>
>> Using VStudio I have developed a WebService which I placed onto
>> several
>> servers. However my application can only access one on server.
>>
>> During runtime, I tried to change the URL of the webreference to the
>> other
>> server but that does not work -- the webreference still thinks it is the > old
>> one and errors out.
>>
>> I need to be able to dynamically switch from one server to the other, but >> have the same service on both servers. It seems that VS webreferences do >> not allow this.
>>
>> Any insight into this problem is much appreciated.
>>
>> I hope I was clear enough in describing it.
>>
>> Thanks,
>>
>> Kimba
>>
>>
>
>



Feb 21 '06 #6

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

Similar topics

7
3729
by: Craig Storey | last post by:
I have a little php application to store day hiking trips and to keep a running total of their yearly trips for a few users. Currently they select their hiking routes using drop lists or checkboxes containing the names and numbers of the trails. If the route is simple the form takes 1-2 minutes to fill in, if it involves lots of tiny sections it can become tedious to search for every trailname and may take 20 minutes. Because of this...
0
1658
by: Randy L | last post by:
Is it possible to add a reference to a webservice programmatically in a Windows Form application? Basically I am looking to provide a list of URLs to the WinForm client which would then add the WebReference, do the discovery, and call a WebMethod. Any insight would be appreciated. thanks in advance...
5
1552
by: Søren Reinke | last post by:
Hi there I have 1 solution (visual studio 2005) within this solution i have many projects, they should all be able to have the same webreference to a webservice. But as far as i can figure out, i must have 1 webreference per project, and not 1 for the whole solution. How can i solve this ?
5
3088
by: Ron | last post by:
I have a bunch of Crystal Reports (v9) published as WebServices and use a ReportViewer to display the reports on the ASPNET page. Everytime we move the reports from dev to production we have to open the reports and manually change the datasouce to the production database. Is there a way to set the datasouce on the webserviced reports dynamically? (A datasource property or something?) cant seem to find anything. Thanks!
0
2073
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab, System and Software Engineering Lab), ULB (deComp) and the Belgian Association for Dynamic Languages (BADL) are very pleased to invite you to a whole day of presentations about the programming languages Self, Smalltalk and Common Lisp by experts in...
0
1192
by: Roland Müller | last post by:
Hello, i want to test asynchron webservices. I have a test console solution in Visual Studio 2005 where the webreference residents for the webservice. But now in the reference.cs there are no begin/end methods for the webmethods of the webservice. Do i miss some configuration? Thanks,
1
1388
by: Bruno Alexandre | last post by:
Hi Guys, I already build my "wonderful" webService and it returs DataSets exactly like I want, and it does wonderful things... but... Now that I develop a Window Forms application that consume that web service, I need to change the WS from my local machine to the Client machine (so, I will change the WS address), I want to compile the Window Form App
0
2552
by: taylorjonl | last post by:
I am having a problem generating some soap proxies dynamically using almost the exact same code as in the MSDN sample. http://msdn2.microsoft.com/en-us/library/system.web.services.description.webreference(VS.80).aspx It has very few differences, mainly I had to manipulate the document to remove the Any tags that caused 400+ validation warnings but even after getting the WebReference object ValidationWarnings to 0, it says...
5
2585
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization algorithm to solve a certain messy problem, and many different things. For that I often use several general modules that I have written, like implementation of certain data structures, and small general "utility" functions/classes, plus of course...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8939
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7464
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4017
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.