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 (1)
HI
Could you please let me know all the dependent jar files for the above code?
Thanks
Sankeerth
Posted by sankeerth | September 24, 2009 6:11 AM
Posted on September 24, 2009 06:11