How to call Java method from XSLT??

Hi All,
Jdev 11.1.1.3.0
I have a requirement to implement that, I have to call Java method from XSLT. Could anyone please suggest to implement that??
Thanks,
Santosh M E

As pointed by others, you must expose your method as a custom function, registering with JDeveloper (for development time) as well as with SOA Suite (for runtime).
In the link below you will find a simple step by step example:
https://blogs.oracle.com/reynolds/entry/building_your_own_path
Regards,
Luis F. Heckler

Similar Messages

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to call java method from C ?

    Hello,
    I try to call a native method from java which calls java method from the same class. Exception (noSuchMethodError) is thrown. Any ideas?
    Thanx in advance !
    here is the source of the native method :
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall (JNIEnv * env, jclass jcl, jint jarg1, jint jarg2) {
    int arg1;
    int arg2;
    int arg3;
    jint res;
    char * ch = "test";
    jfieldID fid;
    jmethodID mid;
    int (* procedure) (int *, int * ,int *);
    int mch;
    arg1 = (int )jarg1;
    arg2 = (int )jarg2;
    procedure = GetProcAddress(libraryHandle,"Proc_Mul_Int_Var_Var_Stdcall");
    procedure(&arg1,&arg2,&arg3);
    res = (jint) arg3;
    printf("(*env)->GetMethodID(env, jcl, \"test\", \"()V\");\n");
    mid = (*env)->GetMethodID(env, jcl, "test", "()V");
    printf("(*env)->CallVoidMethod(env, jcl, mid);\n");
    (*env)->CallVoidMethod(env, jcl, mid);
    return res;
    here is the source of the java file:
    public class TestDll {
    static {
    System.loadLibrary("testdllwrap");
    System.out.println("java: Library testdllwrap.dll loaded");
    public TestDll() {
    public native int Proc_Mul_Int_Var_Var_Stdcall(int jarg1, int jarg2);
    public void test() {
    System.out.println("java: test()");
    public static void main(String[] args) {
    TestDll access = new TestDll();
    int a = 5;
    int b = 6;
    int c = 0;
    System.out.println("Calling Proc_Mul_Int_Var_Var_Stdcall");
    c = access.Proc_Mul_Int_Var_Var_Stdcall(a,b);
    System.out.println("Java Result = " + c);

    Something is wrong with the code you posted here.
    Since your native method is not static, it should have the jobject instance as a parameter in the function prototype, not a jclass. Also, you should be calling CallObjectMethod with a jobject, not jclass.
    Check out Jace at http://jace.reyelts.com/jace.
    To call the java method you would do:
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall
    (JNIEnv * env, jobject jTestDll, jint jarg1, jint jarg2) {
      TestDll testDll( jTestDll );
      testDll.test();
    }God bless,
    -Toby Reyelts

  • How to call java method from xsl

    hi friends,
    How to call a java method from xsl, i have a xsl file which will call the java method and retrieve the value and display it to the user. but its work well when i set xalan.jar and xerces.jar and the java class files in my classpath and run as
    java org.apache.xalan.xslt.Process -in navigate.xml -xsl nav-exst.xsl -HTML -out navoutpage.html[b]
    in the command prompt but when i deploy it as web application it gives error as
    [b]Namespace 'MyPack' does not contain any functions[b]

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to call java method from actionscript

    I've just now started working on Flex. May be its basic question but I’m not aware of it – how can I call a java method from actionscript. I want to call some java method on double click of a event. Can you please let me know how to proceed on this?

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How to call  Java method from SAPUI5 applications?

    Hi Experts,
        Please give me information that how can I call Java method or jars from SAPUI5 applications?
    Thanks,
    Nag

    Hello Nag,
    why do open this thread in BRM Space? I would suggest reopen this in "UI Development Toolkit for HTML5 Developer Center" Space.
    Regards,
    Tobias

  • How to call Java methods from a Windows application?

    Hello all,
    At our company, we need to integrate our product which is a Java Swing application with a Windows application. Specifically, we are trying to call Java methods that reside in our application from the Lotus Notes email client application, which is a native Windows application. Such that when a user clicks a button in the Lotus Notes email client, it will trigger an event in our Swing application. Is this possible using JNI? Do you know of any resources or references relating to this kind of a project?
    Thanks,
    Mete Kural

    If there is some dll interface that lets Lotus Notes load up and use a DLL, then yes, this should be possible.

  • Notable to call java method from xslt

    Hi All,
    We are not able to call java methods that return org.w3c.dom.NodeList.
    All other methods invocation are working fine but process errors out when we try to call a method that returns org.w3c.dom.NodeList.
    Any help is highly appiciated.
    Vigni

    As pointed by others, you must expose your method as a custom function, registering with JDeveloper (for development time) as well as with SOA Suite (for runtime).
    In the link below you will find a simple step by step example:
    https://blogs.oracle.com/reynolds/entry/building_your_own_path
    Regards,
    Luis F. Heckler

  • How to call java methods from different java file.

    Hi, i create 2 files:
    CircleCalculationMethod.java
    Main.java
    In Main.java, How can i call method in CircleCalculationMethod.java ?
    Should i put everything in same folder ??
    Should i do something like "import CircleCalculationMethod.java"
    Should i do something like create a package
    Thanks
    P/S: i use Eclipse software

    As I suggested in your OTHER threads - the BEST WAY to learn, and often the fastest, is to TRY THINGS yourself.
    Just posting code you get from the internet and asking others to modify it for you won't teach you anything.
    Go through The Java Tutorials. There are trails for ALL of the basic functionality that include working, sample code.
    This is the trail on 'Packages':
    Lesson: Packages (The Java™ Tutorials > Learning the Java Language)
    And this is the one on 'Classes and Objects'. This trail includes sections for methods and how to define and use them.
    Lesson: Classes and Objects (The Java™ Tutorials > Learning the Java Language)

  • In JNI how to call Java methods from native language methods

    I just build the example of java tutorial on
    http://java.sun.com/docs/books/tutorial/native1.1/implementing/method.html
    but when I excute, it says:
    Callbacks.c:1:syntax error before 'void'
    Callbacks.c:2:parse error before '*'
    Callbacks.c:In function 'Java_Callbacks_nativeMethod':
    attached:
    Callbacks.c
    JNIEXPORT void JNICALL
    Java_Callbacks_nativeMethod(JNIEnv *env, jobject obj, jint depth)
    jclass cls = (*env)->GetObjectClass(env, obj);
    jmethodID mid = (*env)->GetMethodID(env, cls, "callback", "(I)V");
    if (mid == 0) {
    return;
    printf("In C, depth = %d, about to enter Java\n", depth);
    (*env)->CallVoidMethod(env, obj, mid, depth);
    printf("In C, depth = %d, back from Java\n", depth);
    Callbacks.java
    class Callbacks {
    private native void nativeMethod(int depth);
    private void callback(int depth) {
    if (depth < 5) {
    System.out.println("In Java, depth = " + depth + ", about to enter C");
    nativeMethod(depth + 1);
    System.out.println("In Java, depth = " + depth + ", back from C");
    } else
    System.out.println("In Java, depth = " + depth + ", limit exceeded");
    public static void main(String args[]) {
    Callbacks c = new Callbacks();
    c.nativeMethod(0);
    static {
    System.loadLibrary("MyImpOfCallbacks");

    Looks like you havn't included the jni header file. Add this to the top of the .c file:
    #include "jni.h"

  • How to call java code from xslt.

    I have to do some complex looping in my stylesheets. It is difficult to implement it directly. can i write a javacode for the same and invoke it from my stylesheet? Can anyone help me out with a demo if possible?

    you're the one supposed to provide updates on your progress, not anyone else...

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

  • How to call  java program from ABAP

    Hi Experts,
         My requirement is to call java programs from ABAP. For that i have set up SAP JCO connection by using this link http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/739. [original link is broken] [original link is broken] [original link is broken] Connection gets sucessfully. After this how to call java program from ABAP as per our requirement. Please help me out.
      Also i tried this way also.. but while executing the DOS Command line appear & disappear in few seconds. So couldnt see the JAVA output. Please help me out to call java programs in ABAP..
    DATA:command TYPE string VALUE 'D:Javajdk1.6.0_20 injavac',
    parameter TYPE string VALUE 'D:java MyFirstProgram'.
    CALL METHOD cl_gui_frontend_services=>execute
    EXPORTING
    application = command
    parameter = parameter
    OPERATION = 'OPEN'
    EXCEPTIONS
    cntl_error = 1
    error_no_gui = 2
    bad_parameter = 3
    file_not_found = 4
    path_not_found = 5
    file_extension_unknown = 6
    error_execute_failed = 7
    OTHERS = 8.
    Thanks.

    This depends on the version of your Netweaver Java AS. If you are running 7.0, you will have to use the Jco framework. The Jco framework is deprecated since 7.1 though. If you want to build a RFC server in 7.1 or higher, it is adviced that you set it up through JRA.
    Implement an RFC server in 7.0:
    http://help.sap.com/saphelp_nw04/helpdata/en/6a/82343ecc7f892ee10000000a114084/frameset.htm
    Implement an RFC server in 7.1 or higher:
    http://help.sap.com/saphelp_nwce72/helpdata/en/43/fd063b1f497063e10000000a1553f6/frameset.htm

  • How to call Java Map in XSLT map

    Hello,
    Can anyone tell me how to call Java Map in XSLT map.
    Thanks and Regards
    Hemant

    Hello, Vijay,
    Can you help in understanding how can we pass whole payload in the parameter in XSLT map.....
    for eg
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:javamap="java:DATEandTIME.Date_Time">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
         <xsl:param name="inputparam" />
         <xsl:template match="/">
         <MT_TARGET>
              <date>
                   <xsl:if test="function-available('javamap:getDateValue')">
                       <xsl:value-of select="javamap:getDateValue($inputparam)"/>                    </xsl:if>
              </date>
              <time>
              <xsl:if test="function-available('javamap:getTimeValue')">
                       <xsl:value-of select="javamap:getTimeValue($inputparam)"/>                       <xsl:value-of select="$test"/>
              </xsl:if>
              </time>
              <project>
                        <xsl:value-of select= "//project"/>
              </project>
         </MT_TARGET>
         </xsl:template>
    </xsl:stylesheet>
    here we are passing static value in parameter.....
    Java code is:
                private static AbstractTrace trace = null;
                public static String getDateValue(Map inputparam)
                        trace = (AbstractTrace)inputparam.get(
                                 StreamTransformationConstants.MAPPING_TRACE );
                        Date now1 = new Date();
                        SimpleDateFormat formatter = new SimpleDateFormat ("yyyyMMd");
                        String dateString = formatter.format(now1);
                        return dateString;
                public static String getTimeValue(Map inputparam)
                            trace = (AbstractTrace)inputparam.get(
                                    StreamTransformationConstants.MAPPING_TRACE );
                            Date now1 = new Date();
                            SimpleDateFormat formatter = new SimpleDateFormat ("hhmmss");
                            String dateString1 = formatter.format(now1);
                            return dateString1;
    I want to pass whole payload so how can i pass it.

  • How to call Java API from BSP?

    I have a requirement to call Java API from BSP application.
    I have checked the forum and found that it is possible by using some ABAP codes.
    However there is no pointer on how this is done.
    Can someone explain the details on how to call Java API from BSP is done?
    I found class CL_EJB_JAVA_OBJECT_METHODS to call a method in EJB but can't find function or SAP class to call Java API.
    Actually is there any BSP extention which can used to call Java API?
    Thanks,
    Hendri

    check out these weblogs, it should give you an idea how to go about it.
    /people/ignacio.hernndez/blog/2006/12/04/speech-synthesis-listen-the-application-server-is-talking-to-you
    /people/puru.govind/blog/2006/12/20/let-abap-speak
    Regards
    Raja

Maybe you are looking for

  • Line item in PNP logical database

    Hi All, Can anyone tell me, what is the selection logic for PNP Logical database, suppose in one report we use PNP Logical database, So when we put some date range, so in the output of report there are 2 fields, so during that date range 1 field occu

  • How Do I Save an ASCII Text File?

    In the Windoze world, Notepad is a simple editor that saves text strictly in ASCII format. Clean, not embellishments or tags. Sometimes it needs to be that way. What do I use to save ASCII text on a Mac? Somebody at the Apple store told me the answer

  • My iPad air would not start.  Only show the apple logo then no reaction after that.

    My iPad air would not start.  Only show the apple logo then no reaction after that.  This is already the 2nd time.  Last time I sent back to the service center and they said it is the system problem and reset the system and charge me for the service

  • Apple TV and hd videos

    Hello, So I have purchased about 30 or so HD videos from the iTunes Store. I have been downloading the 1080p versions of the film. On my Apple TV 3 all the videos show up and I can stream and play them accordingly. However, on my first gen Apple TV..

  • Cursor disabled on one monitor.

    How do I access the second monitor? My active cursor won't cross to the other monitor. The other has the menu and all the icons. I am unable to use the cursor because it won't cross over to the other (second) monitor. I think I changed a setting. But