1

i store web service url in web.config or app.config. when i call web service like

 ServiceAvailabilityTestClient.TestClient servAvailClient = new ServiceAvailabilityTestClient.TestClient();
servAvailClient.url= myapp.config url here.
servAvailClient.CallValidateCityPostalCodeZip();

the problem is the property called url is not appearing. sp please tell me what to do. i just add wsdl file location as service reference because web service path called not being added. web service url which i try to add as web service reference is

https://devwebservices.purolator.com/EWS/V1/ServiceAvailability/ServiceAvailabilityService.asmx

1) i just not being able why i am not being able to add this web service url as service reference

2) why url property is not exposed in client side.

can anyone guide me what is the matter. thanks

Thomas
  • 33,544
  • 126
  • 357
  • 626
  • http://stackoverflow.com/questions/5036308/dynamically-switch-wcf-web-service-reference-url-path-through-config-file http://stackoverflow.com/questions/1317982/how-to-config-clients-for-a-wcf-service http://www.codeproject.com/Articles/12317/How-to-make-your-Web-Reference-proxy-URL-dynamic – Thomas Nov 06 '12 at 09:51

2 Answers2

1

You could do it through your generated client or ChannelFactory:

var client = ChannelFactory(IWcfService).CreateChannel(Binding, ServiceModel.EndpointAdress)

or 

var client = New Client(binding, RemoteAdress)

EndpointAdress just takes string or uri in constructor e.g.http://yourservice.asmx

Zong
  • 6,160
  • 5
  • 32
  • 46
msjonathan
  • 514
  • 2
  • 11
  • 26
  • how could i determine the web service has been developed by classic web service or wcf if extension is not there in web service url. – Thomas Nov 06 '12 at 13:45
0

Are you using the <System.ServiceModel/> config section? If so you shouldn't have to do anything - the URL will be loaded from the <client/> section of the config when you create the channel.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • how could i determine the webservice has been developed by classic web service or wcf if extension is not there in web service url. – Thomas Nov 06 '12 at 13:44