Java callback from bpel
As i read somewhere the type of the handle.getResult type is DOM Element...
it gives returns java.lang.ClassCastException
the code is the following.
java.util.Properties props = new java.util.Properties();
props.setProperty("orabpel.platform", "oc4j_10g");
props.setProperty("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");
props.setProperty("java.naming.provider.url", "ormi://localhost:23791/orabpel");
props.setProperty("java.naming.security.principal", "admin");
props.setProperty("java.naming.security.credentials", "welcome");
com.oracle.bpel.client.Locator locator = new Locator("default","bpel",props);
IInstanceHandle handle = locator.lookupInstance("2");
Object res = handle.getResult();
org.w3c.dom.Element element = (org.w3c.dom.Element)res;
any clues as to how to get the result from an async process?
Hello globo,
if you have a synchronous process you simple use
NormalizedMessage nmRet = deliveryService.request(processName, processMethod, normalizedMessage);
nmRet.getPayload();
And here you have the payload of your return.
For callbacks and values from an asynchronous process have a look at clemens' blog:
http://clemensblog.blogspot.com/2006/04/bpel-implementing-async-callback-with.html
Greets Jens
Similar Messages
-
I had Oracle Soa Suite 10.1.3 with Toplink/WSIF. I used to generate classes using bpel/schemac and place them in systems/classes directory.
But we migrated to Oracle Soa suite 11g. In 11g we don't see bpel folder. Are there any examples to handle the above in 11g?
Questions are:
Where is schemac located?
Where should the generated classes go?
How can I use java callouts from bpel?
Where can I examples?Hello globo,
if you have a synchronous process you simple use
NormalizedMessage nmRet = deliveryService.request(processName, processMethod, normalizedMessage);
nmRet.getPayload();
And here you have the payload of your return.
For callbacks and values from an asynchronous process have a look at clemens' blog:
http://clemensblog.blogspot.com/2006/04/bpel-implementing-async-callback-with.html
Greets Jens -
Error implementing dynamic callback from BPEL process
Hi,
I am trying to use dynamic callback from a BPEL process..
Created a variable of type EndpointReference by importing the ws-addressing.xsd. in the partnerlink wsdl..
I assigned the URL to the variable's address field ...
<copy>
<from expression="'http://172.31.171.123:8888/PubSubWLPOC-CallbackSvc2-context-root/EIPWFServiceCallbackPort'"/>
<to variable="ep_var" query="/ns3:EndpointReference/ns3:Address"/>
</copy>
Gives no error till now...
But when I try to assign the same variable to the partnerlink, I get an error..
<assign name="Assign_7">
<copy>
<from variable="ep_var"/>
<to partnerLink="MyWebService1"/>
</copy>
</assign>
The error is like this(from the $SOA_HOME\bpel\domains\default\logs) :-
java.lang.NullPointerException
at com.collaxa.cube.engine.types.bpel.CXPartnerLink.copy(CXPartnerLink.java:246)
at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.performCopyTo(BPELAssignWMP.java:1151)
at com.collaxa.cube.engine.ext.wmp.BPELAssignWMP.__executeStatements(BPELAssignWMP.java:215)
at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:199)
at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3698)
at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1655)
at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:217)
at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:314)
at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5765)
at com.collaxa.cube.engine.CubeEngine.callbackPerformer(CubeEngine.java:1885)
at com.collaxa.cube.engine.delivery.DeliveryHelper.callbackPerformer(DeliveryHelper.java:845)
at com.collaxa.cube.engine.delivery.DeliveryService.handleCallback(DeliveryService.java:794)
at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleCallback(CubeDeliveryBean.java:378)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
The confusing part is when I use xml fragment instead of the variable ep_var, it works fine ...
But I cannot use the same as the callback can be made to any url(which is decided on runtime)
Can someone pls help me with this ?
saptarishiHi,
I have done following for dynamic call back and it works..
<copy>
<from>
<_EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<Address/>
</EndpointReference>
</from>
<to variable="EndpointUrl"/>
</copy>
<copy>
In the above assignment from part is an xml fragment assigned to Endpoint Url
<copy>
<from expression="'http://172.31.171.123:8888/PubSubWLPOC-CallbackSvc2-context-root/EIPWFServiceCallbackPort'"/>
<to variable="ep_var" query="/ns3:EndpointReference/ns3:Address"/>
</copy>
</copy>
<copy>
<from variable="EndpointUrl"/>
<to partnerLink="SFDC_plt"/>
</copy> -
App crash when using JAVA callbacks from native threads in solaris
Hi all,
Sorry for putting the thread here. I did use the native methods forum, I wasnt lucky. I Hope more people would look into this forum, which brings me here.
I have a solaris application which crashes when I try to callback the JAVA methods and variables from the native code. The description of the problem is below
Written a native library, the library is multithreaded (i.e) I create a thread using pthread_create() in the native code which performs the operation of calling a JAVA method from the native code. The routine of calling the JAVA method works perfectly elsewhere outside the new thread.
There are two scenarios I've tested it in
1. I created a thread (say X) from the main thread (say Y) and made the y to wait until the X is complete using the pthread_join(). The JAVA callbacks works fine when called from Y but the app crashes if done from X.
2. Did not make the Y to wait until the X is complete, hoping that both will run paralelly and even the the App crashes.
And to be precise the Y is the thread where the native method is called from JAVA.
I have tested for any memory leaks or stack corruption by removing the JAVA callbacks and bulding a executable and using purify, the report doesnot hint any such occurances.
The linker options used for building the shared library is as follows
${GPP} ${INC} -G ${LIB} -mt -g -lCstd -lCrun -lpthread ${OBJS} -o <lib-name>
I wonder if we can create threads in the native code when using JAVA callbacks and even if we can whether it would be appropiate to use the callbacks with in the threads
Looking forward for any help.
Regards,
VamsiGuys... can't any one help me with this problem :(
-
Trying to invoke a Java class from BPEL Proces using Java Embedding
Hi All,
I have a requirement to invoke a Java class from the BPEL process;
I am trying to import the class by "* <bpelx:exec import="+package_name.classname+"/>*.
But, while compiling, I get the following error:
"Error(19,57): Failed to compile bpel generated classes. failure to compile the generated BPEL classes for BPEL process "BPEL_PROCESS_NAME" of composite "default/COMPOSITE_NAME!1.0"
The class path setting is incorrect. Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version."
Referred the scac.log:
SAXParseException in file +project_path+\composite.xml
org.xml.sax.SAXParseException: <Line 29, Column 32>: XML-24535: (Error) Attribute 'http://www.w3.org/XML/1998/namespace:id' not expected.
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:422)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:287)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:335)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:318)
at oracle.soa.scac.ValidationFaultUtil.validateStreamWithSchema(ValidationFaultUtil.java:146)
at oracle.soa.scac.ValidationFaultUtil.validateCompositeWithSchema(ValidationFaultUtil.java:120)
at oracle.soa.scac.ValidateComposite.validateWithSchema(ValidateComposite.java:1480)
at oracle.soa.scac.ValidateComposite.doValidation(ValidateComposite.java:519)
at oracle.soa.scac.ValidateComposite.main(ValidateComposite.java:223)
May 19, 2010 6:46:29 PM com.collaxa.cube.CubeLogger info
INFO: LibClasspath=E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\commonj.sdo_2.1.0.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\./classes
May 19, 2010 6:46:37 PM com.collaxa.cube.CubeLogger info
INFO: validating "RHMEDIInboundProcess.bpel" ...
May 19, 2010 6:46:37 PM com.collaxa.cube.CubeLogger warn
WARNING: CubeProcessor.compileGeneratedClasses() classpath is: E:\Softwares\OracleFMW\jdeveloper\jdev\extensions\oracle.sca.modeler.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.mediator_11.1.1\mediator_client.jar;E:\Softwares\OracleFMW\oracle_common\modules\oracle.mds_11.1.1\mdsrt.jar;C:\JDeveloper\mywork\InboundEDI_RnD\parseInboundEDIXML\classes\com\onerheem\integration\EDIInboundProcess\parseInboundEDIXML.jar;;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\classes;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\classes;C:\JDeveloper\mywork\InboundEDI_RnD\RHMEDIInboundProcess\SCA-INF\gen-classes;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\commonj.sdo_2.1.0.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.fabriccommon_11.1.1\fabric-common.jar;E:\Softwares\OracleFMW\jdeveloper\..\oracle_common\modules\oracle.xdk_11.1.0\xmlparserv2.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-common.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-exts.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-thirdparty.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel-validator.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.bpel_11.1.1\orabpel.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-client.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-ext.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\fabric-runtime.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\oracle.soa.fabric.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.fabric_11.1.1\soa-infra-tools.jar;E:\Softwares\OracleFMW\jdeveloper\soa\modules\oracle.soa.ext_11.1.1\./classes
Any suggestions to rectify the same?Hi,
I wud suggest you to make a jar of ur java class and include it in the project libraries of BPEL and make use of java embedded activity this way it works.
have a luk at below link:
http://niallcblogs.blogspot.com/search/label/embedded%20Java -
Calling Custom XSLT java class from BPEL in SOA Suite 11g
Hi All,
Morning...need some help with this issue...we are currently on SOA Suite 11g (11.1.1.4) version.
Earlier while we were on SOA Suite version 10g (10.1.3.3) we were calling the custom java classes from the xsl mapping for complex transformation and for this we were placing the .class file as .jar file at the location mentioned here $OC4J_HOME/j2ee/home/applib directory and then mentioning the namespace as http://www.oracle.com/XSL/Transform/java/{$classname$} in the XSLT mapping file.
Now in SOA Suite 11g if we need to retain similar functionality for external custom java calls could someone please help us where do we need to put the .jar file now ..
exactly at which directory location/path and on which instance/server (application server instance or middle tier instance ) we need to put this .jar file
Currently we are stuck and need some help with this.
With thanks & RegardsHi Eric & Anuj,
Thanks for replying , sorry for checking on this now...
here at this path /opt101/app/oracle/SOAD/SOA11gR1/fmw/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1
we got the ora.soa.ext.jar file and extracted it to get the MANIFEST.mf file ..have mentioned below.
Now if we need to link our custom .jar file named customfunctions.jar so we need to mention it as below is this correct :
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 17.0-b17 (Sun Microsystems Inc.)
Implementation-Vendor: Oracle
Implementation-Title: Oracle SOA EXT
Implementation-Version: 11.1.1
Product-Name: Oracle SOA EXT
Product-Version: 11.1.1.4.0
Specification-Version: 11.1.1
Extension-Name: oracle.soa.ext
Class-Path: classes/
Class-Path:customfunctions.jar classes/ -- is this the way to mention (means we need to add this additional line or we need to add to the existing line at Class-Path: classes/)
2.
Eric the Alternative method mentioned in your update :
Open a command prompt and change the current directory to the oracle.soa.ext_11.1.1 directory ,
then execute the build.xml file in the oracle.soa.ext_11.1.1 folder using Ant
Now could someone please guide us regards this ANT means how does it work and its relation to the build.xml file and how do we check whether we have ANT utility available or not..
not much conversant with this ANT hence asking here..would lookout for your reply
thank you -
I'm trying to call Java class method from C code (via JNI), but Java VM dies with
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d6c79dd, pid=128, tid=2192
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# V [jvm.dll+0x879dd]
# An error report file with more information is saved as hs_err_pid128.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
Hello world!
Hello world, from Java to C!This is Java code:
Hello.java
class Hello
public native void sayHello();
public native void sayHello(String hello);
public native void sayHello(Callback callback);
static
try
System.loadLibrary("hello");
catch(Exception e)
System.out.println("exception " + e.getMessage());
public static void main(String[] args)
Hello h = new Hello();
h.sayHello ();
h.sayHello("Hello world, from Java to C!");
Callback callback = new Callback();
h.sayHello(callback);
}Callback.java
public class Callback
public void sayHello(int num)
for(int i=0; i<num; i++)
System.out.println("Hello world, from C to Java!");
}This is C code:
Hello.c
#include <mingw/_mingw.h> //because there are some types needed for JNI
#include <jni.h>
#include "Hello.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_Hello_sayHello__
(JNIEnv *env, jobject obj)
printf("Hello world!\n");
return;
JNIEXPORT void JNICALL Java_Hello_sayHello__Ljava_lang_String_2
(JNIEnv *env, jobject obj, jstring hello)
const char *str = (*env)->GetStringUTFChars(env, hello, 0);
printf("%s", str);
(*env)->ReleaseStringUTFChars(env, hello, str);
return;
JNIEXPORT void JNICALL Java_Hello_sayHello__LCallback_2
(JNIEnv *env, jobject obj, jobject call)
jclass clazz = (*env)->GetObjectClass(env, call);
jmethodID id = (*env)->GetMethodID(env, clazz, "sayHello", "(I)V");
if(id == NULL)
//(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
printf("Method not found!\n");
}C if linked with
gcc -mno-cygwin -Wl,--add-stdcall-alias,--kill-at -shared -Wl,--output-def=Hello.def -o"hello.dll" ./Hello.oand 'def' file is:
EXPORTS
Java_Hello_sayHello__
Java_Hello_sayHello__Ljava_lang_String_2
Java_Hello_sayHello__LCallback_2I can't see what am I doing wrong, but I'm sure thats something plain that I'm missing. Code is compiled with latest Cygwin in Eclipse 3.2.2 under WinXP OS. It is runned under jre1.5.0_11.
Any help is appreciated. Thanks.Now I commented two calls for printing on screen in C code, and left just callback call, and same error is still there:
# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d6c79dd, pid=3656, tid=3660
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# V [jvm.dll+0x879dd]
# An error report file with more information is saved as hs_err_pid3656.log
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#Can anyone tell me what does this mean (or how to fix my code)?
Thank you for your reply. -
Java.lang.NoClassDefFoundError while calling a java class from BPEL
Hi,
I'm calling a java class to convert JSON to XML using BPEL. I have imported all the necessary jar files in the project and compiling done successfully.
But at runtime , i get the java.lang.NoClassDefFoundError: net/sf/json/JSON error.
For this i placed all the necessary jars under FUSION_HOME/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/ path and restarted the server.
But still i'm getting the same error at runtime.
Did i missed any step? Let me know the procedure to solve this.
Do i have to run ant or edit Manifest file after placing the jar?
in one site i find we have to place the jars under <DOMAIN HOME>/lib directory. Is this correct?
We are using SOA suite 11.1.1.6.
Thanks,
TerryHi Karan,
I have done placing the jars at FUSION_HOME/Oracle_SOA1/soa/modules/oracle.soa.ext_11.1.1/ and ran ant -f build.xml .The build was successful without any error.
I have even placed the jars in <DOMAIN HOME>/lib (/us2001/fmw/11.1.1.6/user_projects/domains/ohsdomain/lib) and did a server restart.
After these activities, when i execute the composite, i still get the error in em console,
Message
got RuntimeException
Supplemental Detail
oracle.fabric.common.FabricException: Could not create object of class 'packageName.className'; nested exception is:
java.lang.NoClassDefFoundError: net/sf/json/JSON
at oracle.integration.platform.blocks.wsif.WsifReference.request(WsifReference.java:698)
at oracle.integration.platform.blocks.mesh.SynchronousMessageHandler.doRequest(SynchronousMessageHandler.java:139)
at oracle.integration.platform.blocks.mesh.MessageRouter.request(MessageRouter.java:182)
Any help on this.
Thanks,
Terry -
Error while invoking Java Program in BPEL
When I'm invoking a simple "Hello World" Java Program from BPEL it is working fine but while invoking a Java Program which is downloading some data from a website I'm getting the following error:
Faulted while invoking operation "Helper" on provider "CMP_GBL_IN_URL_Download"
<messages><input><Invoke_Helper_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><payload xmlns:ns1="http://www.arrow.com/CMP_GBL_IN_Exchange_Rate_Interface_Controller">
<ns1:input/>
</payload>
</part></Invoke_Helper_InputVariable></input><fault><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>[email protected]0 : Could not invoke 'Helper'; nested exception is:
org.collaxa.thirdparty.apache.wsif.WSIFException: No method named 'Helper' found that match the parts specified</summary>
</part><part name="detail"><detail>org.collaxa.thirdparty.apache.wsif.WSIFException: No method named 'Helper' found that match the parts specified</detail>
</part></bindingFault></fault></messages>
Can anybuddy please help me on this.In what way do you invoke the Java program?
Riko -
Error while using Java bindings in BPEL (WSIF)
Hi,
I have a requirement to invoke a java method from BPEL process using WSIF and get the response back from it.
MY java method accepts an input parameter which is object of anothe class.
When I tried to invoke the java class from BPEL, I am getting the following error:
[email protected] : Could not invoke 'getFullName'; nested exception is: org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'com.services.test.Employee' is not compatible; nested exception is: java.lang.NullPointerException
Please find below the java class that I created:
package com.services.test;
import com.services.test.Employee;
import com.services.test.EmployeeFullRecord;
public class EmployeeRecord {
public EmployeeRecord() {
public static void main(String[] args) {
EmployeeRecord employeeRecord = new EmployeeRecord();
public EmployeeFullRecord getFullName(Employee emp) {
String fullName = emp.getFname() + emp.getLname();
EmployeeFullRecord emp1 = new EmployeeFullRecord();
emp1.setFullName(fullName);
return emp1;
The following is the wsdl that I created with JAva bindings:
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="urn:EmployeeRecord"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="Employee">
<sequence>
<element name="fname" type="xsd:string" />
<element name="lname" type="xsd:string" />
</sequence>
</complexType>
<complexType name="EmployeeFullRecord">
<sequence>
<element name="fullName" type="xsd:string" />
</sequence>
</complexType>
</schema>
</types>
<message name="EmployeeRequestMessage">
<part name="emp" type="tns:Employee"/>
</message>
<message name="EmployeeResponseMessage">
<part name="emp1" type="tns:EmployeeFullRecord" />
</message>
<portType name="Employee">
<operation name="getFullName">
<input message="tns:EmployeeRequestMessage" />
<output message="tns:EmployeeResponseMessage" />
</operation>
</portType>
<binding name="JavaBinding" type="tns:Employee">
<java:binding/>
<format:typeMapping encoding="Java" style="Java">
<format:typeMap typeName="tns:Employee" formatType="com.services.test.Employee"/>
<format:typeMap typeName="tns:EmployeeFullRecord" formatType="com.services.test.EmployeeFullRecord"/>
<format:typeMap typeName="xsd:string" formatType="java.lang.String" />
</format:typeMapping>
<operation name="getFullName">
<java:operation methodName="getFullName" />
<input/>
<output/>
</operation>
</binding>
<service name="Employee">
<port name="JavaPort" binding="tns:JavaBinding">
<java:address className="com.services.test.EmployeeRecord"/>
</port>
</service>
Please let me know if I have missed out something.
THanks in advance!!!Hi,
I have created another such service as above and placed the class files in <oraclehome>/bpel/system/classes and invoked the java code from bPEL.
Now i am getting the following error:
com.collaxa.cube.ws.wsif.providers.java.WSIFOperation_Java@98065 : Could not invoke 'createIdentity'; nested exception is: org.collaxa.thirdparty.apache.wsif.WSIFException: Class 'com.testx.wam.services.gen.identity.CreateRequest' is not compatible; nested exception is: javax.xml.bind.UnmarshalException: unexpected element (*uri:"",* local:"createRequest"). Expected elements are <{http://services.test.com/shared/xmlschema/user/1}CreateResponse>
My question is why am I getting URL as empty when I am actually passing the URL to the service. I have highlighted the uri which is showing as empty above.
Please help me solve this issue.
Thanks in advance!!! -
How to get the callback from an asynchronous BPEL?
Hi, I have deployed an asynchronous BPEL on Oracle Application Server as a Web Service. The BPEL is named CreditRatingBPEL. The input is a social security number (Ssn) and the output is a credit rating.
Now I have some troubles in consuming BPEL with Axis1.4. I have generated the client stubs by WSDL2Java tools. I have initiated the asynchronous BPEL successfully. Now I want to get the callback from the BPEL, but I don't know how to do it.Here are some Java snippets:
public static void main(String[] args) throws ServiceException, RemoteException {
// TODO Auto-generated method stub
CreditRatingBPEL_Service service = new CreditRatingBPEL_ServiceLocator();
CreditRatingBPEL_PortType requestPortType = service.getCreditRatingBPELPort();
CreditRatingBPELProcessRequest request = new CreditRatingBPELProcessRequest();
request.setSsn("31060931");
// asynchronous invoke
requestPortType.initiate(request);
// how can I get the callback from the web service?
I will be very appreciated if you can give me some suggestions. Best regards!Checkout following link -
http://www.sapfans.com/sapfans/forum/intface/messages/4289.html
Cheers
Sanjeev -
How do I call a simple java class from a bpel process?
Hi.
In JDeveloper 10.1.4.3.0 I've created a simple java class that does an ftp get operation followed by an unzip. The class uses some 3rd part libraries (jars).
I want to use a simple bpel process to schedule a daily execution of this java class, and deploy it all to our SOA-server, - and was looking into using the <bpelx:exec> function.
The java class and the bpel process is all stored in the same JDeveloper project.
How do I put this together so that both my java class and the necessary jars are available to the bpel process?
I've looked into the JavaExecSample.bpel, and it's says something about "...the class com.otn.samples.javaexec.CreditCalculator is locally packaged with this BPEL process".
How do I do that?
Can I make it and test it all locally from my workstation (only JDeveloper installed, I guess there's nothing that can execute the bpel code?), or do I have to compile class etc (make war-file?) and deploy to SOA server (BPEL-INF/lib or classes?) before anything can be tested?
(I guess all this is simple, once you know how, but being a newbie to this I need a shove in the right direction :-)
Regards,
-Haakon-To create a java class and dependent jars inside the BPEL process project you need to do the following:
1. Right click on your BPEL process project and select New and then Java Class from the Items.
2. Make the BPEL process project, JDeveloper would compile the java classes and add them into the BPEL suite case jar, see the output folder and check the BPEL suite case jar file for java classes and dependent jars.
You can test your Java classes from JDeveloper IDE, no need to deploy the classes on SOA server. When you make the BPEL project it compiles .bpel files and Java classes. You can test your classes once .bpel file and java classes compiled successfully.
Regards,
Dharmendra
http://soa-howto.blogspot.com -
Hi,
Is WSIF still the best/recommend way to call java code from your BPEL? Or are we moving away from that kind of env. and should put a wrapper around the legacy java code and expose them as services?
Regards,
Muasirhi,
Java can't call BPEL directly. So you have following steps:
1. Create Web Service from existing java file(Some tools can generate Web Service from java class).
2. Generate the Service Proxy by using Web Service.
3. Invoke the Web Service through proxy.
4. If your application use the struts, you can invoke the process from struts action class, which is called from a web page.
Maybe it is useful for you! -
Unable to invoke Java WSIF Binding wsdl from BPEL
Hi,
I am using BPEL 10.1.3.1 version.
- I created Greeting.java, then from JDev generate WebService for class but did not publish or deploy as web service
- in BPEL created one partner link using same wsdl file from local file system
- put invoke activity to call this partner link
- deployed process
- copied all class file with package folder inside $ORACLE_HOME/bpel/system/classes folder
When i initiate the process i get error
Failed get wsdl service definition.
Failed to get a WSDL service that support the portType "{http://BusinessProcess/}Greeting" in WSDL definition "{http://BusinessProcess/}Greeting".
Please verify that WSDL portType "{http://BusinessProcess/}Greeting" is supported by a service in WSDL file.
Please help.Hi Jack
Does your WSDL have the "binding" and "service" section? I do not use JDev or anything else to create the WSDL for me, I create it by hand so I don´t know how to help you in JDev, but it seens that JDev does not generate this sections and you must set then in order to use WSIF Bindings to Java or EJB.
Regards
Marcelo -
Call Java Method from Callback function
I am writing a JNI wrapper in c++ for a particular event driven DLL. The DLL makes a network connection to another device and then calls a callback function when events are raised on the device. The DLL has 3 basic functions: connect, disconnect, and registerEventListener. RegisterEventListener takes a function pointer which is called each time an event is raised on the device.
My wrapper DLL exposes connect and disconnect functions via JNI. I can call these functions just fine from my Java code. Now the question... How do I call a Java method from my c++ callback function? I can call a Java method using env->CallXXXMethod(...) from within a function that is accessible to Java but I don't have access to the JNI parameters in my Callback function.
So how do I call a Java method from a callback function? If this cannot be done then what is the "right way" to handle native event notification with JNI?jschell wrote:
JNI parameters? Meaning what exactly?
General outline of a callback
1. Entry
2. Get the VM, env - there are methods for this
3. Attach the thread
4. Get a java object - how depends on what you are doing, but create it or a static reference.
5. Get the java method
6. Call the java method.That is exactly correct. The callback function is called from a separate thread so using a cached pointer to JNIEnv, obtained from the original native method, crashes the JVM. The jmethodID and jclass objects (which are needed to call the static Java method) can be cached without problem. The following is the code I used to attach the current thread and call my static method.
void MyClass::onEvent(int system_id, char* data)
//get a pointer to the Java Environment
JNIEnv *env;
jvm->AttachCurrentThread((void **)&env, NULL);
//Call the Java method with the newly aquired data
jstring js = env->NewStringUTF(data);
env->CallStaticVoidMethod(cls, mid, system_id, js);
}My last question is about cleanup in this function. When I use NewStringUTF to "convert" my char* to jstring do I need to do anything special to clean up or will the Java garbage collector take care of it since the jstring is being passed to a Java method?
Thanks for you help
Maybe you are looking for
-
Hi, Are there someone had been able to control frame rate of video chating with actionscript or somthing else? I have no preference which would be to set it in static or dynamic. Thank you Ono Keiji
-
Is tabbing through all the active cells of a table possible?
hi... i need to tab through the active cells which are already not seen on the table. i mean i can only tab through the cells which i see, i need to use the horizontal scrollbar to move to the cells which are not already seen. can i programmatically
-
How to implement transactions in Tomcat using MySQL
Hi, I am trying to find a way to implement Transactions in Tomcat 4112 using a DBCP connection pool with MySQL (connector/j 3.0.16). I am developing a web app using the Struts framework and have tried using JOTM for the transaction implementation. Ho
-
I am getting error Error in calling up function 'BAPI_APOATP_CHECK' in APO server The current application triggered a termination when triggering for gatp.
-
Change EQ settings in iTunes?
Hey everyone I just picked up the new 3G Shuffle and $79 apple in ear headphones and I've got to say I really love both of them. The controls are perfect for me and the sound is great. Only question I had was since this is my first shuffle, I'm wonde