beautypg.com

Echelon i.LON SmartServer 2.0 User Manual

Page 332

background image

i.LON SmartServer 2.0 Programmer’s Reference

20-10

5. A .NET 2.0 client must turn off the keep-alive attribute to communicate with the SmartServer

without exceptions being generated. To turn off the keep-alive attribute, the generated web
reference class must be inherited, and the GetWebRequest method must be overridden, where the
KeepAlive flag can be turned off. The following procedure describes how to do so.

a. Click Project, and then click Add Class. The Add New Item dialog opens.

b. In the Name box, enter “iLON_WebService” and then click Add.

c. Insert a using System.Net statement at the beginning of the ilon_WebService class.

d. Inside the iLON_WebService class, enter the following code to override the GetWebRequest

function so that it turns off the KeepAlive flag: