Using the new 11g SOA Suite API - changes to 10.1.3x

With 11g and the new SCA composite support our API has been revamped a little as well.

The Locator is still available and is created against WL jndi properties


Hashtable jndiProps = new Hashtable();
jndiProps.put(Context.PROVIDER_URL,
"t3://" + props.get(STR_MGDSERVER_HOST_KEY) + ":" +
props.get(STR_MGDSERVER_PORT_KEY) + "/soa-infra");

jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, STR_WL_CTX);
jndiProps.put(Context.SECURITY_PRINCIPAL,
props.get(STR_USER_KEY));
jndiProps.put(Context.SECURITY_CREDENTIALS,
props.get(STR_PASSWORD_KEY));
jndiProps.put("dedicated.connection", "true");

System.out.println("Creating locator with properties: " + jndiProps);

return LocatorFactory.createLocator(jndiProps);

Finding your composite..

Composite composite = locator.lookupComposite(compositeDN);

The composite DN is based on

<domain name>/<composite name>!<version>
e.g.: default/OrderBookingComposite!1.0

And here is the difference to 10.1.3 - on a composite you can have multiple services defined - e.g.

<service name="orderprocessor_client_ep"
ui:wsdlLocation="oramds:/apps/FusionOrderDemoShared/services/orderbooking/OrderBookingProcessor.wsdl">
<interface.wsdl interface="http://www.globalcompany.example.com/ns/OrderBookingService#wsdl.interface(OrderProcessor)"/>
</service>
<service name="UpdateOrderStatus_ep" ui:wsdlLocation="UpdateOrderStatus.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/WebLogicFusionOrderDemo/OrderBookingComposite/UpdateOrderStatus#wsdl.interface(execute_ptt)"/>
</service>

So you need to find the appropriate service, to get a handle on the delivery service.

Service deliveryService =
composite.getService("UpdateOrderStatus_ep");

If you don't read on, you will get a nullpointer now, because while we allowed you to create a delivery service in 10.1.3 on an exposed client partnerlink / service, in 11g - you need to add a specific binding, so the you can bind to the service via api.

The exception stack will reveal:

Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
at oracle.integration.platform.blocks.sdox.JavaEntryBindingComponent.invoke(JavaEntryBindingComponent.java:127)
at oracle.soa.management.internal.ejb.impl.FacadeFinderBeanImpl.executeServiceMethod(FacadeFinderBeanImpl.java:853)
... 31 more

To avoid this you'll need to add a binding.adf entry into your composite's service, such as the below one.


<service name="UpdateOrderStatus_ep" ui:wsdlLocation="UpdateOrderStatus.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/WebLogicFusionOrderDemo/OrderBookingComposite/UpdateOrderStatus#wsdl.interface(execute_ptt)"/>
<binding.adf serviceName="OrderProcessorService" registryName=""/>
</service>

From here on it's back to normal, create a normalized message, set the payload parts and use service.post / request.

NormalizedMessage nm = new NormalizedMessageImpl();

// create and set a conversation id - e.g. through the UUID class
String uuid = "uuid:" + UUID.randomUUID();
nm.addProperty(NormalizedMessage.PROPERTY_CONVERSATION_ID, uuid);
// get the payload off the normalized message and add an xml part
nm.getPayload().put(<partName>, <some xml>);

Comments:

HI Could you please let me know all the dependent jar files for the above code? Thanks Sankeerth

Posted by sankeerth on September 23, 2009 at 11:11 PM PDT #

Hi. In previous version of BPEL API it wasn´t necessary to indicate the version of the BPEL process if you got a "default" version: For instance IDeliveryService deliveryService = getDeliveryService(); NormalizedMessage nm = new NormalizedMessage(); //no version deliveryService.post(processId,operation, nm); Can we accomplish this in BPEL 11g? Thanks in advance. Oscar.

Posted by Oscar on February 22, 2010 at 08:59 PM PST #

Libraries required to use the new API's in 11.1.1.2.0 are: \jdeveloper\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar \oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar For StandAlone SOA_HOME\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar; SOA_HOME\wlserver_10.3\server\lib\weblogic.jar; SOA_HOME\oracle_common\soa\modules\oracle.soa.mgmt_11.1.1\soa-infra-mgmt.jar;

Posted by Arun on March 03, 2010 at 08:29 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Tips and tricks straight from the SOA / BPM development team at Oracle HQ

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today