Using DBMS_ALERT package

Hello,
I would like to use DBMS_ALERT package. I have read documentation about this package. It works correctly but I have noticed that sometime the pl/sql block (with dbms_alert) performed quick but sometimes it lasted too long. There is no traffic od the server. So my questions are followed:
a) what could be the reason that calling dbms_alert sometimes last too long?
b) how performance is affected
c) waiting session has active status. It is good idea to use shared server for this purpose?
Thanks

I have just now solved my problem with DBMS_ALERT :-). I described my problem badly.
My application using dbms_alert started wait when I issue statement dbms_alert.waitone (in another thread). The problem was that my database was misconfigured :-(. I have only one shared_server process and session with dbms_alert.waitone blocked this shared server and any other session cann't work for a while.
SASA
PS: The way of understanding is very twisting :-)

Similar Messages

  • Using dbms_alert in Jdeveloper

    Hello!
    I need check signal from OracleDatabase in my application on the JSP Page.
    How I can using dbms_alert package for my JSP page?
    Thanks.

    Not specific for DBMS_ALERT but here are the basics from the JDBC developer guide:
    http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm#1002489

  • Dbms_alert package under C++ Daemon

    Hi,
    I have created a C++ Daemon whihc is using dbms_alert package.
    When Daemon runs it makes a call
    dbms_alert.waitone("ALERTNAME","MESSAGE", STATUS);
    well this is a blocking call as i don;t want to use timeout as 0.
    Now when i want to stop my Daemon how can overcome this blocking call?
    Many Thanks

    Thanks
    But i have alreay mentioned that dbms_alert.remove doesn't work.
    Here is a code snippet -
    As one can see below that i m looking for code snippet under '_Stop' function as i want to stop the thread workign which is blocked inside 'Action' function.
    ie when i sent SIGNAL
    kill -SIGTERM <PID>
    OTLThread.h
    ===========
    #ifndef OTLThreadh_
    #define OTLThreadh_
    #include <iostream>
    #define OTL_ORA8 // Compile OTL 4.0/OCI8
    #define OTL_STL // Turn on STL features
    #define OTL_ANSI_CPP // Turn on ANSI C++ typecasts
    #include <otlv4.h> // include the OTL 4.0 header file
    #include <boost/thread/thread.hpp>
    #include <boost/thread/condition.hpp>
    using namespace std;
    class OTLThread
         boost::mutex                    m_mtxEvent;
         boost::mutex                    m_mtxExclusive;
         boost::condition          m_cndEvent;
         bool                                        m_bWantPause;
         bool                                        m_bWantStop;
         bool                                        m_bFirstRun;
         protected:
         static OTLThread *          M_pOTLThread;
         otl_connect db; // connect object
         otl_stream                                   oRslts;     
         std::string strSQL;
         public:
                        OTLThread();               
         bool     WantStop();
         bool     WantPause();
         void     _Resume();
         static void Resume(){ if (M_pOTLThread) M_pOTLThread->_Resume(); }
         void     _Pause();
         static void Pause(){ if (M_pOTLThread) M_pOTLThread->_Pause(); }
         void     _Stop();
         static void Stop(){ if (M_pOTLThread) M_pOTLThread->_Stop(); }
         void     Run();
         bool DBConnect();
         bool DBDisConnect();
         void Action();
         void     operator()();
    };//class OTLThread
    #endif/*OTLThreadh_*/
    OTLThread.cpp
    =============
    #include "OTLThread.h"
    OTLThread * OTLThread::M_pOTLThread = NULL;
    OTLThread::OTLThread():
         m_bWantStop(false),
    //Set this to true for a 'start-paused' thread model
    //and set this to false for a 'start-running' model.
         m_bWantPause(false),
         m_bFirstRun(true)
         if (!M_pOTLThread)
              M_pOTLThread = this;
    void OTLThread::_Resume()
         boost::mutex::scoped_lock lk (m_mtxExclusive);
         if(m_bWantPause)
              m_bWantPause = false;
              m_cndEvent.notify_all();
         else
              cout
              << "[OTLThread]: Already Resumed, please Pause first"
              << endl;
    void OTLThread::_Pause()
         boost::mutex::scoped_lock lk (m_mtxExclusive);
         if (!m_bWantPause)
              m_bWantPause = true;
              m_cndEvent.notify_all();
         else
              cout
              << "[OTLThread]: Already Paused, please Resume first"
              << endl;
    void OTLThread::_Stop()
         boost::mutex::scoped_lock lk (m_mtxExclusive);
    //     oRslts.close();
         std::string sql;
         sql = "call dbms_alert.REMOVE('INSERTALERT')";
    otl_cursor::direct_exec
    db,
    sql.c_str()
    ); // Registering the Alert
         m_bWantStop = true;
         m_cndEvent.notify_all();
    void OTLThread::Run()
         boost::mutex::scoped_lock lk (m_mtxEvent);
         DBConnect();
         while (true)
              if (m_bWantStop) break;
              if (m_bWantPause)
                   cout
                   << "\n\t\t"
                   << "[" << getpid() << "] "
                   << "[OTLThread]: Pausing..."
                   << endl;
                   m_cndEvent.wait(lk);
              if (m_bWantStop) break;
              Action();
         cout
         << "\n\t\t"
         << "[" << getpid() << "] "
         << "Activity: [" << "OLT" << "]: Stopping...\n"
         << endl;
         DBDisConnect();
    bool OTLThread::DBConnect()
    otl_connect::otl_initialize(); // initialize OCI environment
    try{
    db.rlogon("sam/sam"); // connect to Oracle
         std::string sql;
         sql = "call dbms_alert.register('INSERTALERT')";
    otl_cursor::direct_exec
    db,
    sql.c_str()
    ); // Registering the Alert
    catch(otl_exception& p){ // intercept OTL exceptions
    cerr<<p.msg<<endl; // print out error message
    cerr<<p.stm_text<<endl; // print out SQL that caused the error
    cerr<<p.var_info<<endl; // print out the variable that caused the error
         return false;
    return true;
    bool OTLThread::DBDisConnect()
    try{
         db.logoff(); // disconnect from Oracle
    catch(otl_exception& p){ // intercept OTL exceptions
    cerr<<p.msg<<endl; // print out error message
    cerr<<p.stm_text<<endl; // print out SQL that caused the error
    cerr<<p.var_info<<endl; // print out the variable that caused the error
         return false;
    return true;
    void OTLThread::Action()
         strSQL = "call dbms_alert.waitone('INSERTALERT', :f1<char,out>, :f2<int,out>)";
         char     Result;
         char f1;
         int f2;
    try{
              db.set_max_long_size(7000);
              oRslts.open(1,strSQL.c_str(),db);          //Waiting for Insert to happen Blocking Call
              oRslts>>f1>>f2>>Result;
              if(f2 == 0)
         std::cout<<"Hey! there is some record in ap3_soln_trigger"<<std::endl;
              oRslts.close();
    catch(otl_exception& p){ // intercept OTL exceptions
    // cerr<<p.msg<<endl; // print out error message
    // cerr<<p.stm_text<<endl; // print out SQL that caused the error
    // cerr<<p.var_info<<endl; // print out the variable that caused the error
         oRslts.close();
    void OTLThread::operator()()
         Run();
    OTLThreadMain.cpp
    =================
    #include <csignal>
    #include <iostream>
    #include "OTLThread.h"
    void Handler(int iSigno)
         if (iSigno == SIGTERM)
              OTLThread::Stop();
         else if (iSigno == SIGUSR1)
              OTLThread::Pause();
         else if (iSigno == SIGUSR2)
              OTLThread::Resume();
    int main(int argc, char *argv[])
         OTLThread*                                                            pT;
         boost::thread_group*                              ptg;
         signal(SIGTERM, Handler);
         signal(SIGUSR1, Handler);
         signal(SIGUSR2, Handler);
         ptg = new boost::thread_group();
         pT = new OTLThread();
    ptg->create_thread(boost::ref(*pT));
    ptg->join_all();
    return EXIT_SUCCESS;
    Makefile
    ========
    # To use this Makefile on WIN32 (if at all there are Makefiles in WIN32): #
    # - Set BUILDER_ROOT to the directory which contains the directory in which #
    # you unzipped this zip archive #
    # - Set BOOST_ROOT to the boost source tree #
    # - Set BOOST_INC_ROOT to the boost include files' root directory #
    # - Set BOOST_LIB_ROOT to the boost libs root directory #
    # - Set BOOST_THREAD_INCDIR to the boost.threads include directory #
    # - Set BOOST_THREAD_LIBS to the boost.threads libs directory #
    # - Set BOOST_THREAD_LIBS as required by the WIN32 linkage rules #
    # - Run make (and don't fume if it doesn't work ... I am just a novice #
    # when it comes to WIN32) #
    CC = c++
    COMPILE = -c
    DEBUG = -g
    BOOST_ROOT = /home/lalit/Development/Libs/boost_1_30_0
    BOOST_INC_ROOT = $(BOOST_ROOT)/boost
    BOOST_LIB_ROOT = $(BOOST_ROOT)/libs
    BOOST_THREAD_INCDIR = $(BOOST_INC_ROOT)/thread
    BOOST_THREAD_LIBDIR = $(BOOST_LIB_ROOT)/thread/build/bin-stage
    BOOST_THREAD_LIBS = -lboost_threadd -lboost_thread
    OTL_INCLUDE = /home/lalit/Development/Libs/OTL_4_1_18/include
    CFLAGS = -I$(BOOST_ROOT)
    CFLAGS += -I$(OTL_INCLUDE)
    CFLAGS += -I$(ORACLE_HOME)/rdbms/demo
    CFLAGS += -I$(ORACLE_HOME)/rdbms/public
    CFLAGS += $(DEBUG)
    LDFLAGS = -L$(BOOST_THREAD_LIBDIR) $(BOOST_THREAD_LIBS)
    LDFLAGS += -L$(ORACLE_HOME)/lib -lclntsh
    OBJS = OTLThread.o
    FINAL = OTLThreadMain
    All : $(FINAL)
    $(FINAL) : OTLThreadMain.o OTLThread.o
         $(CC) $(LDFLAGS) -o $@ $< $(OBJS)
    OTLThreadMain.o : OTLThreadMain.cpp
         $(CC) $(COMPILE) $(CFLAGS) $<
    OTLThread.o : OTLThread.cpp OTLThread.h
         $(CC) $(COMPILE) $(CFLAGS) $<
    clean:
         rm -f *.o $(FINAL)

  • Using dbms_job package

    1.I wanted to know if I can run a .sql file from the dbms_job package.
    2. I also wanted to know the feature in oracle that I can use to send email to myself once the job is executed- showing successful execution or errors.
    Thanks for your suggestions.

    You cannot pass parameters back from a job-- Oracle spawns a separate session to run your job, so that session would receive any OUT parameters and end immediately after the job finishes. Even if Oracle let you do this, you would lose the OUT value as soon as the job ended.
    If you want a job to return a status, you can-
    1) Store the status in a table
    2) Queue a status message in an Oracle Advanced Queue
    3) Use dbms_alert to alert another process
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Dbms_alert package

    Is it possible to use the dbms_alert package from within jdbc to react on events?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by GSoergel ():
    Is it possible to use the dbms_alert package from within jdbc to react on events? <HR></BLOCKQUOTE>
    I have got the same problem. Did you managed to solve it?
    null

  • Problems with the dbms_alert Package

    Hello everybody,
    I am having some problems while using the ORACLE dbms_alert
    package, problems which are not documented, at least anywhere
    that I can tell.
    Namely the table dbms_alert_info, which holds the registered
    alerts of the coresponding sessions doesn't seem to behave the
    way it is expected. To be more specific: I start one session and
    I begin to register alerts. Everything is fine with the table.
    But when a new session starts and tries to register an alert
    (doesn't matter if it is identical with the previous session's
    alerts or different) the first session's registered alerts are
    deleted and are replaced with the latest registered alert of the
    second session. The strange thing is that after the first time,
    everything works just fine (that is alerts are registered as
    expected from both sessions). The problem is that there is no
    source code from the package body (as you may have noticed the
    package body is 'wraped').
    So, please, if someone has encountered the same problems (and
    solved it) let me know.
    Thanks a lot
    Nikos Papakyriakou, Athens-Greece.
    null

    You will need to grant execute of DBMS_PIPE to the owner login
    Or any login that would use the DBMS_PIPE
    Login as SYS and execute the following:
    GRANT EXECUTE ON DBMS_PIPE TO <owner login>;Hope this helps
    Edited by: jl1997 on Mar 14, 2011 7:26 AM

  • Error while sending a mail using UTP_MAIL package in Oracle 10g

    Hi,
    We are using UTP_MAIL package to send a mail from Oracle 10g.We have follwed the following steps ...
    SQL> connect sys/password as sysdba
    Connected.
    SQL> @$ORACLE_HOME/rdbms/admin/utlmail.sql
    Package created.
    Synonym created.
    SQL> @$ORACLE_HOME /rdbms/admin/prvtmail.plb
    Package body created.
    SQL > alter system set smtp_out_server = '<mail_server_ip:25>' scope =spfile;
    System altered..
    Now we try the code
    begin
    utl_mail.send(
    sender => 'sender's mail',
    recipients => 'receiver mail',
    CC => 'optional',
    subject => 'Testing utl_mail',
    message => 'Test Mail'
    end;
    But we get the following error...
    ERROR at line 1:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 139
    ORA-06512: at "SYS.UTL_MAIL", line 405
    ORA-06512: at "SYS.UTL_MAIL", line 594
    ORA-06512: at line 2
    We also tried connecting to the mail server through telnet .But it is not getting connected..
    Please help us to solve the issue.

    From your own posting you may have the clue, if you try to access your mail server through telnet and it is not successful, it means the service is down or there are networking issues.
    On pre 10gR2 versions there was a bug 4083461.8. It could affect you if you are on 10gR1
    "Bug 4083461 - UTL_SMTP.OPEN_CONNECTION in shared server fails with ORA-29278 Doc ID:      Note:4083461.8"
    This was fixed on 10gR2 base and on 9.2.0.8.0
    ~ Madrid

  • How to delete data from a file using IO package

    Hi All,
    i am trying to remove some content of the file.
    this content is not at starting of file not even at end of file.
    can anybody tell me how can i delete number of lines from file using IO package.

    iam having some data in text file .ex:in flowrist.txt
    12/5/07,500,300,6000 like many set of datas are
    there.In these if i want to delete the data based on
    the date which i specified.How to do this specific
    deletion?You need to open a stream to read in the file and then use the indexOf method provided in the Sting class to check if the line contains the date or whatever String you are looking for, if so then skip that line and store or re-write the lines you wish to keep, as well as some extra lines you may wish to add.
    Take a look below at this example found on Google.
    http://www.java-tips.org/java-se-tips/java.io/how-to-read-file-in-java.html
    The above read a file line by line and prints it to console. You should be able to modify this, instead of using System.out to print the line you should use index of to check the lines for a date/String. Index of return -1 if the String you specify is not in the line you parse.

  • Help finding and using a package

    hi guyz,
    Iam new to this forum and i need this info urgently. so plz try to help me.
    I want to use the package below in an applet to convert my TemporaryRegistrationPermit to create a PNG file and then print it.
    how can i get the above package. I searched a lot on net and even on IBM website but never found it. How can i get it and include the class file in an applet and use the methods in it.Is there any other way to include this package in my applet, i mean a URL pointing to this class file.
    package com.ibm.gs.houston.saz.trp.utils.TemporaryRegistrationPermit
    I would really appreciate an early reply
    thank you
    tarun

    How do you know you need this package ? You know the path to it, so you must have seen it referenced somewhere.
    Some background please, but it sounds like it's an IBM internal class of some sort, so I wouldn't get your hopes up unless you have legitimate access to this or know it to be freely available.
    D.

  • Submitting Oracle job via OCCI using dbms_job package

    I am using 10g client to connect to a 9i Database on Redhat Linux AS 3.0.
    I am trying to submit a job via OCCI. I get back a jobId, but don't see the job in the user_jobs table or the result of the job being executed.
    I am using occi::Statement in the following way :
    stmt = connection->createStatement("begin dbms_job.submit(:v1, 'submitJobTest;', sysdate,'sysdate+1'); end;");
    // where submitJobTest is a stored procedure
    stmt->registerOutParam(1, OCCIINT);
    stmt->executeUpdate();
    int jobId = stmt->getInt(1);
    I get back a job id, but can't find it in the user_jobs. The first time I executed the program, i got back jobId 0, then 1 and so on..
    Any ideas? Do I need to use dbms_scheduler package?
    Thanks, Nilofer

    Good catch!
    Had a bug, in that my autocommit was not being set!
    Works now.
    Thanks,
    Nilofer

  • How to print new line using DBMS_OUTPUT package

    Hi,
    I am trying to print a new line using DBMS_OUTPUT package. but it do not print the new line.
    set serveroutput on size 200000
    set feedback on
    BEGIN
    DBMS_OUTPUT.PUT_LINE('First Line');
    DBMS_OUTPUT.PUT_LINE('');
    DBMS_OUTPUT.PUT_LINE('Second Line');
    END;
    I expect following output ...
    First Line
    Second Line
    but i got following output....
    First Line
    Second Line
    why DBMS_OUTPUT.PUT_LINE( '); is not printing a new line ?

    You can try the following:
    SQL> ED
    Wrote file afiedt.buf
      1  BEGIN
      2  DBMS_OUTPUT.PUT('ONE LINE...');
      3  DBMS_OUTPUT.PUT('SECOND LINE...');
      4  DBMS_OUTPUT.NEW_LINE;
      5  DBMS_OUTPUT.PUT_LINE('THIRD LINE WITH NEW LINE...');
      6  DBMS_OUTPUT.PUT('TEST');
      7  DBMS_OUTPUT.NEW_LINE;
      8  DBMS_OUTPUT.PUT_LINE('FOURTH LINE'||CHR(10)||'EXAMPLE');
      9  DBMS_OUTPUT.PUT_LINE(CHR(10));
    10  DBMS_OUTPUT.PUT_LINE('FIFTH LINE');
    11* END;
    SQL> /
    ONE LINE...SECOND LINE...
    THIRD LINE WITH NEW LINE...
    TEST
    FOURTH LINE
    EXAMPLE
    FIFTH LINE
    PL/SQL procedure successfully completed.Documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_output.htm#i1000062

  • How do I create and use a package?

    Sorry for the noobish question, but I have never had the need to use a package and currently would like to learn how they work just to satisfy my own curiosity.
    Suppose I have a file named Node.class in a folder named Classes, and I have another class named Main.class sitting in another folder. I want to create a Node object using the Main class.
    How do I accomplish that? Would I need to use a package?
    I tried to write package Classes; on my Main file but it did not work. thanks

    This is an old explanation I wrote:
    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    And a statement to run the program is:
    java myapp.aProgram
    (This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • Error while invoking webservice using UTL_HTTP package

    Hi All,
    I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
    I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is errorring out while getting response back.
    and the PL/SQL Block is ending in error mentioned below:
    ERROR at line 1:
    ORA-29266: end-of-body reached
    ORA-06512: at "SYS.UTL_HTTP", line 1321
    ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
    ORA-06512: at line 1
    Can anyone let me know what is the cause of this.
    Thanks in advance

    My guess would be that your request is not properly constructed,
    29266, 00000, "end-of-body reached"
    // *Cause:  The end of the HTTP response body was reached.
    // *Action: If the end of the HTTP response is reached prematurely, check if
    //          the HTTP response terminates prematurely.  Otherwise, end the
    //          HTTP response.John

  • Error while using UTL_DBWS package

    Hello
    I want to call a web service using UTL_DBWS package as explained in this link.
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    I implemented the example successfully, and I need to my own web service.
    my web service is just a java class that return a hello world and a parameter. deployed on Integrated weblogic server shipped with Jdeveloper11g.
    here is my java class
    package ws;
    import javax.jws.Oneway;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService
    public class HelloWorld {
        public HelloWorld() {
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloWorld(){
            return "Hello World";
        @WebMethod(action = "http://ws//sayHelloWorld")
        public String sayHelloName(@WebParam(name = "arg0")
            String n){
            return "Hello " + n;
    }my WSDL is
      <?xml version="1.0" encoding="UTF-8" ?>
    - <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <!--  Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.5.
      -->
    - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="HelloWorldService">
    - <types>
    - <xsd:schema>
      <xsd:import namespace="http://ws/" schemaLocation="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?xsd=1" />
      </xsd:schema>
      </types>
    - <message name="sayHelloWorld">
      <part name="parameters" element="tns:sayHelloWorld" />
      </message>
    - <message name="sayHelloWorldResponse">
      <part name="parameters" element="tns:sayHelloWorldResponse" />
      </message>
    - <message name="sayHelloName">
      <part name="parameters" element="tns:sayHelloName" />
      </message>
    - <message name="sayHelloNameResponse">
      <part name="parameters" element="tns:sayHelloNameResponse" />
      </message>
    - <portType name="HelloWorld">
    - <operation name="sayHelloWorld">
      <input message="tns:sayHelloWorld" />
      <output message="tns:sayHelloWorldResponse" />
      </operation>
    - <operation name="sayHelloName">
      <input message="tns:sayHelloName" />
      <output message="tns:sayHelloNameResponse" />
      </operation>
      </portType>
    - <binding name="HelloWorldPortBinding" type="tns:HelloWorld">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
    - <operation name="sayHelloWorld">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
    - <operation name="sayHelloName">
      <soap:operation soapAction="http://ws//sayHelloWorld" />
    - <input>
      <soap:body use="literal" />
      </input>
    - <output>
      <soap:body use="literal" />
      </output>
      </operation>
      </binding>
    - <service name="HelloWorldService">
    - <port name="HelloWorldPort" binding="tns:HelloWorldPortBinding">
      <soap:address location="http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort" />
      </port>
      </service>
      </definitions>and my function is to call the web service
    CREATE OR REPLACE FUNCTION SAYHelloMYNAME (p_int_1 IN Varchar2)
      RETURN NUMBER
    AS
      l_service          UTL_DBWS.service;
      l_call                 UTL_DBWS.call;
      l_wsdl_url         VARCHAR2(32767);
      l_namespace        VARCHAR2(32767);
      l_service_qname    UTL_DBWS.qname;
      l_port_qname       UTL_DBWS.qname;
      l_operation_qname  UTL_DBWS.qname;
      l_xmltype_in        XMLTYPE;
      l_xmltype_out       XMLTYPE;
      l_return          VARCHAR2(100);
    BEGIN
      l_wsdl_url        := 'http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl';
      l_namespace       := 'http://ws/';
      l_service_qname   := UTL_DBWS.to_qname(l_namespace, 'HelloWorldService');
      l_port_qname      := UTL_DBWS.to_qname(l_namespace, 'HelloWorldPort');
      l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sayHelloName');
       l_service := UTL_DBWS.create_service (
        wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
        service_name           => l_service_qname);
      l_call := UTL_DBWS.create_call (
        service_handle => l_service,
        port_name      => l_port_qname,
        operation_name => l_operation_qname);
      l_xmltype_in :=  XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
        <sayHelloWorld xmlns="' || l_namespace || '">
          <parameters>' || p_int_1 || '</parameters>
          </sayHelloWorld>');
      l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
                                       request     => l_xmltype_in);
      UTL_DBWS.release_call (call_handle => l_call);
      UTL_DBWS.release_service (service_handle => l_service);
      l_return := l_xmltype_out.extract('//return/text()').getstringVal();
      RETURN l_return;
    END;
    /but when I test the function I get this error
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: Failed to read wsdl file at: "http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl", caused by: java.net.ConnectException.    : Connection refused
    ORA-06512: at "WSUSER.UTL_DBWS", line 193
    ORA-06512: at "WSUSER.UTL_DBWS", line 190
    ORA-06512: at "WSUSER.SAYHELLOMYNAME", line 24any suggestions?

    M.Jabr wrote:
    can you elaborate more on this?
    I can open http://127.0.0.1:7101/Application15-Model-context-root/HelloWorldPort?wsdl
    on my browser.Is your browser on that Oracle server? You are instructing Oracle server code (the UTL_DBWS package) to access that URL.
    The IP in that URL is a localhost IP address - and that means using the local IP stack only. So it expects a web server on the Oracle server platform on tcp port 7101. It cannot use that IP to access your client/development machine.
    How can I test it using UTL_HTTP?You can write a basic web browser, minus the rendering engine, using UTL_HTTP. You can also use it for web service calls - which is my preference as I deem the UTL_DBWS package to clunky and complex.
    See:
    {message:id=1925297} (sample PL/SQL web browser)
    {message:id=4205205} (sample PL/SQL web browser SOAP call)

  • Dynamic attachment name with receiver mail adapter and use mail package

    We need to send mapped XML payload as attachment (with dynamic name) to a recepient (recepient email id is part of input xml payload, but not part of the mapped XML payload).
    I could probably do this using the adapter module (as per the following link),
    http://wiki.sdn.sap.com/wiki/display/XI/Adapter%20Module%20PI%207.0%20Set%20Attachment%20Name?bc=true
    I would like to explore if this would be feasible using Mail package and XI payload.I already have a Java mapping that is converting the input XML to required Output format. If I am using Mail package (XI Payload), how do I go about sending this Output XML from java mapping as attachment to email id available in the input payload?

    Hi,
    1) XML payload as attachment (with dynamic name)
    2) recipient (recipient email id is part of input xml payload, but not part of the mapped XML payload)
    These two is possible by using Mail Package. You have a standard xsd for mail package which you can download from the SAP Note 748024.
    The xml created in you java mapping which will be your attachment should be put into the <content> tag of the mail package xml structure. and the file name can be set in the <Content_Type> tag.
    <?xml version="1.0"; encoding="UTF-8"?>
    <p2:Mail xmlns:p2="http://sap.com/xi/XI/Mail/30">
    <Subject>My Invoice</Subject>
    <From>from email address<;/From>
    <To>to email address</To>
    <Content_Type>text/plain;name="MyFile.csv";</Content_Type>  --> file name here
    <Content>123;A49;aaa</Content>   -> attachment xml here
    </p2:Mail>
    And you have to select MailPackage in the receiver mail adapter.
    Regards,
    Aravind

Maybe you are looking for

  • How do you delete Duplicate loops from AMG (third party loops)?

    I bought two packages from AMG but after installing them in GarageBand I noticed that some of their loops appear twice in the loop browser. I guess there was a copy of each of these loops in both AMG packages. I've tried playing some of them - just t

  • Unable to load database, locales [Arabic_SaudiArabia.ISO-8859-6@Default]

    When trying to load data into Essbase I get this error dialogue Object [65313270] is locked by user [admin@Native Directory] Unable to load database, locales [Arabic_SaudiArabia.ISO-8859-6@Default] and [English_UnitedStates.Latin1@Binary] are not com

  • How to restrict running of report in foreground

    My requirement is that, the user should not be allowed to run the report in foreground. Since there is a high possibility for the report  to go to time-out.. I want to force the user to run it in background only.. How can we do that ? IS it Basis rel

  • Install htmlDb 1.6

    Hi, I installed htmldb 1.5 version using the oracle database companion CD and now I want to install the latest version of htmlDB i.e V 1.6. For this, do I need to uninstall 1.5 or do I have to upgrade the existing 1.5 to 1.6?. if any one knows how to

  • ICloud data while being in China

    I am staying in mainland China and want to use iCloud services (photo stream) with the same account. I am using my Apple ID for the French iTunes and App store. In which country will my data be saved during my stay ? in the nearest server (in China)