7 Replies Latest reply: Jul 11, 2013 7:38 AM by Billy~Verreynne RSS

    how to write a procedure for sending fax

    ReemaPuri

      how to write a procedure for sending fax for example in oracle apex

        • 1. Re: how to write a procedure for sending fax
          BluShadow

          Please read the FAQ:

           

          Re: 2. How do I ask a question on the forums?

           

          You have not supplied enough information for people to be able to help you.

          • 2. Re: how to write a procedure for sending fax
            ReemaPuri

            found thread for sending sms and email from oracle apex but is it possible to send fax through oracle apex, with oracle apex 4.1 and database 11g xe

            • 3. Re: how to write a procedure for sending fax
              Brian Bontrager

              In my experience, faxing is generally handled by additional software (such as RightFax)  or online services (efax.com).  You would write an interface to whichever fax software or service you use.  The solution is entirely dependent on your fax software/service.

               

              (Disclaimer: I have no relationship with either company mentioned; they are the first software and service that came to mind.  efax.com appears to have an email interface, so if you can send email you can send a fax - I imaging other online services provide this as well)

              • 4. Re: how to write a procedure for sending fax
                ReemaPuri

                i have write this procedure  and pl/sql wrapper for java  procedure status valid but java code showing invalid can anybody help

                CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "HelloWorldExample6"

                AS

                import net.interfax.outbound.SendCharFax;

                import net.interfax.outbound.SendCharFaxResponse;

                 

                 

                public class HelloWorldExample6 {

                 

                 

                    static String USERNAME = "neha";  //dummy

                    static String PASSWORD = "apex"; //dummy

                    static String FAX_NUMBER = "+12125554874 ";

                    static String TEXT_TO_FAX = "My text goes here";

                 

                 

                 

                    public static void main(String[] anArgs) {

                        try {

                            net.interfax.outbound.InterFaxSoapStub theBinding = (net.interfax.outbound.InterFaxSoapStub)new net.interfax.outbound.InterFaxLocator().getInterFaxSoap();

                            theBinding.setTimeout(60000);

                            System.out.println("Sending Fax using sendCharFax()");

                            SendCharFax theParams = new SendCharFax(USERNAME,

                                                                    PASSWORD,

                                                                    FAX_NUMBER,

                                                               

                                                                    FILE_TYPE);

                            SendCharFaxResponse theResponse = theBinding.sendCharFax(theParams);

                 

                            long theReturnCode = theResponse.getSendCharFaxResult();

                            System.out.println("sendCharFax() call returned with code: " + theReturnCode);

                        } catch (Exception e) {

                            e.printStackTrace();

                        }

                    }

                };

                /

                 

                 

                 

                create or replace PROCEDURE HELLO_WORLD4

                AS LANGUAGE

                JAVA NAME  'HelloWorldExample6.main( java.lang.String[])';

                 

                 

                 

                i have read we can wrap pl/sql around java for sending fax

                https://forums.oracle.com/thread/415711

                 

                for java fax query used

                 

                 

                http://www.interfax.net/en/dev/java/sendcharfax

                loaded Interfax.jar file also by loadjava Interfax.jar

                 

                to see status in apex

                select * from all_objects where object_type like '%JAVA%';

                • 5. Re: how to write a procedure for sending fax
                  Billy~Verreynne

                  Your Java code uses classes that need to exist in Oracle. Does it? Can it step outside of the JVM sandbox to communicate with the fax device? Is this device connected to the Oracle server? Is the device driver interface to the fax device working?

                   

                  Java. Write once. Debug everywhere.

                  • 6. Re: how to write a procedure for sending fax
                    ReemaPuri

                    Yes having query about same can this classes be loaded in oracle by any means?

                     

                    normal pl/sql wrapper for java query is running in oracle

                     

                    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "HelloWorldExample"

                    AS

                    public class HelloWorldExample

                    {

                    HelloWorldExample hello;

                     

                    public HelloWorldExample()

                    {

                    hello = new HelloWorldExample();

                    }

                    public static void sayHello(String forename, String surname

                      , String outString[])

                    {

                    outString[0] = "HELLO WORLD more specifically hello" + forename

                      + " " + surname;

                    }

                    public static void main(String[] args)

                    {

                    //no method

                    }

                    };

                    /

                    show errors java source "HelloWorldExample";

                    /You should see :

                     

                    AND COMPILE Compiled.
                    No Errors.

                    Step 2: Create a pl/sql call spec/wrapper

                    In
                    order to use your Java method from Apex or PL/SQL you must create a
                    pl/sql call specification wrapper round each Java method you wish to run
                    from PL/SQL. 

                     

                     

                    Again copy and past the following code into sqlplus/sqldeveloper:

                    CREATE OR REPLACE PROCEDURE HELLO_WORLD(p1_forename in VARCHAR2
                    , p2_surname in varchar2, p3_outString out varchar2)
                    AUTHID CURRENT_USER AS LANGUAGE
                    JAVA NAME  'HelloWorldExample.sayHello(java.lang.String
                    , java.lang.String , java.lang.String[])';
                    /
                    show err;
                    /

                    Step 3: Execute to test

                     

                    Executing this Hello World example is
                    as easy as declaring an anonymous block and calling the method from
                    within within. For example:

                    declare
                    p_forename varchar2(4000) := 'KRISTIAN';
                    p_surname  varchar2(4000) := 'JONES';
                    p_msg      varchar2(4000) := null;
                    begin
                    hello_world(p_forename, p_surname, p_msg);
                    dbms_output.put_line(p_msg);
                    end;

                     

                     

                    Again if completed correctly you will see :

                     

                    Anonymous block completed
                    HELLO WORLD more specifically hello KRISTIAN JONES
                    • 7. Re: how to write a procedure for sending fax
                      Billy~Verreynne

                      How does this example prove that the Fax Java class should work? All the example shows is basic Java code being able to compile and execute. As expected.

                       

                      If you want to use a Java class that is not included by default by Oracle, you need to familiarise yourself with the limitations and restrictions of the Oracle database Java VM, how to load and test new classes - and as that Java class communicates with a fax device (via RS323?), that device needs to be attached to the database server, and server o/s and device correctly configured for use.

                       

                      None of which has anything to do with the subject matter of this forum - the SQL and PL/SQL languages.