Ant,
will this get generated on each save? I typically do many saves when working
on a page. I'd like to understand this to avoid flooding the mailing list.

Haleh

On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

   Page Edited : TUSCANY<http://cwiki.apache.org/confluence/display/TUSCANY>: 
SCA
Java 
binding.jsonrpc<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.jsonrpc>

SCA Java 
binding.jsonrpc<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.jsonrpc>has
 been edited by
ant <http://cwiki.apache.org/confluence/display/%7Eant> (Jul 18, 2007).

(View 
changes)<http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=54462&originalVersion=17&revisedVersion=18>
Content:
 Unable to render {include} Couldn't find a page to include called: Repeating
Menu<http://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=TUSCANY&title=Repeating+Menu&linkCreation=true&fromPageId=54462>
*Documentation*

User 
Guide<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+User+Guide>
Architecture 
Guide<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+Architecture+Guide>
Developer 
Guide<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+Development+Guide>
Extension Developer 
Guide<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+Extension+Development+Guide>
 *Resources*

FAQ<http://cwiki.apache.org/confluence/display/TUSCANY/Tuscany+SCA+Java+-+FAQ>
Source Code <https://svn.apache.org/repos/asf/incubator/tuscany/java/sca>
  <binding.jsonrpc>

Tuscany supports JSON-RPC <http://json-rpc.org/> as a protcol for use with
SCA services by using the <binding.jsonrpc> SCDL extension. This enables
remote web browser clients to easily make RPC style calls to server-side SCA
components.

This binding has no attributes or elements so to include it on a SCA
service simply requires the following SCDL:

<binding.jsonrpc/>

 Also see 
<binding.ajax<http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Java+binding.ajax>which
 provides some similar function.

Any JSON-RPC client may be used to access SCA services which use <
binding.jsonrpc>, but to simplify the task for web browsers the binding
can generate a script which may be included within an HTML document to set
up proxy objects for each SCA service within the HTML page environment.

This script is used by simply including the following script tag within
the HTML page:

<script type="text/javascript" src="SCA/SCADomain/scaDomain.js" />

 This initializes the proxys for the SCA services which can then be used
make requests to the server-side components. For example, if there was a
service named "myService" which had operations "aOnewayRequest" and
"anRpcRequest" the scripts in the HTML page could now invoke these
opperations with the following:

myService.aOnewayRequest(args);

 or

myService.anRpcRequest(args, responseFunction);

 In that example 'responseFunction' is the name of a function which is
called to process the response and which gets called asynchronously on
another thread when the response is avaialble. RPC requests are done this
way instead of the simpler "answer = myService.anRpcRequest(args)" to
avoid hanging the browser while the (potentialy slow) request is being
processed. An example of the responseFunction for the previous example is:

function responseFunction(answer){
  // do something with answer
}

 Using SCA JSON-RPC services with Dojo

Apache Tuscany JSON-RPC services provide built-in support for Dojo 
RPC<http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book9>.
The Dojo <http://dojotoolkit.org/> toolkit is a popular framework for
writing Ajax/Web 2.0 style browser client applications. Tuscany SCA
services which use <binding.jsonrpc> will by default support the Simple
Method Description (SMD) <http://dojo.jot.com/SMD> protocol. SMD is
similar to ?wsdl for Web services, entering a service endpoint appended with
?smd will return a SMD descriptor for the service.

Using Tuscany SCA services with Dojo can therefore be as simple as the
following:

var myService = new dojo.rpc.JsonService("SCA/SCADomain/myService?smd");

 Some examples:

There are two samples showing using <binding.jsonrpc>, one which uses the
Dojo Toolkit on the client, and another which uses the Tuscany
scaDomain.js script. The samples are 
helloworld-dojo<https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-dojo/>and
helloworld-jsonrpc<https://svn.apache.org/repos/asf/incubator/tuscany/java/sca/samples/helloworld-jsonrpc/>
.
*Differences between <binding.jsonrpc> and <binding.ajax>*

The current Tuscany SCA runtime supports <binding.jsonrpc> and <
binding.ajax> which provide similar functionality. The differences are:

   - <binding.jsonrpc> supports the SMD protocol enabling easy use with
   Dojo, <binding.ajax> does not support SMD
   - <binding.ajax> supports SCA references and using 
COMET<http://en.wikipedia.org/wiki/Comet_%28programming%29>style asynchronous operation, 
<
   binding.jsonrpc> does not
   - <binding.jsonrpc> uses the standard JSON-RPC<http://json-rpc.org/>protocol, 
<
   binding.ajax> uses a proprietry protocol using DWR<http://getahead.org/dwr/>

These differences should be resolved by the Tuscany SCA 1.0 release.
*Changes since 0.90 release*

The Tuscany JSON-RPC and Ajax binding's have had significant functional
and useability changes since the 0.90 release. It is recomended that if
possible the latest code is used (the description on this page is based on
the latest code).

   Powered by Atlassian 
Confluence<http://www.atlassian.com/software/confluence/default.jsp?clicked=footer>(Version:
2.2.9 Build:#527 Sep 07, 2006) - Bug/feature 
request<http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470>

Unsubscribe or edit your notifications 
preferences<http://cwiki.apache.org/confluence/users/viewnotifications.action>

--------------------------------------------------------------------- To
unsubscribe, e-mail: [EMAIL PROTECTED] For
additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to