Hi All.
Can anybody point me out on working example of calling web service (e.g. CXF based) from Oracle 10g stored procedure.
Hi All.
Can anybody point me out on working example of calling web service (e.g. CXF based) from Oracle 10g stored procedure.
You can do this by using the utl_http package in plsql.
I don't have a self made example ready, but would recommend you have a look at the oracle documentation for utl_http.
A quick google search for "oracle plsql web service utl_http", also showed some examples on the top results, for instance this one: rapid plsql web service client development using soapui and utl_http.
As long as the database server has network access to the webservice server you can use it.
It's possible, but almost certainly a bad idea.
Stored procedures shouldn't be calling web services. You ought to have a service layer that calls out to other services and the persistence tier. I'd recommend that you have that service implementation call that web service and pass what's needed to the stored procedure for persistence. Don't put that call into the stored proc.
One issue you may run into: if the service requires SSL, then you'll need to have a certificate available to the database. That generally means having the Advanced Security option and using Oracle Wallet. For http communications, though, utl_http (and its simpler form, utl_dbws -- database web services -- work pretty well. Marco Gralike's blog has a good HOW TO on consuming web services in PL/SQL.