Simon Laws wrote:
Do we think the following is a supported scenario for 2.x

1/
    <component name="CallBackBasicClient">
       <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
        <reference name="aCallBackService" target="CallBackBasicService"/>
    </component>

    <component name="CallBackBasicService">
      <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
      <service name="CallBackBasicService">
         <binding.ws/>
      </service>
    </component>

Where the interface for the CallBackBasicService is bidirectional.

The spec says "If the callback element is not present, the behaviour
is runtime implementation dependent.". We could assume that the
callback binding is the same as the forward binding if it's not
specified. This is tricky though as you don't know what the callback
binding is until you have matched the forward wire. We do this late in
the day now and the callback would always end up with and SCA binding.

I think defaulting the callback binding to the same as the forward
binding is the right thing to do by default.

I don't understand the difficulty with doing this.  Wiring is
resolved at deployment time, so the target service and binding
for the forward wire are known then (but not before).  What is the
difficulty with determining the callback binding at the same time
that the forward binding is determined?


If we don't allow that what should the minimum 2.x configuration be to
get this to work?

2/
    <component name="CallBackBasicClient">
       <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
        <reference name="aCallBackService" target="CallBackBasicService">
            <callback>
                <binding.ws>
            </callback>
        </reference>
    </component>

    <component name="CallBackBasicService">
      <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
      <service name="CallBackBasicService">
         <binding.ws/>
      </service>
    </component>

This relies on us passing the callback binding URI with the forward
message. 1.x does this (it passes the component/service URI rather
than a binding URL) but I'm unable to determine that is does anything
useful with it.  I don't see where it could go to look up the callback
service endpoint based on the URI that is passed. Certainly 1.x
callback scenarios only seem to work if you fully specify the callback
bindings (i'm not including the case here where you might set a
callback object).

The component/service URI is the default URI that the runtime generates
if an explicit URI is not specified by the binding.  In a non-domain
manager scenario, there is no default for a Web Service binding URI
on a service binding.  (This is true for regular unidirectional services
as well as bidirectional services.)  Similarly, because the client
callback is implemented as an SCA service under the covers, there is
no default URI for the client callback enndpoint if this is using
Web services.

The minimum configuration for a 1.x non-domain manager scenario to do
forward calls and callbacks over Web Services is therefore as follows:

   <component name="CallBackBasicClient">
       <implementation.java
           class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
       <reference name="aCallBackService" target="CallBackBasicService">
           <binding.ws/>
           <callback>
               <binding.ws uri="http://L3AW203:8084/CallBack"/>
           </callback>
       </reference>
   </component>

   <component name="CallBackBasicService">
       <implementation.java
           class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
       <service name="CallBackBasicService">
           <binding.ws uri="http://L3AW203:8085/CallBackBasicService"/>
           <callback>
               <binding.ws/>
           </callback>
       </service>
   </component>

Note in particular the following about this:

1. There is no need to specify a URI on the reference forward binding
   or on the service callback binding.  In fact in the OASIS specs we
   have disallowed specifying a URI on the service callback binding
   because the nature of callbacks means that this value must be
   passed dynamically by the client.

2. The reference forward binding and the service callback binding
   are both specified as empty <binding.ws> elements.  For the
   OSOA specs, this is required so that bindings on references
   and services match (without these, the only valid binding
   would be binding.sca).  Fo the OASIS specs, the reference forward
   binding would be omitted because bindings are prohibited on
   targeted references (a binding from the service is used).
   For consistency, I think the same should apply to service callback
   bindings (i.e., a binding from the client's <callback> element
   should be used), but the Assembly spec only says that the behaviour
   is implementation dependent.

Taking the above points together, I think the minimum node configuration
that could be used in 2.x is as follows:

   <component name="CallBackBasicClient">
       <implementation.java
           class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
       <reference name="aCallBackService" target="CallBackBasicService">
           <callback>
               <binding.ws uri="http://L3AW203:8084/CallBack"/>
           </callback>
       </reference>
   </component>

   <component name="CallBackBasicService">
       <implementation.java
           class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
       <service name="CallBackBasicService">
           <binding.ws uri="http://L3AW203:8085/CallBackBasicService"/>
       </service>
   </component>

When using the domain manager, it should be possible to improve on this
by having the domain manager configure both of the explicit URIs, which
means this reduces down to case 2.  The question then is whether we can
go one step further and default the callback binding to the forward
binding if it isn't specified explicitly.

  Simon

3/
    <component name="CallBackBasicClient">
       <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicClientImpl"/>
        <reference name="aCallBackService" target="CallBackBasicService">
            <binding.ws uri="http://L3AW203:8085/CallBackBasicService"/>
            <callback>
                <binding.ws uri="http://L3AW203:8084/CallBack"/>
            </callback>
        </reference>
    </component>

    <component name="CallBackBasicService">
      <implementation.java
class="org.apache.tuscany.sca.test.CallBackBasicServiceImpl"/>
      <service name="CallBackBasicService">
         <binding.ws uri="http://L3AW203:8085/CallBackBasicService"/>
          <callback>
              <binding.ws uri="http://L3AW203:8084/CallBack"/>
          </callback>
      </service>
    </component>

Clearly in 2.x we should support 3.

I think we could also support 2. We have a number of options here as
we have access to a registry of endpoints now. We could either pass
the callback Endpoint URI with the forward message or pass the URI of
the actual callback binding. The latter may make some sense if you are
interacting with non SCA bidirectional services however that makes it
difficult to determine the callback binding on the service side in the
SCA case as you don't have the callback Endpoint URI to send to the
registry.

I'm in the middle of giving 2 a try based in passing the callback
Endpoint URI. In the case of binding.ws this is passed in the WSA from
field.

Thoughts?

Simon



Reply via email to