Zamples, Inc. logo
 Home   Search   Solutions   My Zamples   FAQ   News   Contact 
Zamples ID:
Password:
   
0 anonymous users;
22 users logged in.

Execution of Code from a Knowledge Base

For some Zamples knowledge bases, all that is needed to run a code example from a knowledge base is the code example id.  Code example ids are unique across all knowledge bases.  Recall that the requestor user id and password be specified in the REST POST.  In any case, be sure that your client supplies the HTTP user agent or the Zamples server may refuse the REST query.  The knowledge base entry contains all of the information necessary to compile and run the code example.  The results are returned as text/html.

Here is an example URL that runs code fragment #1235 as user myUid, password myPwd:

http://zamples.com/JspExplorer/zamples/run?id=1235&clientUser=myUid&clientPassword=myPwd

This code example generates an HTML link that runs code example #1235. A valid user id and password must be specified.

<a href='/JspExplorer/zamples/run?id=1235&clientUser=myUid&clientPassword=myPwd'>
Click to execute.</a>
Anyone who is authorized to view a posting can run it.

Typical Output

/zamples

Possible error codes

In addition to the common error statuses, this Zamples REST call can generate the following error statuses and messages:

400 Zamples code fragment id not specified A code example ID was not specified
404 Zamples code example not found in database The requested code example ID does not exist.
506 Compilation failed The requested code example had a compilation error
507 Execution failed The requested code example had a runtime error


Querying Code Examples in a Knowledge Base Zamples Client REST Interface Specification Listing of Code in a Knowledge Base