473,507 Members | 13,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programatically Update WSDL on Consumer Side

I am creating a web service which will be available on only one of two
servers at a time. Both servers will have exactly the same services running
but one will be a backup which just waits doing nothing. They will both have
WSDL files on with
the only difference being the <soap:address location="" /> value in the
<service> element.

The service consumer (ASP.NET pages) will get the current live server to use
from a function (call it GetServer()) which will return a hostname. I want
to update the Web Reference in the project with the WSDL from the host
returned by GetServer().

I figure my options are:
1. Make the project change the URL of the WSDL file it is using and then
recompile the proxy classes. (I dont yet know how to change the URL of the
reference.)
2. Store the WSDL files on the same web server as the ASP.NET pages and make
a seperate program which opens the WSDL file and physically changes the
value.

The problem is i dont know how to make the project update the web reference?
How can i do this?

Any suggestions would be greatfully received.

Thanks
Ben Crinion
Nov 23 '05 #1
3 4148
If all you want to do is point your client to the propery "live" server
at runtime, the all you need to use is the URL property of the proxy
class to programatically change point to the live server.

Example

Public Sub Example()

Dim newUrl as string
newUrl = GetServer()

Dim webProxy as new localhost.webservice 'replace this with you
actual proxy declaration
webProxy.Url = newUrl

webProxy.MyWebMethod() 'replace this with the call to your actual
web method.
End Sub

You don't need to worry about changing the WSDL.

I'd also suggest that you look at setting up a UDDI server. A UDDI
server would give you the proper tools to manage the locations of you
services. With UDDI you can upload a copy of your WSDL. All clients
that want to consume your service can retrieve this WSDL from the UDDI
server and can develop against it. Then, you can configure an access
point in the UDDI service that points to the current live location of
the service that matches your WSDL. The client applications can query
the UDDI server for this access point and can use the code I outlined
above to dynamically point to the live service.As an administrator, you
just need to change the access point in the UDDI server to redirect all
clients to the new location.

Hope that helps.

Peter Kelcey

Nov 23 '05 #2
Thanks, this is exactly the kind of thing i was looking for.

Do you know the location of any recent documentation on creating and using a
UDDI server?

Thanks
Ben

"Peter Kelcey" <Pe**********@telus.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
If all you want to do is point your client to the propery "live" server
at runtime, the all you need to use is the URL property of the proxy
class to programatically change point to the live server.

Example

Public Sub Example()

Dim newUrl as string
newUrl = GetServer()

Dim webProxy as new localhost.webservice 'replace this with you
actual proxy declaration
webProxy.Url = newUrl

webProxy.MyWebMethod() 'replace this with the call to your actual
web method.
End Sub

You don't need to worry about changing the WSDL.

I'd also suggest that you look at setting up a UDDI server. A UDDI
server would give you the proper tools to manage the locations of you
services. With UDDI you can upload a copy of your WSDL. All clients
that want to consume your service can retrieve this WSDL from the UDDI
server and can develop against it. Then, you can configure an access
point in the UDDI service that points to the current live location of
the service that matches your WSDL. The client applications can query
the UDDI server for this access point and can use the code I outlined
above to dynamically point to the live service.As an administrator, you
just need to change the access point in the UDDI server to redirect all
clients to the new location.

Hope that helps.

Peter Kelcey


Nov 23 '05 #3
Windows 2003 ships with a UDDI server component that is an optional add
in.

You can check out the FAQ at

http://www.microsoft.com/windowsserv...t/uddifaq.mspx

and the UDDI developer center at

http://msdn.microsoft.com/nhp/Defaul...entid=28001204

Peter Kelcey

Nov 23 '05 #4

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

Similar topics

2
2838
by: Tomislav Lepusic | last post by:
Hello, I don't know if this is the right group (I'm more in Perl, know nothing about Python), so if you can help me thanks, if not, sorry to bother you. I'm working on my student project and...
4
4739
by: jm | last post by:
I am new to WSDL and familiar with XML, but have used them very little. What I am used to is ASP and now ASP .NET using a datagrid or something like that. What I am trying to find out is when...
0
1928
by: Dave | last post by:
Hi, If anyone could help with this, I would greatly appreciate it! I've created my own WSDL file and referenced an XSD file too. I've generated a service side interface using wsdl /server, and...
0
2113
by: saish | last post by:
Hello I am new to vb.net webservice. My requirement is to design a VB.net web service which will send and receive xml documents. The xml document send and received would be a very complex .xsd...
5
5375
by: Jeff | last post by:
We are using .Net and the wsdl Utility to generate proxies to consume web services built using the BEA toolset. The data architects on the BEA side create XML schemas with various entities in...
1
2944
by: hazz | last post by:
I am starting to get the idea...the xsd's feed the service layer operations and messages. I am beginning to understand it at the abstract level. But at implementation, when the client references a...
3
5380
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate...
0
3560
by: shaily | last post by:
hi I have a java web service called "Registration service" and C# client which is a consumer of that service java web service running under Tomcat has following interface API exposed ...
1
1627
by: =?Utf-8?B?Sm9l?= | last post by:
Hi there I hoping to get a "theoritically that's possible" kind of answer here! What I'm trying to achieve is the ability to present a different schema to the service consumer based on some...
0
7221
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
7109
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
7313
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,...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5619
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
4702
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...
0
3190
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...
0
1537
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 ...
0
411
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...

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.