Hi,
Let's assume the reference is component1.ref1 with binding.x. The reference
is declared in the java component using @Reference annotation as follows:
@Reference
public OtherService ref1; // OtherService is remotable interface
The client component will call the other service:
ref1.doSomething(...);
It's obvious that the client component implementation will pass in the data
based on the interface of reference on the component type. The reference
might be configured with a WSDL interface by a component. In Tuscany,
ComponentReference.getReference() gives you the reference of the
corresponding component type. The databinding transformer will use the
Reference.getInterfaceContract as the source.
Now let's look at how a given binding marshals the incoming data into its
protocol-specific presentation. For example, Axis2-based binding.ws will
populate the SOAP Envelope with AXIOM objects. Other bindings such as JMS
may have to create a JMSMessage with XML text.
Now we have two options:
1) Have the databinding framework to normalize the source data parameter by
parameter into an desired format which is convienient to the binding code,
for example, AXIOM for Axis2-based binding.ws.
2) The binding extension will take the source data as-is and do the
transformation by itself. The binding extension can leverage the Mediator
service from the databinding framework without requiring an interceptor.
To facilitate approach 1, we make the assumption that source interface
contract can be mapped to a target interface contract operation by
operation. The BindingProvider.getInterfaceContract() basically nominates
the desired interface contract by the binding layer. Some bindings (usually
RPC-stype bindings) can derive it from the binding configuration, for
example, binding.ws can find the PortType for the WSDL element. But other
bindings (for example, messge-style) may find it difficult to express its
RPC semantics. There are two alternatives for such cases: using approach 2
or defining an intermediate interface contract (for example, we can clone
the service interface and set its databinding to AXIOM so that the incoming
Object[] contains OM objects and the JMS binding code will construct a
JMSTextMessge by serializing the OM elements into the body text).
Thanks,
Raymond
----- Original Message -----
From: "ant elder" <[EMAIL PROTECTED]>
To: "tuscany-dev" <[email protected]>
Sent: Wednesday, December 12, 2007 7:23 AM
Subject: How to set a specific data binding to be used by a binding?
I'm probably not going to provide enough information to get much of an
answer but I'll ask now anyway in case anyone has an obvious answer right
away...
Is there a simple way for a binding to say what data binding it wants
used?
I know there's Interface.resetDataBinding but to use that you need the
same
Interface object that is used by the DataBindingRuntimeWireProcessor when
working out if a transformation is required and that doesn't seem to be
the
one thats use by the RuntimeComponentReference/Service which is passed in
to
a Service or Reference BindingProvider. Even in a simple testcase with a
component using a reference there seems to be about 6 instances of
JavaInterface instantiated for the interface class used by the reference
so
making sure resetDataBinding is called on the correct one doesn't seem
straight forward.
...ant
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]