Using Callbacks with the Spring Framework
Oracle SOA Suite uses callbacks for both interface.wsdl
and interface.java
. However, the concept of callbacks does not exist in the spring framework. For Oracle SOA Suite services and references, a callback is specified (in the metadata) as a second port type for interface.wsdl
or a second Java name for interface.java
. The spring metadata has only sca:services
and sca:references
and no way to specify a callback.
To design a callback with spring, you must provide sca:services
and sca:references
with a specific name. If you create both a sca:service
and sca:reference
using the naming conventions of some
Service
and some
ServiceCallback
, Oracle SOA Suite recognizes this convention and creates a single service or reference with a callback.
For example, assume you create the syntax shown in the following example in the spring context file with the spring editor in Oracle JDeveloper:
<sca:service name="StockService" type="oracle.integration.platform.blocks.java.callback.StockService" target="impl" /> <sca:reference name="StockServiceCallback" type="oracle.integration.platform.blocks.java.callback.StockServiceReply" />
Oracle SOA Suite automatically creates a single service as shown in the following example:
<service name="StockService">
<interface.java
interface="oracle.integration.platform.blocks.java.callback.StockService"
callbackInterface="oracle.integration.platform.blocks.java.callback.StockServiceRe
ply"/>
</service>
In the SOA Composite Editor, if a spring interface.java
with a callback interface is dragged to a WSDL component (for example, Oracle BPEL Process Manager, Oracle Mediator, or others), a WSDL with two port types is generated (technically, a wrapper WSDL, which is a WSDL that imports two other WSDLs, each having a single port type).
If you drag a WSDL or Java interface that has a callback to a spring service component, a single interface is displayed in the SOA Composite Editor. However, inside the spring editor, you find both a sca:service
and sca:reference
that have the same naming conventions (some
Service
and some
ServiceCallback
).