Exception when calling web service from Oracle forms 10g

Hi All,
I am trying to integrate Oracle Forms 10g(V 10.1.2.0.2.) with Web Services.
There is a java class named 'authenticate' which is generated using Oracle JDeveloper.
This class is included in the forms application by using "Import Java Class" feature.
Forms built the following funtion based on that class:
-- Method: authenticate (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
FUNCTION authenticate(
obj ORA_JAVA.JOBJECT,
a0 VARCHAR2,
a1 VARCHAR2) RETURN VARCHAR2 IS
BEGIN
args := JNI.CREATE_ARG_LIST(2);
JNI.ADD_STRING_ARG(args, a0);
JNI.ADD_STRING_ARG(args, a1);
message('here1');
RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'mypackage/AuthenticatorWebServiceServiceStub',
'authenticate', '(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;', args);
message('here2');
END;
However when the above code is invoked it shows the message 'here1' on the form and then throws the following exception: java.lang.Exception: java.lang.ClassCastException
Please suggest me what's wrong with the code. I appreciate your time and help.
Thanks,
Scott.

My primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
Thanks

Similar Messages

  • Calling web service from oracle forms 10g

    Problem Description:
    I'm following the steps as per the doc:
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
    to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
    WSDL for external web service used is http://gend:83/DesignService.svc?wsdl
    The service was developed by us.
    Calling the web service using JDeveloper works fine but when I complie in Oracle Forms it returns wrong number of types of arguments in call SENDHELLO.
    The code from oracle form to call web service is as below:
    DECLARE
    jo ora_java.jobject;
    xo ora_java.jobject;
    rv varchar2(2000);
    ex ora_java.jobject;
    str varchar2(100);
    BEGIN
    jo := GendServiceClient.new;
    rv := GendServiceClient.sendHello('Nora');
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    message(Exception_.toString(ex));
    END;
    Any help/ideas on this is greatly appreciated. Thanks.
    Edited by: KE Nora Loera on Jun 1, 2012 1:24 PM

    My primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
    I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
    Thanks

  • How to call web services from oracle database 10g

    Hi all ,
    How can i call web services from oracle database 10g ?
    thanks ...

    abdou123 wrote:
    but how can i get complex result
    for example
    i pass input parameter like National Id Number
    and get the person details ( name , age , date of birth , ............ ) .Basic approach to web services using UTL_HTTP explained in {message:id=10448611}.
    An example of using a pipeline table function as a data transformation process (turning web data into rows and columns) in {message:id=10158148}.

  • Calling web service from oracle forms fails with ORA_JAVA.JAVA_ERROR

    Problem Description:
    I'm following the steps as per the doc:
    http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
    to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
    WSDL for external web service used is http://www.webservicex.net/CurrencyConverter.asmx?wsdl
    Calling the web service using JDeveloper works fine but from Oracle Forms returns ORA_JAVA.JAVA_ERROR; Unable to call out to Java, Invalid object type for argument 1
    The code from oracle form to call web service is as below:
    DECLARE
    jo ora_java.jobject;
    rv ora_java.jobject;
    ex ora_java.jobject;
    outString varchar2(2000);
    BEGIN
    jo:= CurrencyConvertorStub.new;
    --This will get the exchange rate from US Dollars to UK Sterling.
    rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD');
    message (float_.floatValue(RV));
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    outString := Exception_.toString(ex);
    message(outString);
    END;
    Any help/ideas on this is greatly appreciated. Thanks.

    Yes, it is the message line - so basically this call fails => rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD'); and control goes in the exception block
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    Below is the code from java stub that was generated using JDeveloper by using web services stub/skeleton and associating the WSDL
    public Double ConversionRate(String FromCurrency, String ToCurrency) throws Exception
    URL endpointURL = new URL(endpoint);
    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();
    String wrappingName = "ConversionRate";
    String targetNamespace = "http://www.webserviceX.NET/";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"FromCurrency", FromCurrency});
    requestData.add(new Object[] {"ToCurrency", ToCurrency});
    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);
    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://www.webserviceX.NET/ConversionRate", requestEnv);
    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();
    return (Double)fromElement((Element)responseData.elementAt(0), java.lang.Double.class);
    }

  • Error when calling Web Service from Adobe Form

    Hi all,
    I need to invoke a Web Service from my Adobe Interactive Form. I have merged the WSDL files, following the steps in this document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/148ec26e-0c01-0010-e488-decaafae3b26
    But when I press the corresponding button in order to call the web service, I get the following error:
    "Error trying to read file.
    http://<my_host>:51000/<my_WS>/Config1?style=document"
    It seems to be an error in my configuration, because I'm sure that I have followed all steps in the previous PDF.
    Any idea?
    Thanks.

    Well, I think so... I've followed all the steps, and my merged WSDL file seems like the one in page 12...
    Any suggestion, please?
    Thank you,

  • Call a web services from oracle forms 10

    I have to call a web services from oracle forms.
    The version of the database is oracle 11gr2. the version of the forms is 10.1.2.0.2.
    I allready did the proxy creation and the import class within forms.
    I have 2 questions:
    1.
    I created the following procedure:
    PROCEDURE call_WS IS
         vobject1 ORA_JAVA.JOBJECT;
         vobject2 ORA_JAVA.JOBJECT;
    BEGIN
    vobject1 := WSEvaluarReglaCondicionComerci.new();
    vobject2 := WSEvaluarReglaCondicionComerci.listarValoresAtributoEvento(vobject1, 702, 2217, null, null, null);
    END;
    the function I calling:
    FUNCTION listarValoresAtributoEvento(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JOBJECT,
    a1 ORA_JAVA.JOBJECT,
    a2 ORA_JAVA.JOBJECT,
    a3 VARCHAR2,
    a4 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT;
    Note that the parameters is ORA_JAVA_JOBJECT and I need to send numbers. I understand that when I import the classes, because in the WS those parameters are defined as BigDecimal, Forms understand them as java object but when I compile it reports the error: "numero o tipo de argumento erroneo al llamar..." type error.
    So the question is, how Cast the numbers to Java Object to send them.
    I have read in a web page that one option is to change in the web service the type of the parameters but that is not an option.
    2.
    The WS returns a super big XML as answer, so how I can parse the result into an Object type?...
    The object structure is:
    TYPE opciones_obj AS OBJECT
    (strindice VARCHAR2 (4000),
    nombrecompleto VARCHAR2 (4000),
    nombre VARCHAR2 (4000),
    strtipodato VARCHAR2 (4000),
    codigoopcion NUMBER,
    floatval FLOAT,
    strtipo VARCHAR2 (4000),
    strval VARCHAR2 (4000));
    and the tags to extract is:
    COLUMNS strindice VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strIndice"]/ns2:value',
    nombrecompleto VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="nombreCompleto"]/ns2:value',
    nombre VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="nombre"]/ns2:value',
    strtipodato VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strTipoDato"]/ns2:value',
    codigoopcion NUMBER
    PATH 'ns2:mapEntry[ns2:key="codigoOpcion"]/ns2:value',
    floatval FLOAT
    PATH 'ns2:mapEntry[ns2:key="floatVal"]/ns2:value',
    strtipo VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strTipo"]/ns2:value',
    strval VARCHAR2 (4000)
    PATH 'ns2:mapEntry[ns2:key="strVal"]/ns2:value') x;
    xquery / xmltype aparently is not an option because the xml is too big.
    I will appreciate your answers.
    Thanks.
    Edited by: user13058213 on 26-ene-2012 16:02

    i created jar file to call it from forms
    Could you be a little bit less vague about what you exactly did?
    Anyway; see here http://bit.ly/10VVoMR
    cheers

  • Calling web service from oracle application framework r12

    Hi Techies
    Is anybody know How to call web service from oracle application framework r12(step by step procedure),because i searched in net but i could not understand that one
    Thanks
    Dillibabu B
    Edited by: 962005 on 28 Sep, 2012 12:11 AM

    Hi,
    Check below links:
    http://oracle.anilpassi.com/oa-framework-with-captcha-webservice.html
    http://oracle.anilpassi.com/integrate-oa-framework-with-web-service.html
    https://blogs.oracle.com/ebusinesssuiteintegration/entry/r121_-invokingweb_service_fr
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • URGENT!!! calling crystal reports from oracle forms 10g

    Is it possible to call crystal reports from oracle forms 10g?
    Can someone help to answer how, if there is a solusion, to call crystal reports from oracle forms 10g.
    Please provide codes with details showing step by step.
    Thanks

    hi
    try something like this.
    DECLARE
    charWinHandle VARCHAR2(50);
    numWinHandle NUMBER;
    BEGIN Set_Application_Property(Cursor_Style,'BUSY');
    charWinHandle := Get_Item_Property('Control.Rep',Window_Handle);
    numWinHandle := To_Number(charWinHandle);
    :Item('Control.CrystalReport1').OCX.Crystal.Crysta lReport.WindowParentHandle
    := numWinHandle;
    :Item('Control.CrystalReport1').OCX.Crystal.Crysta lReport.WindowState := 2;
    :Item('CONTROL.CRYSTALREPORT1').OCX.Crystal.Crysta lReport.Connect
    := 'DSN=;UID=' || Get_Application_Property(UserName) ||
    ';pwd=' || Get_Application_Property(password) || ';dsq=;';
    Crystal_CrystalCtrl.ReportFileName( :Item('Control.CrystalReport1').interface,
    'C:\Sample_Rep.Rpt' );
    Set_Window_Property( Forms_Mdi_Window, Window_State,Maximize );
    Set_Window_Property( 'MAIN', Window_State, Maximize );
    :reptitle := 'Report Preview Window';
    numWinHandle := Crystal_CrystalCtrl.PrintReport( :Item('Control.CrystalReport1').interface );
    Set_Application_Property(Cursor_Style,'DEFAULT');
    END;NOTE: Change the report name and path according to your required file name and path in
    the "Crystal_CrystalCtrl.ReportFileName" method call. Also, the connection string shown
    assumes that you will use the current USER and PASSWORD for the Form.
    - To make the above Form generic so that you can run any Crystal report from it, then create
    a parameter for the report name and pass it to the Form using CALL_FORM from any other Form.
    Then just replace the file name with the passed parameter.
    -. Run the Form
    If its correct/helpful please mark it thanks.
    sarah
    Edited by: S@R@h on Nov 27, 2009 6:33 AM

  • Calling Crystal Reports from Oracle Forms 10G

    Hi everyone,
    I am trying to call a crystal report from Oracle Forms 10G.
    I have a button on my Form which when clicked calls a Crystal Report which the uaser then wants to save as a PDf file.
    Can someone please send me the code to do this and also the exact steps that are to be followed.
    Thanks
    Fm.

    Hi Andreas,
    I am trying to call the crystal report from an Oracle Form using a URL. No batch file is being used here.
    I am looking for a peice of code similar to run_product or run_report built in in Oracle which calls an Oracle report from an Oracle Form.
    Also I dont want to display the report on a screen or a window in Oracle Forms. I would like it to run just as we run an Oracle Report from an Oracle Form.
    Is that possible ? If yes please let me know the steps to do this.
    Thanks
    Faiz
    Edited by: IQ on May 13, 2011 11:38 AM

  • Calling a report from oracle form 10g

    how to call a report from oracle form 10g

    Please see the link:
    http://www.oracle.com/technology/products/forms/pdf/10g/frm10gsrw10g.pdf

  • Error received when calling web service from database.

    Hi folks,
    I am trying to call a web service from the database (using the Oracle database web services call-out utility) and I am getting the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.rmi.RemoteException:
    oracle.j2ee.ws.common.encoding.DeserializationException:unknown prefix in QName
    literal: null
    ORA-06512: at "SCOTT.PENALTY_ALG_WS_WRAPPER", line 1
    ORA-06512: at "SCOTT.ABC_PROC", line 131
    ORA-06512: at line 1
    This is the error I see in the trace file on the database:
    *** 2009-11-10 11:30:37.353
    java.rmi.RemoteException: oracle.j2ee.ws.common.encoding.DeserializationException:unknown prefix in QName literal: null
         at oracle.j2ee.ws.common.encoding.simpletype.XSDQNameEncoder.stringToObject(XSDQNameEncoder.java:75)
         at oracle.j2ee.ws.common.encoding.SimpleTypeSerializer.deserialize(SimpleTypeSerializer.java:141)
         at oracle.j2ee.ws.common.encoding.SOAPFaultInfoSerializer.doDeserializeSOAP11(SOAPFaultInfoSerializer.java:120)
         at oracle.j2ee.ws.common.encoding.SOAPFaultInfoSerializer.doDeserialize(SOAPFaultInfoSerializer.java:94)
         at oracle.j2ee.ws.common.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:180)
         at oracle.j2ee.ws.client.StreamingSender._readBodyFaultElement(StreamingSender.java:513)
         at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:321)
         at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
         at genproxy.runtime.PenaltyAlgBPELProcessBinding_Stub.process(genproxy.runtime.PenaltyAlgBPELProcessBinding_Stub:80)
         at genproxy.PenaltyAlgBPELProcessPortClient.process(PenaltyAlgBPELProcessPortClient.java:40)
         at genproxy.PenaltyAlgBPELProcessPortClientJPub.process(PenaltyAlgBPELProcessPortClientJPub.java:46)
    This web service is deployed on Oracle app server 10.1.3.4. It calls a BPEL process which in turn calls Oracle Business Rules.
    I used JPublisher to create the stubs for the web service and load them into the database.
    Any ideas on what might be causing this error?
    Thanks.
    Kashif

    Well, I think so... I've followed all the steps, and my merged WSDL file seems like the one in page 12...
    Any suggestion, please?
    Thank you,

  • Error calling web service from Adobe form

    Hi Experts,
    While calling web service form my adobe form, i was getting an error as below saying "Error attempting to read from the file" followed by the URL of my web service.
    To create the above scenario i followed the following steps:
    1. Create a Function module and create a web service from that function module.
    2. Through SOAMANAGER, download the WSDL file for the generated web service.
    3. Create an Adobe form with an empty Interface and create a new Data Connection on the form using the downloaded WSDL.
    4. Generate this adobe form using an ABAP report.
    Kindly extend help on this to figure out if I'm missing something!!!

    Well questions related to Web Services have been answered here in past, please Search on SCN for links to it.

  • Exception in calling web service from OAF page.

    Hi,
    I am trying to invoke a web service from OAF.
    But my code error out at particular statement where I am sending the message i.e. at
    SOAPMessage reply = connection.call(message, destination);
    The error message is
    java.security.privilegedactionexception: javax.xml.soap.SOAPException: Message send failed: For Input string "".
    I am using the wsdl link in destination variable-
    String destination = "http://soad.xxxxxxxxxx.org:80/soa-infra/services/default/xxxxxx/xxxxxxx?WSDL";
    Please help me with the solution.

    Have you tried submitting your help request on the SmartBear soapUI forum?
    http://www.eviware.com/forum/viewforum.php?f=5
    Or if a soapUI Pro user:
    http://www.eviware.com/forum/viewforum.php?f=2
    Best,
    Alex

  • Calling Word document from Oracle Forms 10g

    Hi all,
    I would like to call a Microsoft Word document from my Oracle Forms 10g.
    What would be the best way to do this?
    Thank you in advance.

    Have you tried something like
    WEB.SHOW_DOCUMENT('file:///<documentpath>','_blank');

  • Calling a Web service from Oracle Forms....

    Hi ,
    I 've tried to follow the steps described in the link:
    http://www.oracle.com/technology/obe/obe_as_10g/deploy/callws_fromforms/forms_webservice.htm
    which uses : a)JDeveloper 9.04 and b)Oracle Forms 9.0.4.
    However , i have installed Oracle Forms 10.1.2 and JDeveloper 10.1.2. (Developer Suite 10.1.2.).
    The problem is that in JDeveloper 10.1.2. the type of applications and menus and properties and.... have changed and i cannot finish the tutorial!!!!!
    Is there any document/example showing how to create a web service in JDeveloper and call it form Oracle Forms....?????
    NOTE: I have also installed JDeveloper 10.1.3...
    Many thanks ,
    Simon

    Check the JDeveloper tutorials page on OTN (linked from the JDeveloper home page) and you'll find a tutorial on creating a web service.
    The steps to invoke it from Forms should be the same.
    googling on Oracle Forms web services will bring a few more samples.

Maybe you are looking for