Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Unlike service proxies created in Visual Studio (which use separate definition files), you must explicitly initialize your proxy object before use. For example, you can use the following code in your Start() method [Also see the sample templates included with Connexion]:

//init the bing service. The values you use here should match the contents of the wsdl file for your service.
//Binding - choose a binding which is defined in the wsdl. You can set security in the binding.security classes.
BasicHttpBinding binding = new BasicHttpBinding();
//the uri of the web service.
EndpointAddress endpoint = new EndpointAddress("http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc");

var serviceFactory = new ChannelFactory<IGeocodeService>(binding, endpoint);
m_BingService = serviceFactory.CreateChannel();
if(m_BingService != null)
Logger.Debug("Successfully created proxy to Bing geocode service.");


To remove an existing service reference, right-click the reference and select Remove Reference.

Using Resources