beautypg.com

Programming samples, Manually creating the parameter, Programming samples -3 – Echelon i.LON 100 e2 Internet Server User Manual

Page 210: Manually creating the parameter -3, 2 programming samples, 1 manually creating the parameter

background image

i.

LON 100 Internet Server Programmer’s Reference

14-3

14.2 Programming Samples

This section contains programming samples written in Visual Basic .NET that you may find
useful when creating applications that use the SOAP interface. As described in Chapters 4-

13 of this document, the input data supplied to each of the

i.

LON 100 SOAP functions for the

Data Server, Data Logger, Alarm Generator, Alarm Notifier, Analog Function Block, Event
Scheduler, Event Calendar, Type Translator application is a string of encoded XML

containing a list of objects and values.

This string must be passed to the

i.

LON 100 within the parameter of the SOAP

message the function generates. Visual Basic .NET provides several ways to generate this

string and pass it to the parameter.

As noted, the programming examples in this section are written in Visual Basic .NET. For

example applications written for other SOAP developmenent environments, please go to the

i

.LON Product family Web page on Echelon’s Web site at

http://www.echelon.com/ilon

and

select the “

i

.LON How-Tos and Other Internet Connectivity Resources“ link to enter the

i

.LON Products How-Tos and Other Internet Connectivity Resources Web page. From there,

select the

i

.LON 100 Code Examples link to access the other example applications.

NOTE: As discussed in Chapter 4, the contents of the parameter must be passed
over the network in encoded XML format. Some development environments, such as

Microsoft Visual Basic .NET, accept data in standard format and converts it to encoded XML

for you. However, not all development environments do so. For more information on encoded
XML and standard XML, see Encoded XML and Standard XML on page 4-6.

14.2.1

Manually Creating the Parameter

One way to generate the XML string containing the input data for a function and pass it to
the parameter is to manually create a static XML string, as in the example below.

This example includes comments explaining each step of this process.

Dim

myWebReference

As

New

iLON100_Reference.iLON100()

Dim

myXMLInputString

As

String

'Manually create the XML string to be contained within the

'parameter when DataServerRead is called and the SOAP message is

'sent.

myXMLInputString = “NVL _

0 _

50

'Specify the IP location of the

i.

LON 100 by replacing the default

' “localhost” with the IP address used by the

i.

LON 100.

Dim

myURL

As

String

myURL = myWebReference.Url()

myWebReference.Url = myURL.Replace("localhost", "192.168.1.253")

'You should parse the XML string returned by the function either

'manually or with an XML parser before displaying it. The

'programming samples included later in this chapter show how you

'might do this.

Dim

myXMLReturnString

As

String