Invoking external C code from Oracle
How do I invoke external C code on another machine from Oracle?
I need certain queries in Oracle to trigger a call to C code that is running on a different machine. We need to find out which architecture is suited to this.
We plan to port this solution to other databases in the future, so it would be better if the solution was platform independent.
Thanks
What is the API to this C code?
What, exactly, would you be looking for in a platform independent way to invoke C code from a database? You can build a web service interface to the C code, which would provide a relatively database independent interface to various databases. But the Oracle code that would call the web service would be very much database specific. As would the code in any other database to call a web service. Plus if you're talking about data mining, you're probably talking about transferring a rather large volume of data from the database, which would generally make web services and the associate XML a rather inefficient data transfer mechanism.
Most databases have the ability to generate a flat file as well, but that tends to be a rather database-dependent API.
Can the C code not extract the data from the database? There are a ton of somewhat database independent APIs that would allow a client application extract data from a variety of databases.
Justin
Similar Messages
-
Error while trying to call external web service from oracle PL/SQL 10.2 g
Hi I am trying to call an external web service from oracle PL/SQL .I am getting following run time error when I try to set the opeartion style.
But as per the oracle documentation this is one of the 2 valid values.
ORA-29532: Java call terminated by uncaught Java exception: operation style: "document" not supported.Teh webservice does expect the operation style as document.
Following is the code I am executing.
FUNCTION email
return varchar2
AS
service_ SYS.utl_dbws.SERVICE;
call_ SYS.utl_dbws.CALL;
service_qname SYS.utl_dbws.QNAME;
port_qname SYS.utl_dbws.QNAME;
operation_qname SYS.utl_dbws.QNAME;
string_type_qname SYS.utl_dbws.QNAME;
retx ANYDATA;
retx_string VARCHAR2(1000);
retx_double number;
retx_len number;
params SYS.utl_dbws.ANYDATA_LIST;
l_input_params SYS.utl_dbws.anydata_list;
l_result ANYDATA;
l_namespace VARCHAR2(1000);
begin
-- open internet explorer and navigate to http://webservices.imacination.com/distance/Distance.jws?wsdl
-- search for 'targetNamespace' in the wsdl
l_namespace := 'http://service.xmlservices.global.freedomgroup.com/';
-- search for 'service name' in the wsdl
service_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanService');
-- this is just the actual wsdl url
service_ := SYS.utl_dbws.create_service(HTTPURITYPE('http://hostname/GlobalWebServices/services/ClientCoreWebService?wsdl'), service_qname);
-- search for 'portType name' in the wsdl
port_qname := SYS.utl_dbws.to_qname(l_namespace, 'ClientCoreWebServiceBeanPort');
-- search for 'operation name' in the wsdl
-- there will be a lot, we will choose 'getCity'
operation_qname := SYS.utl_dbws.to_qname(l_namespace, 'postalCodelookup');
-- bind things together
call_ := SYS.utl_dbws.create_call(service_, port_qname, operation_qname);
-- default is 'FALSE', so we make it 'TRUE'
SYS.utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
-- search for 'operation soapAction' under <wsdl:operation name="getCity">
-- it is blank, so we make it ''
SYS.utl_dbws.set_property(call_, 'SOAPACTION_URI', '');
-- search for 'encodingstyle' under <wsdl:operation name="getCity">
SYS.utl_dbws.set_property(call_, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
-- search for 'binding style'
SYS.utl_dbws.set_property(call_, 'OPERATION_STYLE', 'DOCUMENT');
-- search for 'xmlns:xs' to know the value of the first parameter
-- under <wsdl:message name="getCityResponse"> you will see the line <wsdl:part name="getCityReturn" type="xsd:string" />
-- thus the return type is 'string", removing 'xsd:'
string_type_qname := SYS.utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
-- in the line <wsdl:operation name="getCity" parameterOrder="zip">
-- the parameterOrder is 'zip', thus we put in 'zip'
-- the 'ParameterMode.IN' is used to specify that we will be passing an "In Parameter" to the web service
-- the 'ParameterMode.IN' is a constant variable in the sys.utl_dbws package
--vj this cud be either params or xml
SYS.utl_dbws.add_parameter(call_, 'param1', string_type_qname, 'ParameterMode.IN');
SYS.utl_dbws.add_parameter(call_, 'param2', string_type_qname, 'ParameterMode.IN');
SYS.utl_dbws.set_return_type(call_, string_type_qname);
-- supply the In Parameter for the web service
params(0) := ANYDATA.convertvarchar('<TFGGlobalBasicXMLDO><systemCd>GLOBAL</systemCd><username>GlobalAdmin</username><password>GlobalAdmin</password><localID>1</localID></TFGGlobalBasicXMLDO>');
params(1) := ANYDATA.convertvarchar('<TFGGlobalPostalCodeLookupIDDO><postalCode>02446</postalCode><countryCode>USA</countryCode><stateCode>MA</stateCode><cityDisplay>BROOKLINE</cityDisplay><countyDisplay>NORFOLK</countyDisplay><include_inactive_flag>True</include_inactive_flag></TFGGlobalPostalCodeLookupIDDO>');
-- invoke the web service
retx := SYS.utl_dbws.invoke(call_, params);
dbms_output.put_line(retx.gettypename);
-- access the returned value and output it to the screen
retx_string := retx.accessvarchar2;
dbms_output.put_line('done' || retx_string);
dbms_output.put_line('PL/SQL DII client return ===> ' || retx_string);
-- release the web service call
SYS.utl_dbws.release_service(service_);
return retx_string;
end email;thsi is urgent anybody ????
-
Error: ORA-03113 while executing complex java code from Oracle PL/SQL
Hi,
I am trying to execute a complex java code from Oracle PL/SQL. The classes were resolved successfully. But in the middle of execution, I am getting the following error:
ERROR:
ORA-03114: not connected to ORACLE
begin
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 13685
Session ID: 21 Serial number: 20
Is there a way to debug the Java classes loaded into oracle? Or is there any utility to find out why the connection was lost?
Regards,
SaravanaHi Saravana:
You could use simply System.out.println(..) at your Java code and see the output at the .trc files generated for your Oracle session.
Or better than this adding Java Util Logging messages at your code, to see how to use JUL API at the OJVM please see this blog post [Using JUL API inside the OJVM|http://marceloochoa.blogspot.com/2007/11/getting-logging-entering-exiting-and.html].
Best regards, Marcelo.
PD: ora-0600 generally are associated with RDBMS bugs, but these bugs can be bypassed by replacing the code which throws the exception by other with a workaround. -
How can I invoke a sql loader from oracle form?
I'm got a problem on invoking sql loader command from oracle form where the sql loader product has been installed in Window NT.
Thanks for your help!U can use HOST procedure with NO_SCREEN option.
this will go like
Host('d:\orant\bin\SQLLDR80 USERID=username/password@connect CONTROL=contril_file.CTL LOG=log_file.LOG discard=discard_file.dis bad=bad_file.bad', NO_SCREEN);
Hope this will Work
Good Luck :-)
Naren -
Invoking external javascript file from xdp source
Is it possible to invoke an external javascript file from within the xdp source? I know it is possible to embed the javascript in the form.
If this is possible, would I be correct in assuming that this is also possible from pdf source?
Basically I am looking to show / hide buttons based on the status associated with a form at a given time in the flow. My understanding of PDFs is that the source cannot be edited once it has been created? If this is the case I was hoping that there could be code embedded that would call on the external file which would return the status of the letter. Based on the response buttons / fragments etc could be shown / hidden as required.
Feedback required asap please!
Thanks in advance.You cannot call outside of the rendered form. So you have a couple of means to get information into the form. Merge dat aonto the form (in your case you can use a field as a flag and key off of that),or use Web Service call to check the status.
Hope that helps
Paul -
Issue in invoking the BPEL process from Oracle using a SOAP Request
Hi,
We are facing an issue while invoking a deployed Bpel Process from Oracle Applications 11.5.10..
Using a concurrent program( Unix / Host program ) we are passing the input variables required for the Bpel process in the ProcessRequest tags and forming this as a SOAP message payload.
Then trying to invoke the deployed bpel process using the end point location using HTTP POST..but nothing is happening..
The bpel process is not getting invoked when i look at the Console and also checked for the Manual Recovery queue..it's not stuck there as well..
Have set the Transfer Time Out to 25 minutes using UTL_HTTP.SET_TRANSFER_TIMEOUT(1500);
Could someone please help us as soon as possible with this ..as this is critical and we are stuck at the moment.
The logic is mentioned below :
UTL_HTTP.SET_TRANSFER_TIMEOUT(1500);
UTL_HTTP.SET_DETAILED_EXCP_SUPPORT(ENABLE=>TRUE);
soap_request:='<?xml version="1.0" encoding="UTF-8"?>'||
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'||
'<soap:Header/>'||
'<soap:Body xmlns:ns1="http://xmlns.oracle.com/bpelprocessname">'||
'<ns1:bpelprocessnameProcessRequest>'||
'<ns1:CSONum>'||order_number||'</ns1:CSONum>'||
'<ns1:CreationDate>'||c_chr_cso_last_run_dte||'</ns1:CreationDate>'||
'</ns1:bpelprocessnameProcessRequest>'||
'</soap:Body>'||
'</soap:Envelope>';
http_req:= utl_http.begin_request
('http://bpel_server ip:port/orabpel/domain_name/bpelprocessname/1.0' , 'POST', 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
utl_http.set_header(http_req, 'SOAPAction', 'process');
utl_http.write_text(http_req, soap_request) ;
http_resp:= utl_http.get_response(http_req) ;
utl_http.read_text(http_resp, soap_respond) ;
utl_http.end_response(http_resp) ;
dbms_output.put_line(soap_respond);
Thankscheck if your soap envelope is correct,check my below procedure which is working fine for me
procedure xxxxx_BPEL_SCHEDULER
IS
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
launch_url varchar2(240) ;
begin
soap_request:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:star="http://xmlns.oracle.com/xxxxx_BPEL_SCHEDULER">
<soapenv:Header>
<add:MessageID>?</add:MessageID>
<add:ReplyTo>
<add:Address>?</add:Address>
<!--Optional:-->
<add:ReferenceProperties>
<!--You may enter ANY elements at this point-->
</add:ReferenceProperties>
<!--Optional:-->
<add:PortType>?</add:PortType>
<!--Optional:-->
<add:ServiceName PortName="?">?</add:ServiceName>
<!--You may enter ANY elements at this point-->
</add:ReplyTo>
</soapenv:Header>
<soapenv:Body>
<star:STARS_BPEL_SCHEDULERProcessRequest>
<star:SCHEDULER_PARAM1>?</star:SCHEDULER_PARAM1>
<star:SCHEDULER_PARAM2>?</star:SCHEDULER_PARAM2>
<star:SCHEDULER_PARAM3>?</star:SCHEDULER_PARAM3>
<star:SCHEDULER_PARAM4>?</star:SCHEDULER_PARAM4>
<star:SCHEDULER_PARAM5>?</star:SCHEDULER_PARAM5>
</star:STARS_BPEL_SCHEDULERProcessRequest>
</soapenv:Body>
</soapenv:Envelope>';
http_req:= utl_http.begin_request('http://xxxxxx.com:16000/orabpel/default/xxxx_BPEL_SCHEDULER/1.0 '
,'POST',
'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
utl_http.set_header(http_req, 'Content-Length', length(soap_request)) ;
utl_http.set_header(http_req, 'SOAPAction', 'initiate');
utl_http.write_text(http_req, soap_request) ;
http_resp:= utl_http.get_response(http_req) ;
utl_http.read_text(http_resp, soap_respond) ;
utl_http.end_response(http_resp) ;
dbms_output.put_line(soap_respond);
END; -
Connecting to an external web service from Oracle BPEL
How do we connect to an external web service using its wsdl (possibly implemented in .NET) from Oracle BPEL process?
Any specific details/examples greatly appreciated.
Thanks,
JNHow do we connect to an external web service using its wsdl (possibly implemented in .NET) from Oracle BPEL process?
Any specific details/examples greatly appreciated.
Thanks,
JN -
How to call external Java code from Animate project?
I am creating a trainer using Animate that needs to interface with an aircraft model written in Java. Is there a way to call external Java functions from Animate?
Thanks!you can import external java files by yepnope
yepnope({nope:[
'your java script file address.js',
],complete: init});
function init() {
codes that work with your js file can be write in here
Zaxist -
How to invoke a Java Program from Oracle 10g?(uRGENT)
Hello.
I've a query, that i have a program, that basically retreives the records from the
oracle table and then parser this information and then insert the values in corresponding database base tables. I want that, whenever the new program is inserted, a Trigger should fire and pass the most recently entered record to the Parser Program, means
1) Firing a Trigge
2)Storing the most latest data and pass it to the Parser PROGRAM
Can someone tell me how to do this? How to invoke a Java Program from within the database? Please if anyone has examples provide me. Its very urgent and tell me what is the basic mechanism.
Thankyou.
BenWith Java Stored Procedures Java may be caleed from a database.
http://www.oracle.com/technology/tech/java/jsp/index.html -
Invoking Third Party software from Oracle applications
Hi Gurus,
We have a requirement where we would like to invoke thrid party software from APPS. For example when i click on a button in the toolbar (of Oracle Applications HRMs module) we want a document management system to open and show the documents related to the person on the screen.
Have anyone acheived anything like this? If Yes can you please share the knowledge?
Many thanksHello,
Please, ask the questions concerning Oracle Application in the E-Busines Suite forum.
Francois -
Invoking SQL Server function from Oracle
Hi all,
My question involves Oracle and SQL Server. I have a function in SQL Server that returns the count of rows in a table in SQL Server itself. I
wish to invoke this function (in SQL Server) from Oracle. I have Transparent Gateway through which I usually connect to SQL Server to get the count. Is there a way in which I can execute the function (in SQL Server) from Oracle, something like below:
select function_in_sql_server@transparent_gateway from dual;Thanks,
...I found below two links:
how to call a sql server stored procedure from oracle
http://en.allexperts.com/q/Oracle-1451/2008/6/Calling-SQL-Stored-procedure-1.htm
Regards
Girish Sharma -
Invoking EBusiness Suite APIs from Oracle Data Integrator
Hi,
I am using ODI as the data migration tool to load data from oracle legacy application to ebiz.
Is there any knowledge module available to call oracle Ebusiness APIs?
Thanks in advance.
-SantanuThanks for your response.
In eBusiness we have either open interface table & concurrent program or API. IKM which you have referred those are used for open interface and concurrent program. How to handle APIs where there is no open interface table. For example AR_RECEIPT_API_PUB.CREATE_CASH which is an API and there is no open inetrface table for this.
Cheers,
Santanu -
Error while invoking external WS call from BPEL2.0
Hi,
I have a BPEL process from where I am making external WS call.
I have the WSDL file & the Endpoint URL for the external WS.
So,I have follow the below steps at BPEL editor.
1. Synchronous BPEL process[it includes 'receiveInput' & 'replyOutput'].
2. Added a "Partnet Link"[Created using external WSDL & Endpoint URL] at the Right hand side of BPEL Editor
3.Added "Invoke" node between 'receiveInput' & 'replyOutput' and then pointed to the newly created "PartnerLink"
While rebuilding the .jpr file I am getting the below error.
**C:\JDeveloper\mywork\CustomerDetails\CustomerDetails.bpel**
**Error(75): Element 'scope' not expected.**
Can Any one help me to resolve the issue ??
Note: I have been using JDev 11.1.1.6 and have gone through the below URL for similar kinda sample.
http://docs.oracle.com/cd/E23943_01/dev.1111/e10224/bp_sync.htm#CIHIEIHD
Cheers,
DebaHi Deba,
Just so I get my facts straight, when you look at the BPEL source code, what do you see? You should be seeing, first, a sequence, then, the receive activity, and then your invoke activity and finally reply. Isn't it?
As far as the error message suggests, looks like you have placed a "scope" - structured activity, at a place it does not belong.
HTH
Cheers
Swagat -
Calling java code from oracle apps form
I've created my own java .class file and am attempting to call it from an oracle applications form. I am getting a runtime error while running the form, but I don't know what the error is because nothing is being reported to me.
I've created the .java file in JDeveloper, compiled it into a .class file, deployed it to a .jar file, and placed it on the application server in a directory that the CLASSPATH can see it. I've added it to the archive parameter of the appsweb.cfg file and see that the .jar file is being downloaded when the JInitiator of Oracle Apps is started.
I have also imported the .class file into the form via the Program -> Import Java Classes which resulted in PL/SQL package stubs created to call the .class methods.
When I run the form, the java code is activated on a triggering event, PRE-INSERT. There is no java bean item in a block or on a canvas anywhere. I dont' think I need there to be since I am simply using the java code to perform actions during PRE-INSERT, not to display anything on the canvas.
I have placed debug messages throughout my code and see that the error is occuring in the PL/SQL packaged stub at the line "JNI.GET_CLASS()" where the parameter to that call is the name of my class. I know it's erroring there because I am handling the "java_error" exception. I am displaying "ora_java.last_error" in the exception handling, but it is null.
I am at a loss as to determine why I am having problems and how to display an error. Any suggestions? I'm happy to outline my steps and problem in more detail if I have missed something obvious.
We are using Forms 6.0.8.21.3 with Oracle Apps 11.5.7.
Shane.Shane,
Don't loose the heart. You have come too close to end.
The scenario you have mentioned is very unique and something which will fit more in the forms forum. So I think that was a sincere answer to help you and not a "pass the buck" card type game :)
You are lucky that you got Tapash interested into this issue, otherwise you see there is no OAF component involved out here.
I have an article promised to some of the guys but will follow this issue.
--Shiv -
Generation of custom code from oracle DB.
Hi All,
I am new to oracle BIP which is used to pull reports.I got a requirement to pull the data through BIP using java custom code.I got the API doc for BIP and statrd developing some sample code.My input to the code will be in XML which has one unique attribute and based on the attribute i will run a query to connect to the database and pull some attributes related to the unique attribute input.The output will also be in an XML.When i go through the doc i came to know that "DocumentProcessor" (not sure) is the calss which can be able to pull it data from database.I am using oracle 9i DB.If anyone has any such requirements can you please share the piece of code which helps me to understand and procced further.Here is the piece of code that is written.
DocumentProcessor docProcessor = null;
try
docProcessor = new DocumentProcessor(xmlFilePath, temporaryDirectory);
Vector outputList = docProcessor.process();
catch(IOException ioe)
// If this exception is thrown, the temporaryDirectory information is incorrect.
ioe.printStackTrace();
catch(Exception exc)
//If this exception is thrown, process() failed
exc.printStackTrace();
Can yoou please guide me what to do further or the above code is correct.
Thanks in advance.Hello Narinder,
Thanx for your advice.
As far as I understand, JAX-RPC is a specification which different vendors could implement in different ways. So WebServices generated from wscompile of Vendor A doesn't need to run in a WebServiceEngine from Vendor B.
I have downloaded the Java WebService DeveloperPack, but only Tomcat and the SUN ApplicationServers are supported. In our project, we are now focusing on the technology the SAP NetWeaverDeveloperStudio provides.
Thanx again and have a nice weekend
Mo
Maybe you are looking for
-
Creating credit memo request - V1 498 / missing order quantity
Hi Experts, could any of You pls help me with a credit memo creation issue? I credit memo needed to be created based on invoice, so configuration and copy control is done as usual, but I have a failure during CR order creation referring to an invoic
-
Hello I'm new to CF and need some help with a form. I have three radio buttons and one is <cfinput type="radio" name="rsvp" value="Yes, my spouse/partner will also attend"> (Other two are just Yes and No values with same name="rsvp") and if you selec
-
Windows 8.1 and stretched display on dv7-3165dx
iyogi just installed win 8.1 on my wife's HP dv7-3165dx. We took care of everything else that happened including totally lost office 2013 including outlook and e mails and numerous other losses and in thje end are left with a horizontally stretched d
-
I have read reports Lyon won't support Quicken. I use Quicken all the time. what finance software is taking it's place/recommended and will data transfer be seamless and easy?
-
Hi everybody, I have Imac 5 processor and I guess installed Lion I am having difficulty with Wifi connection. Sometimes after shut down number of times still does not access wifi or if it does I can see wifi bar on iMac but can't open any webpage. Pl