This is a JSON-RPC service that demonstrates the basic features of the Jayrock library.

The following JSON-RPC methods are supported (try these using the DemoService test page):

add(a, b)
Return the sum of two integers.
cookies()
Returns the cookie names seen by the server.
counter()
Increments a counter and returns its new value. Demonstrates use of session state.
decode(bytes, encoding)
Returns the string from encoded bytes (transmitted as a Base64 string).
echo(text)
Echoes back the text sent as input.
echoArgs(args)
Echoes back the arguments sent as input. This method demonstrates variable number of arguments.
echoAsStrings(args)
Echoes back the arguments as an array of strings. This method demonstrates working with variable number of arguments.
echoGuid(id)
Echoes back the given GUID. This method demonstrates working with an argument typed as System.Guid.
echoObject(o)
Echoes back the object sent as input.
echoTime(time)
Echoes back the date/time sent as parameter.
encode(s, encoding)
Returns the bytes of a string in a given encoding that are transmitted as a Base64 string.
format(format, args)
Formats placeholders in a format specification with supplied replacements. This method demonstrates fixed and variable arguments.
getAuthor()
Returns information about the author. Demonstrates how a Hashtable from the server is automatically converted into an object on the client-side.
getCouple()
Returns a server-typed object representing a couple. Demonstrates to returning server-typed objects.
getDataGrid()
Returns a data-bound DataGrid to the client as HTML.
getDataSet()
Returns the Northwind employees as a DataSet.
getDataTable()
Returns the Northwind employees as a DataTable.
getDataView()
Returns the Northwind employees as a DataView object.
getDropDown()
Returns a data-bound DropDownList to the client as HTML.
getFirstDataRow()
Returns the first Northwind employee as a DataRow object.
getFirstDataRowView()
Returns the first Northwind employee as a DataRowView object.
getRowArray()
Returns the Northwind employees as an array of DataRow objects.
getRowCollection()
Returns the Northwind employees as a DataRowCollection.
getStringArray()
Returns an array of city names. Demonstrates returning a strongly-typed array.
newGuid()
Generates and returns a GUID as a string.
now()
Returns the local time on the server. Demonstrates how DateTime is returned simply as a string using the ISO 8601 format.
serverVariables()
Returns the server variables collection at the server. Demonstrates returning NameValueCollection.
sleep(milliseconds)
Blocks the request for the specified number of milliseconds (maximum 7 seconds).
stypeof(o)
Returns the CLR type that a given value converted to on the server.
swapNames(p)
Swaps first and last name of person. Demonstrates receiving and returning a server-typed object.
system.about()
Returns a summary about the server implementation for display purposes.
system.listMethods()
Returns an array of method names implemented by this service.
system.version()
Returns the version server implementation using the major, minor, build and revision format.
throwError()
Throws an error if you try to call this method.
total(values)
Returns the total of all integers sent in an array.
wadd(x, y)
Adds two float arguments and returns their result. This method demostrates use of warped parameters.

The following method(s) of this service are marked as idempotent and therefore safe for use with HTTP GET: