Echelon i.LON SmartServer Technical Information Page 334

  • Download
  • Add to my manuals
  • Print
  • Page
    / 443
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 333
i.LON SmartServer 2.0 Programmer’s Reference
20-12
namespace SmartServerConsoleExample
{
class iLON_SoapCalls
{
// your SmartServer's IpAddress
public static string _iLonEndpointIpAddress = "<SmartServer IP address>";
// your SmartServer’s Web service reference
static public iLON_SmartServer.iLON100portTypeClient _iLON = null;
/// <summary>
/// Instantiates the SmartServer Web service for
/// .NET 3.5
/// </summary>
static public void BindClientToSmartServer()
{
// Specify the binding to be used for the client.
BasicHttpBinding binding = new BasicHttpBinding();
// Initialize the namespace
binding.Namespace = "http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/";
// Obtain the URL of the Web service on the i.LON SmartServer.
System.ServiceModel.EndpointAddress endpointAddress
= new System.ServiceModel.EndpointAddress("http://"
+ _iLonEndpointIpAddress + "/WSDL/iLON100.wsdl");
// Instantiate the SmartServer Web service object with this address and binding.
_iLON = new iLON_SmartServer.iLON100portTypeClient(binding, endpointAddress);
// Uncommment the lines below to enable authentication
// binding.Security.Mode =
// System.ServiceModel.BasicHttpSecurityMode.TransportCredentialOnly;
// binding.Security.Transport.ClientCredentialType =
// System.ServiceModel.HttpClientCredentialType.Basic;
// _iLON.ChannelFactory.Credentials.UserName.UserName = "ilon";
// _iLON.ChannelFactory.Credentials.UserName.Password = "ilon";
}
/// <summary>
/// Close the SmartServer Web service
///
</summary>
static public void CloseBindingToSmartServer()
{
// Closing the client gracefully
// closes the connection and cleans up resources
try
{
_iLON.Close();
}
finally
{
_iLON = null;
}
}
}
}
Page view 333
1 2 ... 329 330 331 332 333 334 335 336 337 338 339 ... 442 443

Comments to this Manuals

No comments