dynamic url for my soap server

siep

New member
Joined
Apr 9, 2009
Messages
2
Programming Experience
Beginner
I have a VB program (VB2008) that I need to deploy to many offices. All of them have their own server with database. I use SOAP to access the database.

For testing purposes I added a wsdl located on a specific IP address. For deployment I want to be able to set the wsdl IP address through a parameter.

Anybody know how to do this?
 
You can do this both with the proxy clients constructor and with its Endpoint.Address property.
 
Still need some help - programmatically change URL for WSDL

OK, I have been researching that, but I can't find any VB examples that state what variable I have to set to an IP address, so that it is overwritten. Am I looking for something too simple?
 
Am I looking for something too simple?
IMO, yes :)

Here's an example using the proxy client constructor:
VB.NET:
Dim serv As New ServiceReference1.ServiceSoapClient("ServiceSoap", "http://localhost:50320/WebService1/Service.asmx")
The endpointConfiguration name "ServiceSoap" you have to find in your own sources. You can also create a default instance and check the Endpoint.Contract.Name property.

Here's one example changing the Endpoint.Address property after the instance is created:
VB.NET:
Dim serv As New ServiceReference1.ServiceSoapClient()
serv.Endpoint.Address = New ServiceModel.EndpointAddress("http://localhost:50320/WebService1/Service.asmx")
 
Back
Top