Class wwHTTPSQL

This class can be used to Execute SQL statements on a Web Server and return the results back as a cursor to the client application. Any SQL command as well as calling a method on the remote server SQL handler object (essentailly allowing remote method calls) are supported.

wwHTTPSQL works by calling a server piece that must be created with a few lines of code at a give URL. This URL must be specified on the client and implemented on the server. The server piece in turn implements the wwHTTPSQLServer class which handles the remote SQL request.

Note

This class is based on wwHTTP and thus inherits all of wwHTTP's HTTP properties to allow you to configure things like username/password and proxy configuration. Typical properties you'll want to access are: nConnectTimeout, cUserName, cPassword,cHTTPProxyName,cHTTPProxyUsername, cHTTPProxyPassword

Note that the wwHTTPSQL/wwHTTPSQLServer pair is a generic processing engine and can be used independently of Web Connection. In fact the class can be used in a non-HTTP environment. For example you could use this same mechanism in a Message Queue or Event based system where the messages are passed using XML. Since both the client and server use XML for messages the transport mechanism is completely switchable.

Relation
  wwHttp
    wwHttpSql

Remarks

This class is used by wwBusiness when nDataMode is set to 4 (Web Data).

This class works in conjunction of a server side wwHTTPSQLServer implementation which means a Web Server running a Visual FoxPro backend is required. This means Web Connection, ASP with a COM object etc. in addition to running whatever backend SQL engine is running.

Class Members

MemberDescription

AddSQLParameter

Adds named parameters that can be used in SQL statements or commands.

o.AddSQLParameter(lcName,lvValue,lcType,llReturn)

CreateRequestXml

This low level method creates an XML request from the current object's property state into the cRequestXml property.

o.CreateRequestXml()

CreateRequestXml

This low level method parses the XML in the cResponseXml property and extracts the results into a cursor, return value or Error message depending on the type of query and result.

o.CreateResponseXml()

Execute

This high level method handles calling the remote server with the property settings made on the current object.

o.Execute(lcSQL)

GetSQLReturnValue

Returns a named parameter that was sent in as an output parameter in AddSQLParameter.

o.GetSQLReturnValue(lcVarName)

cConnectString

An ODBC connectstring that can be used on the server side to connect to the data-source.

cRequestXML

Contains the request XML sent to the Web server after the call is complete.

cResponseXML

The XML response from the Web Server.

cServerUrl

The URL on the server to call to execute the SQL statement.

lUTF8

Flag to tell the server to return the XML result travelling over the wire in UTF8 format.

nMaxBufferSize

The maximum size in bytes of the data buffer to return from the server. This is the size of the XML string that's sent down from the server. If this string exceeds this size the server returns an error.

nResultMode

Determines how cursors are returned from the object.

nTransportMode

Determines how cursors are sent over the wire from the server side.

vReturnValue

The return value from a stored procedure or Fox method call.

Requirements

Assembly: wwHttpSql.prg

See also:

Class wwHTTPSQLServer

© West Wind Technologies, 1996-2024 • Updated: 01/13/16
Comment or report problem with topic