Exposing/Publishing PL/SQL Stored Procs as Web Services
Has anyone come up with a way to publish PL/SQL stored procedures as web services? Our team already has sufficient knowledge in deploying EJBs and exposing them as services but we're curious to see if we can create services without building and deploying an EJB as the provider mechanism.
Any ideas/guidance are appreciated!
In JDeveloper 10 you can do it. check that article
But in 11g version they hide that option :(
[some info|http://forums.oracle.com/forums/thread.jspa?messageID=3237164�]
Edited by: August_ on Apr 19, 2009 11:52 PM
Similar Messages
-
Publish PL/SQL package as a web service without using Oracle AS?
Hello, my question is:
Can I publish a PL/SQL package as a web service in Oracle10g directly from the
database and/or the oracle http server, without needing Oracle Application
Server?
Thank you in advance.Hi,
there is a tutorial:
http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
"Developing a Web Service from a PL/SQL Package"
I think you need Oracle AS, because you need an instance which "talks" http.... -
URGENT!! Generating XML in a PL/SQL stored proc
Hi,
I need to generate XML from a PL/SQL stored proc.
I need to do it in Oracle 7.3.4 as well as 8.1.6 databases.
I need to have my own defined tags in the xml.
Say I have the table Person like
Person (
id number,
fname varchar2(40),
lname varchar2(40)
I need a stored proc will will select * from Person and output the data in XML form as
<Person Names>
<Employee>
<First Name personid="<<value from id field>>">
<<value from fname field>>
</First Name>
<Last Name>
<< value from lname field>>
</Last Name>
</Employee>
</Person Names>
I want to minimise hard coding also.
how can I do this ? any pointers ?
Thanks in advance, Hari
nullHi,
We are not having a Web Agent here. So i am unable to use PLSXML utility.
I installed XSU and is now able to create the XML, but with the table attribute names as the tags. So
1. Is there a way I can transform this XML to another XML with custom tags ( using an XSL ) in a PL/SQL procedure ?
2. Is there a way I can install and use PLSXML without the web agent ?
Thanks, Hari -
Can we call a Java Stored Proc from a PL/SQL stored Proc?
Hello!
Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
Thank you!For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
CREATE OR REPLACE PACKAGE MyPackage AS
TYPE Ref_Cursor_t IS REF CURSOR;
FUNCTION get_good_ids RETURN VARCHAR2 ;
FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
END MyPackage;
CREATE OR REPLACE PACKAGE BODY MyPackage AS
FUNCTION get_good_ids RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'MyServer.getGoodIds() return java.lang.String';
FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
IS table_cursor Ref_Cursor_t;
good_ids VARCHAR2(100);
BEGIN
good_ids := get_good_ids();
OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' | | good_ids | | ')';
RETURN table_cursor;
END;
END MyPackage;
public class MyServer{
public static String getGoodIds() throws SQLException {
return "1, 3, 6 ";
null -
BPEL process to Insert XML into DB using pl/sql stored proc
Hi,
We have created a BPEL process in which we are taking input request and store it into Oracle Database using PL/SQL proc.
We have been unsuccessful in doing so because the data stored in table has root element missing.
Has any body done this (insert xml into DB using pl/sql stored proc) successfully ?
We can so this successfully if we do not use stored procedure and store data directly in table.
RegardsI have done this, stored it as a CLOB.
Also I received the payload as an opaque schema, so I had to convert the message from binary into string.
This way the root element doesn't get removed.
cheers
James -
Item Type Based on PL/SQL stored proc causing errors
I am getting the following error when I add this item type based on a pl/sql stored proc that generates html based on the stored proc... the stored proc returns find but the other porlets get Error Message in there headers and in the porlet content I get:
Error: The listener returned the following Message: 503 Service Unavailable....
I also get the same error if I click on a link that is generated from my stored proc for the entire page I get the error:
Error: The listener returned the following Message: 503 Service Unavailable
and get nothing else returned...Greetings
I suggest you take a look at the following page and have a look on how to create portlets. Since the PL/SQL PDK allows you to create your own portlets inside the Oracle Database there should be no problem for creating the content inside a portlet the way you want it.
http://www.oracle.com/technology/products/ias/portal/pdk.html
Best regards
Johan -
Arrays to pl/sql stored proc.
How can I send a java array
to a pl/sql stored proc.
I've understood that I have to something like this
ArrayDescriptor desc = ArrayDescriptor.createDescriptor(<sql_type_name>, conn);
ARRAY newArray = new ARRAY(desc, conn, java_array);
But what do I use as sql_type_name ?
/guha
nullI trust you have tried using java.sql.array datatype. This is the SQL3 datatype supported by the 8.1.6 drivers.
You would find detailed pointers at http://technet.oracle.com/tech/java/jroadmap/jdbc/listing.htm
Narayan.
null -
Save prompted sql stored proc parm values in rpt file from designer
How can I save the last prompted sql stored proc parameter values from within the CR designer. In other words I want to hard code some of the parameter values (the rest are passed) so that CR does not prompt at run time. I am running CR Developer XI R2 SP1 from within VS.Net 2005 (Winforms)
Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Cf caching ms sql stored procs,
I'm having trouble with Cf caching ms sql stored procs,
eg in this one:
<cfstoredproc procedure="getUser" datasource="#datasource#" returncode="true">
<cfprocparam type="in" cfsqltype="CF_SQL_VARCHAR" value="#results.SAMAccountName[1]#">
<cfprocresult name="sp">
</cfstoredproc>
I get the same 4 columns returned no matter what the actual sp is in the server.
any ideas?Sorry, I'm not suggesting any corelation between a <cfquery> with a SELECT * in it and suggesting your proc had SELECT * in it. Just perhaps that whatever mechanism in CF or the JDBC drivers that caches the expected columns from a SELECT * query might also cache them from a PROC call. There's a loose parallel in that neither actually specify the expected column names, that's all I meant.
Can you do me a favour? Can you do something like <cfquery datasource="yourDsn">THIS AIN'T VALID SQL</cfquery> and then re-run your proc. Does that sort it out? I seem to recall - and now I feel like I'm wasting your time a bit, because I'm really unsure of this - that if one caused an error over the JDBC connection, it cleared itself out and subsequent queries worked fine. It might work the same for procs. I'm not suggesting this as a solution: just more info gathering. This is presupposing it is kinda related to the SELECT * issue.
I'll try to do some experimentation when I get home tonight, but I've got some docs to write and stuff so not sure whether I'll get to it.
Adam -
Exposing an RFC enabled function as a Web Service in Minisap
Hi all,
i'm trying to expose an RFC enabled function as a Web Service in my Minisap installation. Everything works fine, until i actually want to finish the Web Service wizard. It always quotes that the object can only be deployed in an sap paket. If i try to put it in the $TMP paket, by marking it as a local object, i always get the message that test objects can not be deployed in external pakets.
Any idea?
Furthermore the virtual interface with the name i selected in the Web Service wizard seems to exist, at least i can not try to deploy the Web Service again with the same name. Actually, i also can't find a place where i can delete the virtual interface. Any hint on that issue is also appreciated.
Thanks in advance!
/MarcI wanted to write a web service adapter:
@WebService
public class MyWebService implements StreamSender {
private StreamSender eventSender;
@WebMethod
public void echo(String msg) {
eventSender.sendInsertEvent(new MyEvent(msg));
After deploying I've got NullPointerException, eventSender is null. This is because MyWebService instance is NOT on the spring context, since it was created by jetty via reflection.
So now I'm trying another approach. I want to inject an adapter from the spring context into the web service:
I wanted to write a web service adapter:
@WebService
public class MyWebService {
private MyWSAdapter myAdapter;
@Resource
private WebServiceContext context;
@WebMethod
public void echo(String msg) {
myAdapter = getMyAdapterFromSpringContext();
myAdapter.sendInsertEvent(new MyEvent(msg));
public MyWSAdapter getMyAdapterFromSpringContext() {
ServletContext sc = (ServletContext) context.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
ApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(sc);
return (MyWSAdapter) springContext.getBean("myWSAdapter");
So far i'm getting java.lang.NoClassDefFoundError for org.springframework.web.context.support.WebApplicationContextUtils (org.springframework.spring-web_2.5.6.jar), and trying to figure out where is the jetty classpath. -
Publish no static html page with Web services
Hello All,
I would like to publish no static html page using Web services. I can't attach this html page as static because I need to change it dynamically from another vi. So, client can read this page by browser with refresh 2 sec.
Thanks,
YustasHi,
I think It is not possible to create a dynamic HTML page, at the most you could edit your page HTML and publish it again with the same URL
I hope to be helpful.
Sabrina -
How to publish a Java Stored proc....
Hi,
I wrote the following Java code and loaded it into Oracle 8i, as Java stored procs.
public class EmployeeStruct
public int EmployeeNum;
public String EmployeeName;
public String Designation;
and
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
public class InsertData
public static InsertEmployee(EmployeeStruct eps) throws SQLException
Connection conn =
DriverManager.getConnection("jdbc:default:connection:");
String sql = "INSERT INTO EMPLOYEE_TABLE VALUES (?, ?, ?)";
try
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, eps.EmployeeNum);
pstmt.setString(2, eps.EmployeeName);
pstmt.setString(3, eps.Designation);
pstmt.executeUpdate();
pstmt.close();
catch (SQLException e)
System.out.println(e.getMessage());
My question is how do I publish the InsertData proc. I tried :
CREATE OR REPLACE PROCEDURE insert_data (e EMPLOYEESTRUCT) AS LANGUAGE JAVA
NAME 'INSERTDATA(EmployeeStruct)';
but this gives me PLS-00201, identifier EmployeeStruct must be declared.
COULD SOMEONE HELP ME/ SHOW ME HOW ?
I wish to call the java stored proc from an external java program.
rgds
Jeevan S
nullYou can't pass Java classes to Java Stored Procedures via the PL/SQL wrapper. You'll have to write your wrapper to take the int as a NUMBER and the two Strings separately as VARCHAR2s, e.g.:
CREATE OR REPLACE PROCEDURE insert_data
EmployeeNum IN NUMBER,
EmployeeName IN VARCHAR2,
Designation IN VARCHAR2
AS LANGUAGE JAVA
NAME 'InsertData.InsertEmployee(int, java.lang.String, java.lang.String)';
John H.
null -
Parsing Column Value. SQL / Stored Proc/ Function ?
Hi,
I just started writing SQL. Need your valuable input for the following query,
Need to query a table and parse a column to produce a desired output.
like suppose my column value is
#ADFA
/SDFGAS
{ABC}: 123
{BCA}: 456
{DEF}: 789
and i need to get an out put as follows
{ABC} {BCA} {DEF}
123 456 789
so the patterns are defined.
I some how tried and reached through SQL, but there should be better way than this. So posted this question.
I tried using SQL itself (using substr, instr & decode functions in the select statement)... with out using stored proc/ function as i have not created one earlier.. I am just learning the syntax and trying it.
The psuedo code i have planned is
function substring(column_value, search_string)
var start_index NUMBER;
var end_index NUMBER;
var result VARCHAR2;
result = 'N/A';
start_index = instr(column_value, search_string) + 4
if start_index >= 4
end_index = instr(substr(column_value, 0, start_index), CHR(13)-1)
if start_index >= 4 && end_index >=0
result = substr(column_value, start_index, end_index);
return result;
I just wrote it like writing in a programming language. Need to implement this through Stored Proc/ Function. Please let me know your comment on thisOops, I think regular expressions are not available in my current oracle version :-(
I am having Oracle 9i.
Got it.. Yes it is available from 10G onwards.. :-(
Message was edited by:
Thiru.Thiru -
Publish PLSQL stored procedure as web services
Is it true that PLSQL stored procedure can only be published as web services using JAVA?
I came across article that mention how to call other web services from within plsql, but not sure the vice versa.
So, please advise.
Thank you.True..I've done it once using J-Developer.
http://www.oracle.com/technology/obe/obe1013jdev/ws/wsandascontrol.htm#o
Good luck!!
Bhagat -
Passing parameters from Excel to SQL stored proc. to analyse resultset in PowerPivot
Hi,
Not sure if I posted this question at the right forum ...
I would like to implement the following scenario:
- Enter parameters @startdate and @enddate in cells in an Excel worksheet (i.e. cell A2 has the value for the startdate parameter; cell B2 has the value for the endate parameter).
- Pass these parameters to a SQL stored procedure (using MSQuery?). See below.
- Calling stored procedure in PowerPivot to get the resultset in PowerPivot.
The SP calls some functions in SQL Server. See below.
I have read several posts on several forums but I can't get the parameters from Excel (MSQuery?) to the SP.
What's the best way to have PowerPivot picking up the resultset from the SP?
How do I get the Excel cells A2 and B2 to the SP below?
SP:
USE [Test]
GO
/****** Object: StoredProcedure [dbo].[_Pink_SP_CapaciteitTest] Script Date: 29-7-2014 15:41:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_Pink_SP_CapaciteitTest]
@startdate DATETIME,
@enddate DATETIME
AS
BEGIN
SET NOCOUNT ON
SET DATEFIRST 1
DECLARE @TempCapacity TABLE
ResourceNo INT,
ResourceName NVARCHAR(60),
JobCode NVARCHAR(12),
JobDescription NVARCHAR(50),
CostcenterCode NCHAR(8),
CostcenterDescription NVARCHAR(50),
CostcenterClass NVARCHAR(30),
CostcenterClassDescription NVARCHAR(60),
Date DATETIME,
Weekday INT,
WeekNo INT,
Month INT,
Year INT,
Capacity FLOAT,
ConsultancyTot FLOAT,
ConsultancyTotReserved FLOAT,
Sick FLOAT,
Doctor FLOAT,
Pregnant FLOAT,
Vacation FLOAT,
VacationCancellation FLOAT,
SpecialLeave FLOAT,
CompHours FLOAT,
Support FLOAT
INSERT INTO @TempCapacity
SELECT h.res_id AS ResourceNo,
h.fullname AS ResourceName,
h.job_title AS JobCode,
j.descr50 AS JobDescription,
h.costcenter AS CostcenterCode,
cc.oms25_0 AS CostcenterDescription,
ccc.CostcenterClassCode AS CostcenterClass,
ccc.Description AS CostcenterClassDescription,
CONVERT(VARCHAR(10), t.datum, 105) AS [Date],
DATEPART(DW, t.datum) AS [Weekday],
(SELECT [dbo].[ISOWeekNumber] (t.datum)) AS WeekNo,
MONTH(t.datum) AS [Month],
YEAR(t.datum) AS [Year],
(SELECT ROUND([dbo].[HRCapacityHours] (h.res_id, t.datum, t.datum), 2)) AS Capacity,
(SELECT ISNULL([dbo].[HRAbsenceHours] (50, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTot,
(SELECT ISNULL([dbo].[HRAbsenceHours] (51, h.res_id, t.datum, t.datum + 1), 0)) AS ConsultancyTotReserved,
(SELECT ISNULL([dbo].[HRAbsenceHours] (9538, h.res_id, t.datum, t.datum + 1), 0)) AS Sick,
(SELECT ISNULL([dbo].[HRAbsenceHours] (8531, h.res_id, t.datum, t.datum + 1), 0)) AS Doctor,
(SELECT ISNULL([dbo].[HRAbsenceHours] (9924, h.res_id, t.datum, t.datum + 1), 0)) AS Pregnant,
(SELECT ISNULL([dbo].[HRAbsenceHours] (8501, h.res_id, t.datum, t.datum + 1), 0)) AS Vacation,
(SELECT ISNULL([dbo].[HRAbsenceHours] (8551, h.res_id, t.datum, t.datum + 1), 0)) AS VacationCancellation,
(SELECT ISNULL([dbo].[HRAbsenceHours] (8511, h.res_id, t.datum, t.datum + 1), 0)) AS SpecialLeave,
(SELECT ISNULL([dbo].[HRAbsenceHours] (9518, h.res_id, t.datum, t.datum + 1), 0)) AS CompHours,
(SELECT ISNULL([dbo].[HRAbsenceHours] (3200, h.res_id, t.datum, t.datum + 1), 0)) AS Support
FROM humres h (NOLOCK)
LEFT OUTER JOIN hrjbtl j (NOLOCK) ON h.job_title = j.job_title
LEFT OUTER JOIN kstpl cc (NOLOCK) ON h.costcenter = cc.kstplcode
LEFT OUTER JOIN CostcenterClasses ccc (NOLOCK) ON cc.Class_01 = ccc.CostcenterClassCode AND ccc.ClassID = 1
CROSS APPLY (SELECT * FROM [dbo].[AllDays] (@startdate, @enddate)) t
WHERE h.ldatindienst <= t.datum
AND ISNULL(h.ldatuitdienst, t.datum) >= t.datum
AND h.fullname NOT LIKE '%inhuur%'
AND h.emp_type IN ('E', 'C')
AND h.job_title IN ('F09CONS', 'F09PRIN')
ORDER BY h.fullname,
t.datum
SELECT * FROM TempCapacity
END
Thanks!Hi,
According to your description, I think you want to call a store procedure in PowerPivot with the parameters which are stored in the cells of an Excel workbook.
Are you using the PowerPivot add-in in Excel or PowerPivot in SQL Server?
This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. If you are using Excel PowerPivot, since it is an add-in for Excel and it doesn't publish API for us, we cannot automatically call a stored procedure in Excel.
We can get the data from Cells A2 and B2 with code, but it's hard to set it as the parameters of a SP when calling it from PowerPivot. About calling a SP from Excel manually, you could post in
Excel IT pro forum for more effective responses.
If you are using PowerPivot in SQL Server, I'm afraid your issue is more related to the feature of PowerPivot. We can get data from SQL Server database into Excel workbook, but I'm not sure whether we can get data from Excel cells in SQL Server. So I suggest
you posting in
SQL Server PowerPivot forum for more effective responses.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
MacBook Pro closest to the screen USB port doesn't work
Hey there! I have a mid-2010 MacBook Pro 6,2 (15" 2,66 GHz i7 4GB RAM) which is in perfect conditions. I use it everyday to study and play the X-Plane simulator, basically, so it has never fallen nor taken any damage. Last week, all of the sudden, th
-
Can't Install Windows 7 32-bit Drivers
So I recently had have a hard drive replaced in a Macbook since the original failed and had to re-install Windows 7 again. After intalling Windows 7, I inserted my Snow Leapord DVD (10.6.0) and let it run the set up but it didn't install very many dr
-
Edit single item in Recurrence event through CSOM/javascript + SPService Library
Hi, I've a requirement that I've custom action ribbon button. In a calendar list, there is a Person/Group field named "Attendees". I want to add current user to this field when the user click the ribbon button. I've implemented but the problem is I
-
when i connect to wcf service , i am getting the client authentication error. It happens only when i connect to wcf service from a client machine (virtual machine) that is logged in with local user account. Wcf service is hosted as windows service in
-
Entry in /etc/hosts.allow for insecure VNC?
I read the ssh wiki article which teaches to add an entry to /etc/hosts.allow for sshd. I am know that tunneling vnc through sshd is the way to go security wise, however, there are cases where I need to switch on un-encrypted vnc for the purposes of