Class WebServices
Object
|
+--WebServices
- class
WebServices
Defined in web_services.js
|
Method Summary |
function
|
copyAttributes(from, to)
|
function
|
copyXML(doc)
|
function
|
getDocument(url, callBack, synchronous)
|
function
|
getRequest(url, callBack, synchronous)
Sends an HTTP GET request to the url specified.
|
function
|
getTextDocument(url, callBack, synchronous)
Sends an HTTP GET request to the url specified.
|
function
|
getXMLHttpRequest(method, url, synchronous)
|
void
|
postDocument(<string> url, <Object> parms, <Function> callBack, <boolean> synchronous)
Requests an XML document from the URL specified using the HTTP POST
method.
|
function
|
postRequest(url, parms, callBack, synchronous)
Requests a document and passes the XMLHTTPRequest object to the
callback function.
|
function
|
postTextDocument(url, parms, callBack, synchronous)
Requests a document from a URL.
|
function
|
xml2html(parent, children)
|
WebServices
function WebServices()
copyAttributes
function copyAttributes(from, to)
copyXML
function copyXML(doc)
getDocument
function getDocument(url, callBack, synchronous)
getRequest
function getRequest(url, callBack, synchronous)
Sends an HTTP GET request to the url specified.
The callback is called with the XMLHTTPRequest object for
the request being passed as the only argument.
getTextDocument
function getTextDocument(url, callBack, synchronous)
Sends an HTTP GET request to the url specified.
The callback is called with a text string being passed containing
the data returned by the server as the only argument.
getXMLHttpRequest
function getXMLHttpRequest(method, url, synchronous)
postDocument
void postDocument(<string> url, <Object> parms, <Function> callBack, <boolean> synchronous)
Requests an XML document from the URL specified using the HTTP POST
method. The callback function is passed an XML object that contains the
response from the server.
Parameters:
url - the URL of the document to request
parms - an object. The document at url is assumed to be generated by a CGI script. A parameter to that script will be generated for each property of parms that is not a function such that the name of each parameter will be the name of a property of parms and the value of each parameter will be the stringified value of the matching property.
callBack - a function to be called once the response has been received. The one and only parameter to callBack is the XML document that was received. The XML document may be null if there was a problem.
synchronous - (Optional) - a flag indicating whether the request should be synchronous or asyncrounous. If synchronous is true, postDocument will block until a response is received. If it's false, postDocument will return immediately. In both cases, the reponse is passed to callBack but in the synchronous case, callBack is guaranteed to have been called before postDocument returns whereas there is no way to know when callBack will be called in the asyncrounous case. Defaults to false.
postRequest
function postRequest(url, parms, callBack, synchronous)
Requests a document and passes the XMLHTTPRequest object to the
callback function.
postTextDocument
function postTextDocument(url, parms, callBack, synchronous)
Requests a document from a URL.
The callback is passed string consisting of the text sent in response
by the server.
xml2html
function xml2html(parent, children)
