POSTing XML from Oracle to WebAPI's - oracle

Our company is in the process of creating an ASP.NET service to accept XML data sent from ERP systems such as Oracle. We have no experience (at all) with Oracle, so please excuse the simplicity of this question.
I see online that Oracle has a tool called JDeveloper that can hook up to WCF Services that use a DataContract/WSDL to send/receive data with relative ease.
Can anyone advise about the situation regarding WebAPI's, where no WSDL or DataContracts exist? Is it simple to craft a POST in Oracle to send to a WebAPI, or is the former option better/easier to work with?
Thanks in advance.

It's simple enough to call web service directly from Oracle:
There are a good support of XML/XSLT/XQuery to construct requests and parse responses (XML DB)
Oracle have an API to work with HTTP/HTTPS requests (UTL_HTTP package).
So if you decide to call web service from Oracle - it's possible and relatively simple for SOAP and REST web-services.
You can find example code in this answer on StackOverflow.
Update - answer on a comment
To make it clear, example above isn't work at a "database query level" because it's implemented on PL/SQL. Oracle Database engine natively incorporates support for two different languages:
traditional SQL, which is ANSI SQL standards implementation (traditionally with some incompatibilities and extensions);
PL/SQL, which is procedural programming language tightly integrated with a traditional SQL.
This two things are really different. Even there are a common questions about performance affected by switching context between SQL and PL/SQL engines and mostly caused by improper procedures design.
PL/SQL as a procedural language can access a rich set of APIs, provided by Oracle as a set of built-in packages. Among others there are a number of packages directly related to network communication protocols and standards: UTL_TCP, UTL_URL, UTL_SMTP, UTL_MAIL, UTL_INADDR, UTL_HTTP, HTP, HTF, DBMS_LDAP.
Needs to be said, that there are a set of APIs, provided to support publishing of PL/SQL code on the web. Set of OWA_xxxx packages supports access through mod_plsql. Another thing is a support for publishing SOAP web services in Oracle XML DB.
If you need to unload data from Oracle to web service on a schedule then look at DBMS_SCHEDULE and DBMS_JOB packages to start unload procedures periodically.
Most of this system packages implemented on Java and it's possible to write your own Java extensions callable from PL/SQL.
P.S. There are a UTL_DBWS package dedicated for implementation of calls to SOAP services from Oracle Database, but seems that it produces more problems than solves and I can't find reference to it in 11g documentation (10g only).
P.P.S. Some statements may be slightly inaccurate or contain exaggerations, but that should be enough to understand the overall picture.

Related

Oracle database driver benchmark

I'm actually working in a situation where a .NET stack is managing an Oracle Database. Now, because the legacy code is consistently based on PL SQL stored procedures that deal with the majority of the work, the correct choice of driver to connect to the database is of primary importance.
For this reason, knowing that Oracle provides a large number of driver for the most known programming languages, I was trying to find a documented benchmark (even with all the problem and the influence of the context in which the tests are made) that could compare the different Oracle drivers for the different programming languages, just to support the hypothesis that the best choice in terms of performance for an isolated test microservice would be to use the Java driver in combination with Scala (Java is now property of Oracle now, after all).
Are there any on the internet that could support (or not) this hypothesis?
EDIT
I didn’t provide all the information. What I’m trying to achieve is develop a series of microservices focused on fetching data from the database and convert them into json to be consumed by the front end. .NET driver behaves seamlessly until the numbers become really overwhelming (> 1000 rows).
That’s why I was wondering if it could make any sense using JDBC to increase performance, having heard that, for instance, .NET driver for SQL server, both made by the same Company, performs 5 times better than the oracle one when it comes to gathering data from a cursor.
Your choice of drives may not give you the milage if most of the work is in PL/SQL or stored procedures. Having said that, jdbc is a good choice. However do not fight if developers are more familiar with other drivers like Oracle ODBC, oracle provider for .NET, ADO,etc.. all protocols have a Oracle drive to access Oracle DB.
You don’t have to convert to json. Oracle DB can convert it. Your network latency is more impacted by how big the pipe is ,array size,and packet size than protocols.

oracle CRUD frontend

We have an existing system using Oracle DB and several applications working on/off it using JDBC/ODBC etc. For an additional interface for CRUD operations I am looking at a web based front-end. I dont see a whole of ideas in this areas, maybe because the ORacle DB is mostly enterprise and probably means the enterprises building their own custom apps?
Using the Oracle REST API services, build a front end using Angular/JS. This eliminates any need for oracle specific server side logic and almost ORacle independent. Are there any frameworks / opensource tools that fall in this area?
Please let me know any comments / feedback on this approach.
As far as I know there aren't really any options like this specifically for Oracle databases. You might be better off going with a desktop solution, of which there are many.
There is a web UI called "H2 Console" which claims to work with any JDBC connection. I have used this with MySql before with great success but have not tried it with Oracle.
The H2 Console application lets you access a database using a browser. This can be a H2 database, or another database that supports the JDBC API.
If you want something more 'user friendly' then as far as I know there are no existing solutions for this. You will probably have to build your own or educate your users on SQL.

Hibernate SAP integration

Can we integrate Hibernate and SAP? I do have integrated a few databases with Hibernate. Since am not aware of SAP, I want to know if there is any support provided by Hibernate to integrate it with the SAP.
As far as I know I don't think that exists. SAP has its own data mapping strategy known as Open SQL and also provides special functions to insert, update and delete data that also ensure data consistency, those functions are called BAPI and unless you have an SAP connector to call these BAPIs then there's not much you can do. For more reference check this .Net connector example.
Sure you can make a connection directly (if the system administrator and/or DBA let you) to the database however is not advisable and is very dangerous because you could create inconsistencies in the system. Please do not try this approach.
However you can make use of software like the connectors I mentioned before or you could use the SAP interface system. You can find more information on this issue checking out the terms ALE and IDocs.
Another strategy is using an intermediate table on a database where you and SAP take and write data and with some controls communicate each other but on this issue you would use a BAPI in case of using a standard table or making a custom table (Z table) where you have more freedom to make your own changes.
Hope it helps
No, because SAP is not a database.
SAP is a software which is backed by a database. It does support several different RDBMS systems. Theoretically you could use Hibernate to access the database which backs your SAP system, but this is likely not a very good idea. Both hibernate and SAP are built on the assumption that they have exclusive access to the database. Having another application make changes to the DB without them knowing can lead to all kinds of obscure problems.
There are, however, several other methods to integrate SAP into your business processes, like calling BAPI function models using SAPs proprietary RFC protocol, communicating via IDocs, Batch-Input, SOAP webservices and many more.
If you think of the SAP system as a database as in RDBMS: No, you can't, because it isn't - as others have pointed out.
If you want to use something Hibernate-like stuff to access a backend system, you might want to take a look at Hibersap.
You can say SAP has built its own "Hibernate framework" in the Application Layer called OpenSQL( I guess this was built ages before Hibernate ). So SAP applications(ERP/CRM/SRM etc.) can communicate with any database type. So think of it like, SAP has a dialect for different databases.
But when you configure SAP application to use a Database, that database is locked down by SAP and you should not even try to hack it to directly update the database using direct SQL or any other framework like Hibernate. SAP does 100s of validations and checks before it saves the data into the database, you would be bypassing these checks if you are updating the database directly.
I think no organisation would allow you to do it in a production environment and if they allow you to, they don't need SAP.
SAP owns some database products like maxDB, sybase, HANA etc..Hibernate has the dialects for these products. Hibernate with HANA could be interesting.

Functions used to connect Oracle DB

We are trying to connect oracle db from loadrunner. Could you please help us in providing these details. we wanted the script to get the data from oracle DB before starting the execution. In our testing we are used different application and protocols used Web http/html, Tuxedo and CRM aplls.
You are headed down a path which will cause you harm. Build your data files ahead of time and include them with the scripts. I could tell you how to solve your problem technically, but doing so would the the technical equivalent of instructing you how to use a gun to rob a bank, ultimately a bad set of advice. Your question also exposes a lack of critical skills in client side architecture and communications. This gap will not serve you well as a performance tester.

Is it possible to Consumes Sharepoint Webservices(SOAP-based) into ORACLE DB using PL/SQL

We have a requirement to store Sharepoint List Data into Oracle.
Is it possible to Consumes Sharepoint Webservices(SOAP-based) into ORACLE DB using PL/SQL, like to access _vti_bin/lists.asmx?op=GetList and parse the list data and store in the DB.
Has anybody tried this ??? Are there any things (Security, environment) things to consider before diggin into this route??
I think PL/SQL has the support to call Web services and parse the XML to store in the DB.
Help is appreciated !!!
It should be possible (not sure if any of the Sharepoint Webservices are non-standard). Depending on your database version here are 2 articles that show how to call a SOAP webservice via PLSQL:
Oracle 9i and higher:
http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.php
Oracle 10g and up:
http://www.oracle-base.com/articles/10g/utl_dbws10g.php
Since the standard Sharepoint web services can be a pain to work with (raw CAML is pretty evil...), and you may have security/authorization issues, may I suggest the following:
Create your own .NET webservice in C# as a wrapper to the standard Sharepoint services. Create a clean interface with the parameters and return values that you need, and handle any security issues in .NET code.
If appropriate, put some kind of security on top of your web service (password as parameter to service, Basic Authentication, etc.) and perhaps deploy it using HTTPS.
Have your PL/SQL code call the new web service using UTL_HTTP (or better yet, use one of the many wrapper packages that exist, see http://ora-00001.blogspot.com/2009/07/calling-soap-web-service-from-plsql-by.html for an example).
In short, use Microsoft tools & technologies to create your own, simplified service, and then use PL/SQL to talk with that.
There is an implementation of NTLM for PL/SQL here, which (in combination with UTL_HTTP) will allow you to call Sharepoint Web Services directly from PL/SQL:
http://ora-00001.blogspot.com/2011/08/ntlm-for-plsql.html
Note that if your site uses HTTPS, you need to set up an Oracle Wallet, too, and use that in your HTTP calls.
According to the Oracle documentation on UTL_HTTP, the set authentication only supports BASIC HTTP and Amazon S3 types, so NTLM is out of the question.
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/u_http.htm#sthref16700
It seems to me that the "best" approach is to create another web service that acts a wrapper and allows for either basic or anonymous access.

Resources