I have a class that is designed to work with a web service. At the moment, I wrote it for the request http://www.nanonull.com/TimeService/TimeService.asmx .
The class will be used by an obsolete application using VBScript, so it will be created using the Namespace.ClassName conventions.
I am having trouble writing code to get the bindings and endpoints working with my class, because I cannot use the configuration file. The samples I saw discuss using SvcUtil.exe, but I donβt understand how to do this if the web service is external.
Can someone point me in the right direction? This is what I have so far, and the compiler crashes in IMyService:
var binding = new System.ServiceModel.BasicHttpBinding(); var endpoint = new EndpointAddress("http://www.nanonull.com/TimeService/TimeService.asmx"); var factory = new ChannelFactory<IMyService>(binding, endpoint); var channel = factory.CreateChannel(); HelloWorld = channel.getCityTime("London");
E. Rodriguez
source share