Active-X (OCX)

Top  Previous  Next

A widely used client type is the Active-X client. It makes it possible to access the RW NetServer from all sorts of Windows applications that support Active-X (automation objects). This includes, but is not limited to Visual Basic, Active Server Pages (asp), ColdFusion, MS Office etc.

 

The Active-X client must be installed on the machine it's supposed to be used on.

 

Two batch files (register.bat and unregister.bat) are supplied for installation / uninstallation of the Active-X.

 

Reference (Properties)

 

String ConnectionString

A connection string could look like this:

STREAMFORMAT=STANDARD;VERIFYTRANSFER=YES;HOST=127.0.0.1;PORT=3000

 

It serves to set several properties in one call, namely StreamFormat, VerifyTransfer, Host and Port.

 

Variant Data

This value is not used by RW NetServer, but can essentially contain any information depending on the situation.

 

String Host

Must contain either a name of a host or an IP address of the server to connect to.

 

String Location

This is an optional field for the client to provide to tell more about where or in what situation the client is being used. Its free text format.

 

Integer MaxRetries

Controls how many times the client should try to reconnect until it gives up.

 

String Password

Optionally provide a password for the current client operation. Is only required to specify if the server require authentication.

 

Integer Port

The port number that the client should try to connect to.

 

Integer StateID

Returns and sets the stateid. If setting it to -1 means that no previous state was known, and a new state (if it's a statefull service) is needed. If getting and it have the value -1, It means that the call just made was a stateless call.

 

String StreamFormat

Is used for setting the format/protocol used when communicating with the server. It can be set to STANDARD, XML or SOAP.

 

String Token

When a server require authorization, and a username and password has been provided by the client in a call to the server, the server will usually respond with a token value in this property. The token should be used instead of the username and password on later calls to the server, unless the user is another.

 

String UserName

Provide the name of the user calling the server.

 

Boolean VerifyTransfer

Controls if the transport protocol adds extra validation to the data. Its generally recommended to have VerifyTransfer set to true.

 

Reference (Methods)

 

Connect

Connects to the server given by the Host and Port properties.

 

Disconnect

Disconnects from the currently connected server.

 

ClearAllStates

The client keeps track of what statefull services have been obtained.

This method clears the clients knowledge about that without informing the server about it.

 

ReleaseAllStates

This method tells the server that the client is releasing all the states held by the client. The client will call the server as many times as its needed to release all states known by the client.

 

ReleaseState

Release the current state, given by StateID. Its very important to release the state when the service is no longer required for the specific client needs.

 

SendRequest(String ServiceName, String ServiceVersion, String Function_, Variant Args, out Variant Result)

Make a call to the server using the current StateID of the client instance. If that is -1, then it's a stateless call or a call for a new instance of a statefull service.

 

The Args argument can be a single value or an array of values. Multiple levels of nested single dimension arrays are supported. The same goes for Result.

 

SendRequestEx(String ServiceName, String ServiceVersion, Integer StateiD, String Function_, Variant Args, out Variant Result)

Same as SendRequest, except allows to make a call to the server giving a specific state ID as part of the call.