Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change 
notification.

The following page has been changed by IgnacioSilvaLepe:
http://wiki.apache.org/ws/Tuscany/TuscanyJava/SCA_Java/AsyncCallbacks

New page:
= Support for Async Callbacks =

Async callbacks allow a component to perform a request on another component and 
to receive its response asynchronously via a callback. This feature follows the 
programming model specified in the SCA Client and Implementation Modle for Java 
(found in 
http://osoa.org/display/Main/Service+Component+Architecture+Specifications).

Currently, async callbacks are supported for components wired via bindless 
references, and via references with a web services binding using Axis2 
(WS/Axis2).

== Async Callbacks via Bindless References ==

In this mode, a source component uses a reference that does not include a 
binding, which is then wired to a target component via a service that does not 
include a binding either. For an example, see the inner.composite sample. To 
illustrate, an excerpt of the SCDLs for the inner.composite sample is as 
follows:

=== Source Composite ===

Contained in InnerComposite.scdl

    <component name="InnerSourceComponent">
                <implementation.java class="innercomposite.SourceImpl"/>
        <reference name="targetReference">TargetComponentRef</reference>
    </component>
            
    <reference name="TargetComponentRef">
        <interface.java interface="innercomposite.Target"
                        callbackInterface="innercomposite.SourceCallback"/>
    </reference>

=== Target Composite ===

Contained in InnerComposite2.scdl

    <service name="InnerTargetService" target="InnerTargetComponent">
        <interface.java interface="innercomposite.Target"
                      callbackInterface="innercomposite.SourceCallback"/>
        <reference name="innerSource">InnerTargetComponent</reference>
    </service>
       
    <component name="InnerTargetComponent">
                <implementation.java class="innercomposite.TargetImpl"/>
    </component>

=== Containing Composite ===

Contained in default.scdl

    <component name="SourceComponent">
        <implementation.composite name="InnerComposite"          
scdlLocation="InnerComposite.scdl"/>
        <reference name="TargetComponentRef2">TargetComponent2</reference>
    </component>

    <component name="TargetComponent2">
        <implementation.composite name="InnerComposite2" 
scdlLocation="InnerComposite2.scdl"/>
    </component>

== Async Callbacks via WS/Axis2 Binding ==

In this mode, the reference and service used by the source and target 
components use a WS/Axis2 binding (<binding.ws/>). For an example, see the 
helloworldws-async and helloworldwsclient-async samples. A preview of the SCDLs 
is as follows:

=== Server side ===

    <service name="HelloWorldWebService" target="http:///foo";>
        <interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"; 
            interface="http://helloworld#wsdl.interface(HelloWorld)" 
            
callbackInterface="http://helloworld#wsdl.interface(HelloWorldCallback)"
            wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" />
        
        <binding.ws 
endpoint="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)"
            conformanceURIs="http://ws-i.org/profiles/basic/1.1"; 
location="wsdl/helloworld.wsdl" />

        <reference>HelloWorldServiceComponent</reference>
    </service>

    <component name="HelloWorldServiceComponent">
        <implementation.java class="helloworld.HelloWorldImpl" />
    </component>

=== Client side ===

    <component name="HelloWorldServiceComponent">
      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
      <reference name="helloWorldService">HelloWorldService</reference>
    </component>

    <reference name="HelloWorldService">

        <interface.wsdl xmlns:wsdli="http://www.w3.org/2006/01/wsdl-instance"; 
            interface="http://helloworld#wsdl.interface(HelloWorld)" 
            
callbackInterface="http://helloworld#wsdl.interface(HelloWorldCallback)"
            wsdli:wsdlLocation="http://helloworld wsdl/helloworld.wsdl" />

        <binding.ws 
endpoint="http://helloworld#wsdl.endpoint(HelloWorldService/HelloWorldSoapPort)"
                        location="wsdl/helloworld.wsdl" />
    </reference>

=== Limitations ===

Currently, async callbacks over WS/Axis2 has the following limitations:

 * The callback interface can only use a single method
 * The WSDL definition in use must include a port type that describes the 
callback interface separately, see resources/META-INF/wsdl/helloworld.wsdl

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

Reply via email to