In Soa Suite 11g we can not call the composite service directly from java. We need to copy the service in the composite, change its binding to adf and wire this service to the component. All the credits goes to Jay's Blog and Clemens, Great work.
The first step is to open the composite xml and find your service.
Copy this service and give it a unique name and now we need to add the binding.adf binding to this service instead of the binding.ws
Go back to the design mode and open the new adf binding service and select the same wsdl as your other service ( this will correct the serviceName ) and at last we need to wire the new service to the component
Now we only need to call this service from java
The source of project is on github check https://github.com/biemond/soa11g_examples/tree/master/SOA_Directbinding where I use adf binding , directbinding and starting these from java and also start / stop composite , check activated instances , start unit tests.
Just a couple of questions over this approach.
ReplyDelete1) What is the best means to get rid of the hard coded URL you have on your code? This code can't go as such to production.
2) You have hard coded the composite revision id. What if the customer redeploys the composite with different revision id?
3) What is the advantage of this approach over JAX-WS Proxy?
Hi,
ReplyDeletejust use a property file or a context parameter in web.xml and this you can override with a deployment profile in weblogic deployment
you can leave the revision id away then it always uses the latest
it is fast because of the rmi and more secure because you have to authenticate
thanks
Thanks for the explanation.
ReplyDeleteFor 3, do you have any numbers on how much could be the performance improvement over JAX-WS for this option?
Hi
ReplyDeletejust take a look at this rmi is always fast.
http://www.sosnoski.com/presents/cleansoap/results.html
thanks
Edwin,
ReplyDeleteThanks for the Java exmaple. I'm new to the ADF area and have a related question. I'd like to create an ADF UI to show the exact same thing... Have the UI call and drive a payload into a SOAP or RMI Composite (Mediator or BPEL) in 11g. Any in-built capabilities on the ADF side to do this? Would you possibly have an example? Thanks
Hi,
ReplyDeleteHave the UI call and drive a payload into a SOAP or RMI Composite (Mediator or BPEL) in 11g. Any in-built capabilities on the ADF side to do this?
There are more ways to do this in ADF,
first is use ws datacontrol or if you are more a java developer then you can generate a ws proxy client and generate on the port client a java datacontrol.
or use this code and generate a java datacontrol on this class.
and when you have a datacontrol then you can drag and drop the method on the jsf page.
thanks Edwin
Hi,
ReplyDeleteI know this is not the correct blog to post this technical issue on SOA suite 11g and fault-policy.But i have been entwined in this issue in a way that I require some help to resolve it.
I have used a java-action for a fault condition.But when the fault occurs and the following java action is called then the it gives an exception-"com.collaxa.cube.engine.fp.BPELFaultRecoveryContextImpl is not loaded in the main class and thus resulting in this error:java.lang.NoClassDefFoundError: com/collaxa/cube/engine/fp/BPELFaultRecoveryContextImpl at com.xxx.javaActionBPEL.handleFault"
Please let me know if I can upload the custom java action jar file in this blog!
Panacea
Hi,
ReplyDeletecan you take a look at this blog of my co-worker http://blog.whitehorses.nl/2009/11/12/using-a-java-action-fault-policy-in-soa-suite-11g/
you can ask him
Just use a property file or a context parameter in web.xml and this you can override with a deployment profile in weblogic deployment.
ReplyDeleteHi,
ReplyDeleteHow can we get Composite Instance Id for Mediator Java action. Is there any built in capabilities
Thanks
Ravi
Hi,
ReplyDeleteyou mean from a java call out in the mediator, if so then you can take a look at this Lucas example http://technology.amis.nl/blog/6669/soa-suite-11g-introducing-mediator-java-callouts-for-debug-audit-and
thanks
Quick question regarding removing revision id from the code. I tried it out with code:
ReplyDeleteComposite c = locator.lookupComposite("default/HellowWorld")
but it causes the following exception:
java.lang.IllegalArgumentException: default/HelloWorld
at oracle.soa.management.CompositeDN.(CompositeDN.java:29)
at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupComposite(EJBLocatorImpl.java:212)
Hi,
ReplyDeleteI don't know about removing the version, it should work, I will try it out
thanks
I am kicking the process off with no problem. I am getting null on the response. Any ideas? Is there anyway you could post a code example showing how you have you mediator set up?
ReplyDeleteThanks!!!
Just a little more information our mediator calls a BPEL process. No matter what we try we cannot get the payload to come back from the BPEL using your code example.
ReplyDeleteThanks so much for the help!
Hi,
ReplyDeleteI will post an example but in the meanwhile did you also try this ( this uses the direct binding )
http://biemond.blogspot.com/2009/11/calling-soa-suite-direct-binding.html
Thanks for posting an example. We are in version 11.1.1.1 so we don't have direct binding as an option right now.
ReplyDeleteThanks Again!!
We are counting on your code example. We thank you for your blog. If we can get this in the next 24 gours you will be a LIFESAVER!
ReplyDeleteThanks!
Dan
Ok, here it goes
ReplyDeletehttp://www.sbsframes.nl/jdeveloper/HelloWorld.zip
good luck
Thanks a ton. We will try it out on 11.1.1.1
ReplyDeletehi , I wanted to write the java code for a similar scenario. Howvere, I am getting a java.rmi.MarshalException while invoking the service. How to handle this. Why am I getting this error.?any ideA?
ReplyDeletehi ,
ReplyDeleteI am geeting the following error:
"java.rmi.MarshalException : error marshalling return, nested Exception is java.io.NotSerializableException:com.oracle.bpel.entity.dataprovider.impl.EntityObjsHolder"
please help.
Hi,
ReplyDeleteThis can be a library problem, did you also try to do it with the rmi binding http://biemond.blogspot.com/2009/11/calling-soa-suite-direct-binding.html
or download my testcase and see if that works for you
http://www.sbsframes.nl/jdeveloper/HelloWorld.zip
thanks
Hi Edwin,
ReplyDeleteIn 11g what is the best way to change a partner link at runtime? We want to change the data source depending on a string that is passed in.
Thanks a lot!
Just to follow up a bit we wish to change the jndi name at runtime located on the jca file
ReplyDeleteHere is an example from the jca file:
Hi
ReplyDeletein the mediator you can change the adapter properties in the assign part of the mediator.
see this
http://biemond.blogspot.com/2009/08/jdeveloper-11g-improvments-for-mediator.html
in bpel you can go the property tab in the invoke activity and change the adapter properties.
thanks
Thanks for the information the one issue we will have is that we need to change the property in the BPEL properties tab at runtime. Any idea on how to do that?
ReplyDeleteI see how you could hardcode it. Not seeing how you could assign it.
Thanks!!!!
Hi,
ReplyDeletewhen you go to the property tab of the bpel invoke activity and select your adapter property you want to change. click the value field and then you will get a wizard to select a variable.
thanks
Thank you Edwin!!!!!
ReplyDeleteWe were looking at the properties on the Partner Link not the invoke activity. That is what had us confused.
Thanks again!
Edwin,
ReplyDeleteWe have a need to only allow a given compsoite to run one at a time. In other words two instances or threads at the same time is what we are trying to avoid.
In 11g is there a a good way to do this? In 10.1.3 we programatically did it using the API to see if a BPEL instance was running. This was placed at the top of each BPEL process we had like this.
We have multiple ways for users to kick off the composite. If one is already running we want to error or queue the request.
Thank You!
Hi,
ReplyDeleteInteresting case. I think I would the users add a request to a JMS queue and make a synchronous mediator composite application which dequeues this JMS Queues and call the right synchronous Composite application.
Then the mediator composite application should wait for the Composite application to finish before it can dequeue an another one.
let me know what you did.
Edwin,
ReplyDeleteIn a BPEL process is there a way in 11.1.1.2 to do a HTTP Post that returns a plain XML response and map that into a Oracle table? The response from the HTTP response is not SOAP it's a CGI that returns raw XML. It's well formed but doesn't have the envelope namespaces etc..
Thanks much for advice!
Hi
ReplyDeleteSoa Suite 11g R1 PS1 does not support the http binding yet but the next version it will. but you can also use the spring component for now. This works perfectly . or you can do a java call out.
Lucas made a blog about the spring component.
http://technology.amis.nl/blog/6704/soa-suite-11g-using-spring-component-to-mimic-http-binding-and-integrate-restful-services
thanks
Hi Edwin,
ReplyDeleteWe are hoping for a quick answer on this one because of time lines we have. In BPEL we have two scenarios. One where we need to do a loop and call a stored procedure. The number of items in the loop could go all the way to 500 let's say. We also have a need to do a loop based on a data set and call a WebService. That too could need to call the WebService 500 times that is a SAAS API where we are moving date from our system to the SAAS provider.
Can 11.1.1.2 BPEL handle a loop of that size? 500 iterations? It's an average sized payload nothing huge. More a concern with that many times through a loop.
Developing it is no problem in either scenario it's very straightforward. Just wanted to see if you would do something like that.
Thanks so much Edwin!
Hi,
ReplyDeleteIf I was you I would make a new procedure with a clob or xmltype parameter which calls the original procedure 500 times. ( oracle db support xpath , it is not so difficult )
Huge data processing is always faster in the database.
if you don't want this , don't log this composite in the hydration store. Too slow.
thanks Edwin
Thanks so much on the PL/SQL.
ReplyDeleteHow about the post of the data to the SAAS provider. Any issues with looping 500 times in BPEL if we don't do a checkpoint and go to the dehydration store?
Hi Edwin,
ReplyDeleteIn 11g BPEL if we have a timeout even with our fault policy we are not getting notified by email. It's going to the logs however.
Any ideas on how we can get notified via email of a timeout? This would be a timeout such as a database adapter or a WebService call.
Thanks Much!
Hi,
ReplyDeleteYou can try to use a Java Action Fault Policy and from this class try to set a message on a queue and read this queue to do your own thing like a email.
like in my company blog .
thanks and maybe in the next version of soa you can get automatic email notifications.
In regards to reading values for this Servlet, you suggested using web.xml and overriding it with deployment profile.
ReplyDeleteCould you provide more information on how to override properties in web.xml.
Thank you,
Hi,
ReplyDeleteI mean this http://biemond.blogspot.com/2009/04/using-weblogic-deployment-plan-to.html
here I have a weblogic deployment plan to change some web.xml context parameters.
thanks
This comment has been removed by the author.
ReplyDeleteI'm using Eclipse and I get the following exception: java.lang.ClassNotFoundException: oracle.soa.api.JNDIDirectConnectionFactory
ReplyDeleteGuess need additional libraries.
What I want to do is get payload for all the running composites and then use those payload to reinvoke on another instance.
Hi,
ReplyDeleteEclipse is possible but you need to get some libraries some the Soa Suite server and off course the weblogic full client.
you need these classes
oracle.soa.management.facade.*
oracle.fabric.common.*
and I thinks these are the jars you need soa-infra-mgmt.jar / fabric-runtime.jar
thanks
Hi Ediwn,
ReplyDeleteWe have a file watcher in an 11g BPEL process.
Inside the jca file we would like to inject a different directory path at deployment time using the config file.
This is the line in question in the JCA file.
Is it possible to use the config file to impact values in the JCA file? This is specifically for a file watcher.
Thanks for your insight!
Hi,
ReplyDeleteI dont know what your use case is, but at runtime in the bpel invoke or mediator assign you can set jca.file.Directory this is good for writing.
for reading files you can use the logical name in the the file adapter or maybe something with a configuration plan.
thanks Edwin
Following is the list of jar that I included in classpath
ReplyDeletecom.bea.core.management.core_2.5.0.0.jar
com.bea.core.transaction_2.6.0.0.jar
com.bea.core.weblogic.security.identity_1.1.2.0.jar
com.bea.core.weblogic.security.wls_1.0.0.0_5-2-0-0.jar
fabric-common.jar
oracle-soa-client-api.jar
soa-infra-mgmt.jar
weblogic.jar
webserviceclient.jar
webserviceclient+ssl.jar
wlthint3client.jar
Thanks,
ReplyDeleteyou can also generate a weblogic fullclient, then you dont need all this weblogic libs and you cant forget a jar
cd WL_HOME/server/lib
java -jar wljarbuilder.jar
You can now copy and bundle the wlfullclient.jar
Edwin,
ReplyDeleteWhat is the best way in 11g BPEL to pass parameters to a transformation?
We are calling ora:processXSLT for our transformation step.
Thank You!
Hi,
ReplyDeleteI don't exactly but I think you can add more then one input variables to the xlst in BPEL or define bpel properties and use the ora advanced xlst functions to retrieve this. Here a blog how to set this.
http://eelzinga.wordpress.com/2009/10/28/oracle-soa-suite-11g-setting-and-getting-preferences/
Hi Edwin,
ReplyDeleteCould you please tell what is the best way to check the status of a parnerlink (DBAdapter) and based on it would like to stop/retire another JMSAdapter from processing the messages.
I was looking using CompositeManager() API. How can I use it? Is that the way to go for stopping/retireing/starting a process?
Hi,
ReplyDeletebest way is to read the SOA Mbeans and for this you can use java or wlst.
see this http://biemond.blogspot.com/2010/02/invoking-fmw-application-mbeans-in.html
or do it with ANT
http://biemond.blogspot.com/2009/09/deploy-soa-suite-11g-composite.html
here i stop or enable composite.
hope this helps
If you use 11.1.1.2, you need to assign PROPERTY_ECID field also otherwise your instances will be linked to each other.
ReplyDeletewhat are the jars that should be there to run the Java client ?and what is the location of these jars
ReplyDeleteHi
ReplyDeleteThese are the jars, you need to install the soa plugin in jdev
com.bea.core.management.core_2.5.0.0.jar
com.bea.core.transaction_2.6.0.0.jar
com.bea.core.weblogic.security.identity_1.1.2.0.jar
com.bea.core.weblogic.security.wls_1.0.0.0_5-2-0-0.jar
fabric-common.jar
oracle-soa-client-api.jar
soa-infra-mgmt.jar
weblogic.jar
webserviceclient.jar
webserviceclient+ssl.jar
wlthint3client.jar
thanks
While deploying to weblogic server, I am getting the following error.
ReplyDeleteAny Thoughts!!
[02:22:06 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application HttpSoaInterface on BAMJMSServer,AdminServer,BPMJMSServer,SOAJMSServer,UMSJMSServer.: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl.
[02:22:06 PM] Weblogic Server Exception: weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] Caused by: weblogic.wsee.ws.WsException: When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] See server logs or server console for more details.
[02:22:06 PM] weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] #### Deployment incomplete. ####
[02:22:06 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
While deploying to weblogic server, I am getting the following Error.
ReplyDeleteAny thoughts???, I have created the servlet instead of Java class.
Please let me know. Thanks
[02:22:06 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application HttpSoaInterface on BAMJMSServer,AdminServer,BPMJMSServer,SOAJMSServer,UMSJMSServer.: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl.
[02:22:06 PM] Weblogic Server Exception: weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] Caused by: weblogic.wsee.ws.WsException: When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] See server logs or server console for more details.
[02:22:06 PM] weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[02:22:06 PM] #### Deployment incomplete. ####
[02:22:06 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
Hi,
ReplyDeleteyou can try to deploy it only to the soa server and not to all.
and what for kind is the webapp, are you do something special.
thanks
Edwin,
ReplyDeleteThanks for the Quick reply, I am deploying to a One server (AdminServer) which containins Admin, SOA, BAM apps deployed to one server.
I am creating the war file for deploying.
I tried to deploy it to only soaserver, I got the same error:Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
ReplyDeleteI am creating the webapp to invoke/call the BPEL process in the composite
[03:17:02 PM] [Deployer:149191]Operation 'deploy' on application 'HttpSoaInterface' is initializing on 'soa_server1'
[03:19:59 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application HttpSoaInterface on soa_server1.: [Deployer:149145]Unable to contact 'bam_server1'. Deployment is deferred until 'bam_server1' becomes available.; nested exception is:
java.rmi.UnknownHostException: Could not discover administration URL for server 'bam_server1'.
[03:19:59 PM] [Deployer:149193]Operation 'deploy' on application 'HttpSoaInterface' has failed on 'soa_server1'
[03:19:59 PM] [Deployer:149034]An exception occurred for task [Deployer:149026]deploy application HttpSoaInterface on soa_server1.: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl.
[03:19:59 PM] Weblogic Server Exception: weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[03:19:59 PM] Caused by: weblogic.wsee.ws.WsException: When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[03:19:59 PM] See server logs or server console for more details.
[03:19:59 PM] weblogic.management.DeploymentException: Error encountered during prepare phase of deploying WebService module 'HttpSoaInterface.war'. When processing WebService module 'HttpSoaInterface.war'. Can't find wsdl /wsdls/wsat11/wstx-wsat-1.1-wsdl-200702.wsdl
[03:19:59 PM] #### Deployment incomplete. ####
[03:19:59 PM] Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
Hi,
ReplyDeletetry to make an ear with all the required shared library and put the required libs in the web-inf/lib
thanks
Hi Edwin,
ReplyDeleteI'm trying your example on soa 11.1.1.3 and i'm getting the following error:
SEVERE: Failed to create a DirectConnectionFactory instance (oracle.soa.api.JNDIDirectConnectionFactory): oracle.soa.api.JNDIDirectConnectionFactory
javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://100.12.13.45:8001/soa-infra: Bootstrap to: 100.12.13.45/100.12.13.45:8001' over: 't3' got an error or timed out]
Hi
ReplyDeleteAnd when you dont use the cluster address , just a single server.
thanks
Hi Edwin,
ReplyDeleteI have a 11G BPEL process that puts a messgae in a JMS queue. A MDB puts a message in a response queue that the BPEL process watches.
The BPEL process picks up the response message from the MDB just fine but it says the message format doesn't match the defined schema for the response and the BPEL throws and exception. I have tried putting the namespace in using every imaginable format with no luck.
Any ideas?
Thanks
Hi,
ReplyDeletewhat you can do is to intercept the mdb response message and compare this with the response of a test mediator file component.
or use jdeveloper to generate a test msg and compares this with the mdb one.
I think your default namespace is wrong or a lower or Uppercase error.
thanks
Hello Edwin,
ReplyDeleteI runned HellowWorld succesfully trying with a async bpel with a human task and I'm wondering how to get the callBack response, I think I have to use .post instead of .request but the next steps I unknown could you give me some tips for implementing it? it is possible??
Thank you in advance!
Edmundo Cerda
Hi,
ReplyDeleteplease read the comments of this direct bindings post.
http://biemond.blogspot.com/2009/11/calling-soa-suite-direct-binding.html
request can handle sync and async. post is for fire and forget ( one way )
thanks
Thank you very much Edwin I'll be working on it :)
ReplyDeleteI have another doubt regarding to another topic if you don't mind:
I've working with xpath extension functions for bpel 10g in OAS.
Now I'm working with 11g(weblogic 10.3.3) and I saw that everything is different, I mean I'm wondering if I have to do the same steps for adding an xpath extension function like modify the xml descriptor(where is this located?) in bpel installation path and where I have to add my java class with the xpath extensions also add the extension in the JDeveloper(I can take a look by myself).
Have you some blog explaining something about? any guide that can I follow, or could you confirm that is it possible?
Thank you in advance Edwin!
Edmundo Cerda.
Hi,
ReplyDeleteread this http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10224/bp_appx_functs.htm#CHDECDHG
it is much easier now
Hi Edwin,
ReplyDeleteI'm curious about the 11g PS3 updates. I've been working with the java API to query for instances and components, but have yet to find an interface that gives me access to the payload of any specific instance at its current point.
Any guidance?
Hi,
ReplyDeleteI want to call a Bpel proces from adf and using the following code
Composite c = locator.lookupComposite("default/BpelProcess")
but it causes the following exception:
java.lang.IllegalArgumentException: default/BpelProcess
at oracle.soa.management.CompositeDN.(CompositeDN.java:29)
at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupComposite
Please help how to resolve this error.
Thanks
Hi,
ReplyDeleteplease try to add the version number like this default/Helloworld!1.0
thanks
Hi Edwin,
ReplyDeleteI have been facing the issue that you have mentioned in your oracle forums thread
https://forums.oracle.com/forums/thread.jspa?messageID=9908482#9908482
Please advice, your help would save a lot of time for us.
Thanks,
Surya.
Hi,
ReplyDeleteI added my test project to github , This working example shows you all the steps.
The source of project is on github check https://github.com/biemond/soa11g_examples/tree/master/SOA_Directbinding where I use adf binding , directbinding and starting these from java and also start / stop composite , check activated instances , start unit tests.
good luck
Hi Edwin,
ReplyDeleteI have tried your code from github, but the ADF Binding has not been working( I didnt test the other two bindings). In the BPEL process when we replace the client partner link with the ADF_Binding's partner link and recreate the input and output variables then only its working.
Can you please also check it from your side once?
Regards,
Surya.
Hi,
ReplyDeleteAll 3 examples works,
there is no need to change anything
all 3 services are calling and using the same bpel wsdl and got a wire to this bpel.
And then lookup the composite
Composite composite = locator.lookupComposite("default/Helloworld!1.0");
Then lookup the ADF service component which is the ADF binding.
service = composite.getService("ADFBindingService");
it worked perfectly for me
thanks
Hi,
ReplyDeleteWe are calling our BPEL process under weblogic server 11g SOA from standalone Java client .
we were using the SOA management Java reference 11.1.1.5.0 APIs in our code as shown below:
we are using the jars:
ejb30.jar,
ejb.jar
fabric-common.jar,
optic.jar,
oracle-soa-client-api.jar,
soa-infra-mgmt.jar,
wlfullclient.jar,
wsclient_extended.jar,
xmlparserv2.jar..
CompositeDN compositeDN = new CompositeDN("default","MasterBPELProcess", "1.0");
DirectConnection dic = locator.createDirectConnection(compositeDN, "MasterBPELProcess");
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();
Document doc = builder.parse(new InputSource(new StringReader(inputPayload)));
Element root = doc.getDocumentElement();
Map mpayload = new HashMap();
mpayload.put("payload", root);
Payload payload = PayloadFactory.createXMLPayload(mpayload);
Message request = XMLMessageFactory.getInstance().createMessage();
request.setPayload(payload);
try {
Message response =
dic.request(operationName, request);}catch(InvocationException e){}
**we are getting the Below Exception, while sending the request :**
**try {**
**Message response =**
**dic.request(operationName, request);}catch(InvocationException e){}**
oracle.soa.api.invocation.InvocationException: ; nested exception is:
java.io.EOFException; nested exception is: java.io.EOFException
at oracle.soa.api.DirectConnectionImpl.request(DirectConnectionImpl.java:126)
at oracle.soa.api.CachedConnectionProxy.request(CachedConnectionProxy.java:57)
at com.verizon.vsii.initiate.InitializeBPELProcess.initBPEL(InitializeBPELProcess.java:266)
at com.verizon.vsii.initiate.InitializeBPELProcessBatch.initBPEL(InitializeBPELProcessBatch.java:66)
at com.verizon.vsii.initiate.InitializeBPELProcessBatch.main(InitializeBPELProcessBatch.java:75)
Caused by: javax.ejb.EJBException: ; nested exception is:
java.io.EOFException; nested exception is: java.io.EOFException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:121)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:96)
at $Proxy4.request(Unknown Source)
at oracle.soa.api.DirectConnectionImpl.request(DirectConnectionImpl.java:114)
... 4 more
Caused by: java.io.EOFException
at weblogic.rjvm.t3.MuxableSocketT3.endOfStream(MuxableSocketT3.java:345)
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:826)
at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:760)
BPEL Response:
Error in executing BPEL process Syncronously
args.length 0
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:941)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:888)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:339)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
Note:
I have given the code.Pls let's know what is the reason for this exception( asap ), also let us know is there any solution to solve this problem & reference for using that API.
Hi,
ReplyDeleteare you using the direct binding or adf binding as service and what do you do in your operation one way, sync or async.
thanks else send me a simple testcase
thanks
The existing bpel proces is based on ws binding. we came 2 know that if it is a ws binding we can't use the Java api, so we have deployed a sample process with direct binding, but we are not able to use the request method.
ReplyDeleteSince the operation defined in wsdl is one way, the existing pbel process has ws binding service, we have to convert this to dir/adf binding, which one would you suggest (adf/direct)?
pls provide all the configuration details to be done in the pbel side & for both direct binding service & adf binding service.
Note :
We have both sync & async calls to be made, for this we will be passing a payload(xml).
pls explain about the callback process in the async call.
Hi,
ReplyDeleteBasically nothing have to change , just add an extra direct binding and re-use the same wsdl of the ws binding. Drag a wire from this directbinding exposed service to the bpel component.
now you have 2 service which has a wire to the bpel component.
thanks
Hi,
ReplyDeleteI am using adf binding to invoke a synchronous BPEL service. Even though the code is running fine and I am able to invoke the service, getting the below error message. But the service is being invoked. Can you please let me know the reason:
SEVERE: Failed to create a DirectConnectionFactory instance (oracle.soa.api.JNDIDirectConnectionFactory): oracle.soa.api.JNDIDirectConnectionFactory
Hi,
DeleteStrange, so it is invoked and you see the instance in the EM and get a valid response.
Can you test my example first on your environment and see how that goes. You can better use directbinding.
https://github.com/biemond/soa11g_examples/tree/master/SOA_Directbinding where I use adf binding and directbinding
thanks
Thanks Edwin. Will try the direct binding approach.
DeleteThanks
Hi,
ReplyDeleteCan we invoke a mediator service instead of BPEL service. I am getting an error.
Thanks
It should work I guess.
DeleteBut for test you need to have a response, that's why I use BPEL in this demo.
thanks
hi edwin nice blog
ReplyDeletebut when i am running startprocess
SEVERE: Failed to create a DirectConnectionFactory instance (oracle.soa.api.JNDIDirectConnectionFactory): oracle.soa.api.JNDIDirectConnectionFactory
Hi,
DeleteCan you test my example first on your environment and see how that goes. You can better use directbinding instead of directbinding
https://github.com/biemond/soa11g_examples/tree/master/SOA_Directbinding
where I use adf binding and directbinding
thanks
Hi Edwin.. when i am running code i am getting the following error inspite of adding all the jars mentioned above.. please help..
ReplyDeleteit is giving error at locator=LocationFactory.createLocator(jndiProps);
in the debug mode
=====================================================================
Exception in thread "Main Thread" java.lang.NoClassDefFoundError: oracle/jrf/PortabilityLayerException
at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupBean(EJBLocatorImpl.java:748)
at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupFinderBean(EJBLocatorImpl.java:735)
at oracle.soa.management.internal.ejb.EJBLocatorImpl.(EJBLocatorImpl.java:166)
at oracle.soa.management.facade.LocatorFactory.createLocator(LocatorFactory.java:35)
at callingcompositefromjava.CallingComposite.(CallingComposite.java:54)
at callingcompositefromjava.CallingComposite.main(CallingComposite.java:157)
====================================================================
hi,
Deleteis this only in debug mode, I saw some strange errors like this when I do debug which I won't get in normal mode
also check if you connect to the soa server .
thanks
even if i run it says the same thing...
ReplyDeleteany thought and jars are missing..
it is getting stuck at
locator=LocationFactory.createLocator(jndiProps);
We have Large orders XML made HTTP post to SOAsuite 11g, we Just need to parse/pass the PO's whatever we recieve to another partner via HTTP post, can you provide me some ideas of how to receive using HTTP binding adapter & how to Map large xmls using assign activity or How to parse XMLs.... Thanks.
ReplyDeleteHi,
Deletesee my http binding post http://biemond.blogspot.com.au/2010/05/http-binding-in-soa-suite-11g-ps2.html
you need to provide the xsd and in the mediator you can use xslt
thanks
Hi Edwin,
ReplyDeleteI can see that in this article comments there is someone that asked you about the best way to change a partner link at runtime. You suggested him the usage of the invoke properties to change the endpoint. Well, I have the same requirement but I my partner links are direct binding adapters. I've tried the solution that you comment and I've tried to assign values to partner link variables using the WS-Addressing schemas, both ways with no success. Can you show me the way to change a direct binding partner link (Address) that calls an OSB proxy at runtime?
Thanks in advance and congrats for your blog.
Hi,
DeleteAre you using bpel 2.0 with PS5 or bpel 1.1 these two supports changing endpoint at runtime. But direct binding uses the direct binding java api. This is not a http endpoint but a t3 one, that's why addressing won't work.
you can ask for an ER on oracle support. maybe they can show you how or add this feature in the next release.
thanks
OK, I'm going to ask Oracle support about it.
ReplyDeletethanks for your support Edwin.
In your example, Is there any way to create a locator without passing the credentials while creating the context using jndiProps?
ReplyDeletei.e. We have a scenario where a java(non adf) app which runs within same weblogic server instance of soasuite and it needs to instantiate a bpel process. I can certainly use web service proxy but direct binding might make it faster and efficient
Hi,
DeleteCan you try this
locator = LocatorFactory.createLocator();
thanks
Hi Biemond,
ReplyDeleteWe are trying to send a callback from Java WS to a BPEL process in 11 g. Both the BPEL Composite and the Java WS are in the same container, ie Weblogic.
This was working fine in 10g with IDeliveryService but in 11g we used Locator class to look up the service. We are getting a null pointer exception in at line
ds.post(operationName, nm); after adding a SOP statement, we are getting NP Exception at
System.out.println("ds ::"+ds.getCompositeDN());
Below is the excerpt of the sendResponse Code
public void SendResponse(String getIsOK, String SessionNumber, String ErrorMessage) {
try{
String SessNum;
SessNum = SessionNumber;
if(SessNum == null)
{SessNum="";}
String inputXML="\n" +
"" + getIsOK + "\n" +
"" + SessNum + "\n" +
"" + ErrorMessage + "\n" +
"\n";
System.out.println("OdiCallbackService Response: " + inputXML);
Locator locator = LocatorFactory.createLocator();
Composite composite = locator.lookupComposite("default/!");
//processName is the name of the Composite
ServiceImpl ds = (ServiceImpl) composite.getService(processName);
NormalizedMessage nm = new NormalizedMessageImpl();
nm.addProperty(NormalizedMessage.PROPERTY_CONVERSATION_ID, conversationID);
//payload is the name of the part of the message.
nm.getPayload().put("payload",inputXML);
System.out.println("operationName ::"+operationName);
System.out.println("ds ::"+ds.getCompositeDN());
System.out.println("operationName ::"+operationName);
System.out.println("nm ::"+nm.getPayload().get("payload"));
//operationName is the name of the operation to which the call back is returned.
ds.post(operationName, nm);
}
catch(FabricInvocationException fex){
System.out.println("ODIInvokeScenario: " + fex.getMessage());
}
catch(ServerException ex){
System.out.println("ODIInvokeScenario: " + ex.getMessage());
}
catch(RemoteException ex){
System.out.println("ODIInvokeScenario: " + ex.getMessage());
} catch (Exception ex) {
System.out.println("Generic Exception: ODIInvokeScenario: " + ex.getMessage());
System.out.println("Print Stack Trace: ODIInvokeScenario: " + ex.getStackTrace().toString());
ex.printStackTrace();
}
}
Please help :(.
Thanks,
Anu
Hi,
Deleteyou should use something like this in the lookup partition + composite _ version locator.lookupComposite("default/Helloworld!1.0")
and not "default/!"
can you check this
thanks Edwin
Hi Beimond,
DeleteFor some reason, the text did not get printed. We are actually using
Composite composite = locator.lookupComposite("default/InvokeODIAsyncBPEL4!1.0");
Also, I have not used adf.binding in composite.xml. The BPEL Process actually calls the Java WS asynchronously . The issue is when the callbackelement is passed back to the BPEL Process.
Thanks,
Anu
Thanks,
Anu
Hi Edwin,
DeleteI have also tried with adf.binding tag as below
where,OdiInvokeServiceServiceADF is the unique name that I have given to the reference. And wired the reference to the BPEL Process. Both binding.adf and binding.ws is coexisting with reference names different. I have tested the code with same payload. From BPEL instance point of view, the behaviour was same. Invocation of WS was successful but call back was pending.
However, the .out file did not print any of the Java SOP statements. Please suggest.
Thanks,
Anu
Hi,
DeleteCan you send me a small testcase and I will take a look. send it to biemond at gmail dot com
thanks
I am using following code in my project in java embedding
ReplyDeleteComposite composite = locator.lookupComposite(DName);
It is failing with below error
Caller doesn't have enough permission to call this method.
This code was working fine in my local server with a single node but the same code is not working when i migrate this code to my test environment which is a clustered one.
Any suggestions??
Thanks for your explanation, It's finally worked in version 12.2.1 + Java 1.8 :)
ReplyDeleteBut, How do I call the adf web service in the secured way?
After change the url and port to the secure link I am getting this error:
javax.naming.NamingException: Couldn't connect to the specified host [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 203 completed: No]
Hi Edwin,
ReplyDeletethe 12c version of the infrastructure management API has been significantly reduced (see https://docs.oracle.com/middleware/1221/soasuite/api-reference-soa/toc.htm). The API you mentioned above is not available anymore in the documentation (most of oracle.soa.management.facade).
Do you know if there's some substitution? It seems to me that 12c version has been reduced mostly to DirectConnection, but the management API has been removed.
Karel