Oracle 10gR2 WebService Call-In & Call-Out via PL/SQL (Step-by-Step Guide)

Hi Everyone,
This guide is for those of you who tried to Call-In and Call-Out WebService via Oracle 10gR2 using PL/SQL but failed a couple of times, re-installed a couple of times and retry, got it to work but don't know what made it work scenarios.
Hope this helps ;-)
Thanks,
Henry Wu
Instructions on how to use Oracle10gR2 Webservice Call-Out feature (Oracle JAX-RPC DII - Dynamic Invocation (DII) APIs)
PREREQUISITE
=================================================================
1. Download Oracle Database 10g Release 2 (10.2.0.1.0) (ZIP, ~655MB)
http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201winsoft.html
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
1.1 Choose Enterprise Edition
2. Download 10.1.3.1 Callout Utility for 10g (R1 +R2) RDBMS (ZIP, ~13MB)
http://download.oracle.com/technology/sample_code/tech/java/jsp/dbws-callout-utility-10131.zip
2.1 Extract to C:\oracle\product\10.2.0\db_1\dbws_callout_utility_10131
3. Download OC4J Standalone - Oracle Containers for J2EE (OC4J) 10g Release 3 (10.1.3.3) (ZIP, ~93MB; Pure Java—runs on all certified platforms)
http://www.oracle.com/technology/software/products/ias/index.html (Download Site)
http://download.oracle.com/otn/java/oc4j/101330/oc4j_extended_101330.zip
3.1 Extract to C:\oracle\product\10.2.0\db_1\oc4j_extended_101330
STEP-BY-STEP PROCEDURES
=================================================================
1. Prepare the database
1.1 Connect to SYS account (or any account that can connect as SYSDBA)
1.2 alter system set shared_pool_size=96M scope=both
1.3 alter system set java_pool_size=80M scope=both
1.4 ALTER USER SCOTT ACCOUNT UNLOCK;
1.5 ALTER USER SCOTT IDENTIFIED BY "tiger";
1.6 ALTER USER SCOTT QUOTA UNLIMITED ON USERS;
1.7 GRANT PUBLIC TO SCOTT;
1.8 GRANT Create Public Synonym TO SCOTT;
2. Load Oracle SOAP client to SCOTT (for Oracle 10g Release 2 Database)
2.1 Commands
2.1.1 Open command prompt (cmd.exe)
2.1.2 loadjava -u scott/tiger -r -v -f -genmissing -s -grant public C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\webservices\lib\soap.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\lib\dms.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\jlib\javax-ssl-1_1.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\lib\servlet.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\lib\mail.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\lib\activation.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\lib\http_client.jar C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\lib\ejb.jar
2.1.3 It will take around 3 minutes and you will see "something" like the following when it completes (count may not be exact) :
Classes Loaded: 909
Resources Loaded: 75
Sources Loaded: 0
Published Interfaces: 0
Classes generated: 0
Classes skipped: 0
Synonyms Created: 984
Errors: 0
2.1.3 Close this command prompt
3. Load Oracle JAX-RPC client to SYS (for Oracle 10g Release 2 Database)
3.1 Commands
3.1.1 Open command prompt (cmd.exe)
3.1.2 loadjava -u sys/oracle -r -v -f -genmissing -s -grant public C:\oracle\product\10.2.0\db_1\dbws_callout_utility_10131\sqlj\lib\dbwsclientws.jar C:\oracle\product\10.2.0\db_1\dbws_callout_utility_10131\sqlj\lib\dbwsclientdb102.jar
3.1.2.1 It will take around 15 minutes and you will see "something" like following when it completes (count may not be exact) :
Classes Loaded: 4027
Resources Loaded: 81
Sources Loaded: 0
Published Interfaces: 0
Classes generated: 61
Classes skipped: 0
Synonyms Created: 4108
Errors: 0
3.1.3 Close this command prompt
4. Execute UTL_DBWS packages to SYS (for Oracle 10g Release 2 Database)
4.1 Commands
4.1.1 Connect to SYS account only
4.1.2 Execute the following (in TOAD you should execute them as Script, press the "thunder" button)
4.2.1 @"C:\oracle\product\10.2.0\db_1\dbws_callout_utility_10131\sqlj\lib\utl_dbws_decl.sql"
4.2.2 @"C:\oracle\product\10.2.0\db_1\dbws_callout_utility_10131\sqlj\lib\utl_dbws_body.sql"
4.2.3 CREATE PUBLIC SYNONYM utl_dbws FOR sys.utl_dbws;
5. Call-out a free Web Service using SCOTT
5.1 Commands
5.1.1 Connect to user SCOTT with password of TIGER
5.1.2 Copy and Paste the following "Anonymous Block" (sample #1) and execute it :
5.1.2.1 It sould return "PL/SQL DII client return ===> Redwood City"
declare
service_ utl_dbws.SERVICE;
call_ utl_dbws.CALL;
service_qname utl_dbws.QNAME;
port_qname utl_dbws.QNAME;
operation_qname utl_dbws.QNAME;
string_type_qname utl_dbws.QNAME;
retx ANYDATA;
retx_string VARCHAR2(1000);
retx_double number;
retx_len number;
params utl_dbws.ANYDATA_LIST;
l_input_params 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://webservices.imacination.com/distance/Distance.jws';
-- search for 'service name' in the wsdl
service_qname := utl_dbws.to_qname(l_namespace, 'DistanceService');
-- this is just the actual wsdl url
service_ := utl_dbws.create_service(HTTPURITYPE('http://webservices.imacination.com/distance/Distance.jws?wsdl'), service_qname);
-- search for 'portType name' in the wsdl
port_qname := utl_dbws.to_qname(l_namespace, 'Distance');
-- search for 'operation name' in the wsdl
-- there will be a lot, we will choose 'getCity'
operation_qname := utl_dbws.to_qname(l_namespace, 'getCity');
-- bind things together
call_ := utl_dbws.create_call(service_, port_qname, operation_qname);
-- default is 'FALSE', so we make it 'TRUE'
utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
-- search for 'operation soapAction' under <wsdl:operation name="getCity">
-- it is blank, so we make it ''
utl_dbws.set_property(call_, 'SOAPACTION_URI', '');
-- search for 'encodingstyle' under <wsdl:operation name="getCity">
utl_dbws.set_property(call_, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
-- search for 'binding style'
utl_dbws.set_property(call_, 'OPERATION_STYLE', 'rpc');
-- 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 := 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
utl_dbws.add_parameter(call_, 'zip', string_type_qname, 'ParameterMode.IN');
utl_dbws.set_return_type(call_, string_type_qname);
-- supply the In Parameter for the web service
params(0) := ANYDATA.convertvarchar('94065');
-- invoke the web service
retx := utl_dbws.invoke(call_, params);
-- access the returned value and output it to the screen
retx_string := retx.accessvarchar2;
dbms_output.put_line('PL/SQL DII client return ===> ' || retx_string);
-- release the web service call
utl_dbws.release_service(service_);
end;
5.1.3 Copy and Paste the following "Anonymous Block" (sample #2) and execute it :
5.1.3.1 It should return "PL/SQL DII client return ===> twelve thousand three hundred and forty five"
declare
service_ utl_dbws.SERVICE;
call_ utl_dbws.CALL;
service_qname utl_dbws.QNAME;
port_qname utl_dbws.QNAME;
operation_qname utl_dbws.QNAME;
string_type_qname utl_dbws.QNAME;
retx ANYDATA;
retx_string VARCHAR2(1000);
retx_double number;
retx_len number;
params utl_dbws.ANYDATA_LIST;
l_input_params utl_dbws.anydata_list;
l_result ANYDATA;
l_namespace VARCHAR2(1000);
begin
-- open internet explorer and navigate to http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL
-- search for 'targetNamespace' in the wsdl
l_namespace := 'http://www.dataaccess.com/webservicesserver/';
-- search for 'service name' in the wsdl
service_qname := utl_dbws.to_qname(l_namespace, 'NumberConversion');
-- this is just the actual wsdl url
service_ := utl_dbws.create_service(HTTPURITYPE('http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL'), service_qname);
-- search for 'portType name' in the wsdl
port_qname := utl_dbws.to_qname(l_namespace, 'NumberConversionSoap');
-- search for 'operation name' in the wsdl
-- there will be a lot, we will choose 'NumberToWords'
operation_qname := utl_dbws.to_qname(l_namespace, 'NumberToWords');
-- bind things together
call_ := utl_dbws.create_call(service_, port_qname, operation_qname);
-- default is 'FALSE', so we make it 'TRUE'
utl_dbws.set_property(call_, 'SOAPACTION_USE', 'TRUE');
-- search for 'operation soapAction' under <operation name="NumberToWords">
-- it is blank, so we make it ''
utl_dbws.set_property(call_, 'SOAPACTION_URI', '');
-- search for 'encodingstyle'
-- cannot find xml tag 'encodingstyle', so we just use the following as the generic encoding style
utl_dbws.set_property(call_, 'ENCODINGSTYLE_URI', 'http://schemas.xmlsoap.org/soap/encoding/');
-- search for 'binding style'
-- although 'document' was used, it produced an error, thus we will use 'rpc'
-- this value is generally only 'document' or 'rpc'
utl_dbws.set_property(call_, 'OPERATION_STYLE', 'rpc');
-- search for 'xmlns:xs' to know the value of the first parameter
-- under <xs:element name="NumberToWords"> you will see the line <xs:element name="ubiNum" type="xs:unsignedLong" />
-- thus the return type is 'unsignedlong', removing 'xs:'
-- however, upon testing, using 'unsignedlong' produced an error, while 'string' did not, so we will use 'string'
string_type_qname := utl_dbws.to_qname('http://www.w3.org/2001/XMLSchema', 'string');
-- under <xs:element name="NumberToWords"> you will see the line <xs:element name="ubiNum" type="xs:unsignedLong" />
-- the element name is 'ubiNum', thus we put in 'ubiNum'
-- 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 utl_dbws package
utl_dbws.add_parameter(call_, 'ubiNum', string_type_qname, 'ParameterMode.IN');
utl_dbws.set_return_type(call_, string_type_qname);
-- supply the In Parameter for the web service
params(0) := ANYDATA.convertvarchar('12345');
-- invoke the web service
retx := utl_dbws.invoke(call_, params);
-- access the returned value and output it to the screen
retx_string := retx.accessvarchar2;
dbms_output.put_line('PL/SQL DII client return ===> ' || retx_string);
-- release the web service call
utl_dbws.release_service(service_);
end;
NOTES AND REFERENCES
=================================================================
This detailed step-by-step guide was produced with the following guide http://www.oracle.com/technology/sample_code/tech/java/jsp/callout_users_guide.htm
I could still not load Oracle JAX-RPC client to SCOTT (step 4) as it produces an error. See the following for more details :
http://forums.oracle.com/forums/thread.jspa?threadID=633219&tstart=0
Also, I could not consume some of the other free Web Services out there for reasons I don't know, hope someone can help clarify. See the following for more details :
http://forums.oracle.com/forums/thread.jspa?threadID=630733&tstart=0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Instructions on how to use Oracle10gR2 Webservice Call-In feature
PREREQUISITE
=================================================================
1. Download Oracle Database 10g Release 2 (10.2.0.1.0) (ZIP, ~655MB)
http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201winsoft.html
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
1.1 Choose Enterprise Edition
2. Download OC4J Standalone - Oracle Containers for J2EE (OC4J) 10g Release 3 (10.1.3.3) (ZIP, ~93MB; Pure Java—runs on all certified platforms)
http://www.oracle.com/technology/software/products/ias/index.html (Download Site)
http://download.oracle.com/otn/java/oc4j/101330/oc4j_extended_101330.zip
2.1 Extract to C:\oracle\product\10.2.0\db_1\oc4j_extended_101330
STEP-BY-STEP PROCEDURES
=================================================================
1. Connect to SYS account and create user STORE
CREATE USER store IDENTIFIED BY store;
GRANT connect, resource TO store;
2. Connect to Oracle using the user STORE and password STORE
CONNECT store/store;
3. Execute the following objects for this excercise
CREATE SEQUENCE order_sq;
CREATE TABLE product_types (
product_type_id INTEGER
CONSTRAINT product_types_pk PRIMARY KEY,
name VARCHAR2(10) NOT NULL
CREATE TABLE products (
product_id INTEGER
CONSTRAINT products_pk PRIMARY KEY,
product_type_id INTEGER
CONSTRAINT products_fk_product_types
REFERENCES product_types(product_type_id),
name VARCHAR2(30) NOT NULL,
description VARCHAR2(50),
price NUMBER(5, 2)
CREATE TABLE customers (
customer_id INTEGER
CONSTRAINT customers_pk PRIMARY KEY,
first_name VARCHAR2(10) NOT NULL,
last_name VARCHAR2(10) NOT NULL,
dob DATE,
phone VARCHAR2(12)
CREATE TABLE orders (
order_id INTEGER
CONSTRAINT orders_pk PRIMARY KEY,
product_id INTEGER
CONSTRAINT purchases_fk_products
REFERENCES products(product_id),
customer_id INTEGER
CONSTRAINT purchases_fk_customers
REFERENCES customers(customer_id),
quantity INTEGER NOT NULL
INSERT INTO customers (
customer_id, first_name, last_name, dob, phone
) VALUES (
1, 'John', 'Brown', '01-JAN-1965', '800-555-1211'
INSERT INTO product_types (
product_type_id, name
) VALUES (
1, 'Book'
INSERT INTO products (
product_id, product_type_id, name, description, price
) VALUES (
1, 1, 'Modern Science', 'A description of modern science', 19.95
COMMIT;
CREATE OR REPLACE PACKAGE dbfunc AS
FUNCTION place_order (
p_product_id INTEGER,
p_customer_id INTEGER,
p_quantity INTEGER
RETURN VARCHAR2;
END dbfunc;
CREATE OR REPLACE PACKAGE BODY dbfunc AS
FUNCTION place_order (
p_product_id INTEGER,
p_customer_id INTEGER,
p_quantity INTEGER
RETURN VARCHAR2 IS
v_customer_count INTEGER;
v_product_count INTEGER;
v_order_id INTEGER;
BEGIN
-- count the number of products with the
-- supplied p_product_id (should be 1 if the product exists)
SELECT COUNT(*)
INTO v_product_count
FROM products
WHERE product_id = p_product_id;
IF v_product_count = 0 THEN
RETURN 'No such product';
END IF;
-- count the number of customers with the
-- supplied p_customer_id (should be 1)
SELECT COUNT(*)
INTO v_customer_count
FROM customers
WHERE customer_id = p_customer_id;
IF v_customer_count = 0 THEN
RETURN 'No such customer';
END IF;
-- get the next value from orders_sq
SELECT order_sq.nextval
INTO v_order_id
FROM dual;
-- place the order
INSERT INTO orders (
order_id, product_id, customer_id, quantity
) VALUES (
v_order_id, p_product_id, p_customer_id, p_quantity
COMMIT;
RETURN 'Order placed with id of ' || v_order_id;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
RETURN 'Order not placed';
END place_order;
END dbfunc;
4. Install and Configure OC4J
4.1 Change Directory
4.1.1 Open command prompt (cmd.exe)
4.1.2 CD C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\bin
4.2 Configure Environment variables (type in command prompt)
4.2.1 set JAVA_HOME=C:\oracle\product\10.2.0\db_1\jdk
4.2.2 set ORACLE_HOME=C:\oracle\product\10.2.0\db_1\oc4j_extended_101330
4.3 Starting OC4J for the first time
4.3.1 oc4j -start
4.3.2 If this is not your first time to "start" oc4j, go to step 4.3.4
4.3.3 Set oc4jadmin password (use the password "oracle" w/o the quotation marks)
08/03/21 17:13:54 Set OC4J administrator's password (password text will not be displayed as it is entered)
Enter password:
Confirm password:
Confirm password: The password for OC4J administrator "oc4jadmin" has been set.
08/03/21 17:14:01 The OC4J administrator "oc4jadmin" account is activated.
4.3.4 OC4J has started if you see the message :
08/03/21 17:14:16 Oracle Containers for J2EE 10g (10.1.3.3.0) initialized
4.3.5 Leave this command prompt open
4.4 Configure Data Source
4.4.1 Open a new command prompt via the cmd.exe command
4.4.2 type "hostname" and then press enter
4.4.3 Keep this command prompt open for later use
4.4.4 Open Windows Explorer and navigate to the folder C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\config
4.4.5 Open the file data-sources.xml
4.4.6 Modify and Save the file so that it will look something like the following :
4.4.6.1 Note that "hpv2710us" is my hostname found in step 4.4.2
4.4.6.2 Note that "ORCLDEV" is the name of my Oracle Instance. (Default installation uses ORCL only)
<connection-pool name="Example Connection Pool">
<connection-factory factory-class="oracle.jdbc.pool.OracleDataSource"
user="store"
password="store"
url="jdbc:oracle:thin:@//hpv2710us:1521/ORCLDEV">
</connection-factory>
</connection-pool>
4.4.7 Close the text editor
4.4.8 Close the Windows Explorer
4.4.9 Close this command prompt (type exit)
5. Publishing a PL/SQL Package as a Database Web Service
5.1 Create the config.xml file
5.1.1 Open Notepad.exe
5.1.2 Copy and Paste the following :
5.1.2.1 Note that "hpv2710us" is my hostname found in step 4.4.2
5.1.2.2 Note that "ORCLDEV" is the name of my Oracle Instance. (Default installation uses ORCL only)
<web-service>
<display-name>PLSQL Web Service</display-name>
<description>PLSQL Sample</description>
<destination-path>./dbfunc.ear</destination-path>
<temporary-directory>/tmp</temporary-directory>
<context>/plsqlsample</context>
<stateless-stored-procedure-java-service>
<jar-generation>
<schema>store/store</schema>
<db-url>jdbc:oracle:thin:@hpv2710us:1521:ORCLDEV</db-url>
<prefix>db.func.place.order</prefix>
<db-pkg-name>dbfunc</db-pkg-name>
</jar-generation>
<uri>/dbfunc</uri>
<database-JNDI-name>jdbc/OracleDS</database-JNDI-name>
</stateless-stored-procedure-java-service>
<wsdl-gen>
<wsdl-dir>wsdl</wsdl-dir>
<option name="force">true</option>
<option name="httpServerURL">http://localhost:8888</option>
</wsdl-gen>
<proxy-gen>
<proxy-dir>proxy</proxy-dir>
<option name="include-source">true</option>
</proxy-gen>
</web-service>
5.1.3 Save file as config.xml in the directory C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\config
5.1.3.1 Note it should be config.xml and not config.txt
5.1.4 Close the text editor
5.2 Publish dbfunc Oracle Package as a Web Service
5.2.1 Open a new command prompt via the cmd.exe command
5.2.2 CD C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home
5.2.3 mkdir ear
5.2.4 CD ear
5.2.5 set ORACLE_HOME=C:\oracle\product\10.2.0\db_1\oc4j_extended_101330
5.2.6 set CLASSPATH=.;%ORACLE_HOME%\webservices\lib\wsdl.jar;%ORACLE_HOME%\lib\xmlparserv2.jar;%ORACLE_HOME%\soap\lib\soap.jar
5.2.7 java -jar %ORACLE_HOME%\webservices\lib\WebServicesAssembler.jar -config C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\config\config.xml
Please wait ...
STORE.DBFUNC
5.2.8 java -jar %ORACLE_HOME%\j2ee\home\admin_client.jar deployer:oc4j:localhost:23791 oc4jadmin oracle -deploy -file C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home\ear\dbfunc.ear -deploymentName dbfunc
08/03/21 17:46:23 Notification ==>Application Deployer for dbfunc COMPLETES. Operation time: 296 msecs
5.2.9 java -jar %ORACLE_HOME%\j2ee\home\admin_client.jar deployer:oc4j:localhost:23791 oc4jadmin oracle -bindWebApp -appname dbfunc -webModuleName dbfunc_web
5.2.10 java -jar %ORACLE_HOME%\j2ee\home\admin_client.jar deployer:oc4j:localhost:23791 oc4jadmin oracle -bindAllWebApps -appname dbfunc
5.2.11 Close this command prompt (type exit)
6. Test dbfunc Web Service
6.1 Restart OC4J
6.1.1 Open the command prompt you used to start OC4J in step 4.1.1/4.3.1
6.1.2 In the keyboard, hit Ctrl+C
6.1.2.1 Type "Y" and then hit Enter
08/03/21 18:02:51 Shutting down OC4J...
Terminate batch job (Y/N)? Y
6.1.2.2 Note that the command prompt should still be open
6.1.2.2.1 If you accidentally closed the command prompt just do the following
6.1.2.2.1.1 Do 4.1.1 to 4.2.2 and then proceed to 6.1.3
6.1.3 oc4j -start
Starting OC4J from C:\oracle\product\10.2.0\db_1\oc4j_extended_101330\j2ee\home...
08/03/21 18:07:57 Oracle Containers for J2EE 10g (10.1.3.3.0) initialized
6.1.4 Leave this command prompt open
6.2 Use the Web Service to "Order an Item"
6.2.1 Connect to Oracle using the user STORE and password STORE
6.2.2 select * from orders
6.2.2.1 Zero row should return
6.2.3 Open Internet Explorer
6.2.4 Navigate to http://localhost:8888/plsqlsample/dbfunc
6.2.5 Input the following :
6.2.5.1 param0 value: 1
6.2.5.2 param1 value: 1
6.2.5.3 param2 value: 10
6.2.6 Click the Invoke button
6.2.7 A pop-up window will appear having the following contents :
<?xml version="1.0" encoding="UTF-8" ?>
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <SOAP-ENV:Body>
- <ns1:placeOrderResponse xmlns:ns1="http://db.func.place.order/dbfunc.wsdl" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">Order placed with id of 1</return>
</ns1:placeOrderResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
6.2.8 Go back to SQLPLUS or Toad and execute "select * from orders" again
6.2.8.1 There should be one row
ORDER_ID, PRODUCT_ID, CUSTOMER_ID, QUANTITY
1, 1, 1, 10
NOTES AND REFERENCES
=================================================================
This detailed step-by-step guide was produced with the following article by Jason Price http://www.oracle.com/technology/pub/articles/price_10gws.html

Success!!!
I had to grant this permissions:
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.lang.RuntimePermission', 'getClassLoader', '' );
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar', '' );
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.lang.RuntimePermission', 'setFactory', '' )
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.util.PropertyPermission', 'HTTPClient.socket.idleTimeout', 'write' );
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.net.SocketPermission', 'localhost', 'resolve' );
call dbms_java.grant_permission( 'WS_TEST', 'SYS:java.net.SocketPermission', '127.0.0.1:8084', 'connect,resolve' );
As I wrote earlier, WS_TEST is my user into which I load JAX-RPC client. Note that, if you load JAX-RPC client into user another than SYS, you have NOT to use -s -grant public option (wassam wrote about this too). Another thing is that I (finally) didn't load OC4J. To consume WebService I use utl_dbws.invoke(call_Handle CALL, request SYS.XMLTYPE) function.
voytec001

Similar Messages

  • Getting SOAException while calling SOA web service via pl/sql procedure

    Hi All,
    I created a 'Helloworld' BPEL process and successfuly deployed it. I tested it in the WLS and it is working. Now I wrote a pl/sql procedure which calls this 'HelloWorld' bpel process. When ran this procedure it throw me an error
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    GetPayload: resp3 IS NULL
    <HTML><HEAD><TITLE>Web Service</TITLE></HEAD><BODY><H1>Bad Request</H1><PRE>javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Unexpected character &#39;&#60;&#39; &#40;code 60&#41; excepted space, or &
    #62;&#39; or &#34;/&#62;&#34;
    at [row,col {unknown&#45;source}]: [1,120]</PRE></BODY></HTML>
    null response
    Please suggest.
    WSDL - http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep?WSDL
    procedure code is as below:
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(640) := '<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="comment()|processing-instruction()|/"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> <xsl:template match="@*"> <xsl:choose> <xsl:when test="name() != ''xmlns''"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:when> </xsl:choose> </xsl:template></xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||'<SOAP-ENV:Envelope '||'xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'||'<SOAP-ENV:Body>'||'<'||namespace||'>'||'<ProcessRequest>'||'<input'||namespace||'>'||p_Payload||'</input>'||'</ProcessRequest>'||'</SOAP-ENV:Body>'||'</SOAP-ENV:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    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);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

    vladodias thanks for the reply. I went through the link before also but i am not comfortable with the utl_dbws that's why i am following utl_http.
    I also changed my procedure now i am not getting any error but it is not printing the output as well. New procedure is as below.
    I tried 'set serveroutput on size 1000000;' also but still not working.
    Create or Replace FUNCTION GetPayload(
    p_Payload IN VARCHAR2)
    RETURN VARCHAR2 IS
    soap_request VARCHAR2(30000);
    soap_respond VARCHAR2(30000);
    http_req UTL_HTTP.REQ;
    http_resp UTL_HTTP.RESP;
    resp XMLTYPE;
    response VARCHAR2(30000) := '';
    l_detail VARCHAR2(30000);
    i INTEGER;
    l_xsl_nonamespace VARCHAR2(3000) := '<?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="comment()|processing-instruction()|/">
    <xsl:copy>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*">
    <xsl:element name="{local-name()}">
    <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
    </xsl:template>
    <xsl:template match="@*">
    <xsl:choose>
    <xsl:when test="name() != ''xmlns''">
    <xsl:attribute name="{local-name()}">
    <xsl:value-of select="."/>
    </xsl:attribute>
    </xsl:when>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet>';
    namespace VARCHAR2(128) := 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP';
    endpoint VARCHAR2(128) := 'http://herbalife-mwdv4-new.hrbl.net:21000/soa-infra/services/SAI/HTTP_BPEL/bpelprocesshttp_client_ep';
    BEGIN
    soap_request:= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bpel="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP">
    <soapenv:Header/>
    <soapenv:Body>
    <bpel:process>
    <bpel:input>test</bpel:input>
    </bpel:process>
    </soapenv:Body>
    </soapenv:Envelope>';
    http_req := utl_http.begin_request( endpoint, 'POST', 'HTTP/1.1');
    utl_http.set_header(http_req , 'Content-Type' , 'text/xml');
    -- dealing with plain text in XML documents
    utl_http.set_header(http_req , 'Content-Length' , lengthb(soap_request));
    utl_http.set_header(http_req , 'SOAPAction' , 'process'); -- required to specify a SOAP communication
    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);
    resp:= XMLType.createXML(soap_respond);
    IF (instr(resp.getStringVal(), 'ERROR:') > 0)THEN
    raise_application_error ( -20999, 'GetHelloWorldPayload: Failed! '||p_Payload);
    END IF;
    resp := resp.extract('/soap:Envelope/soap:Body/child::node()' , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' );
    -- Remove namespaces
    SELECT XMLTransform(resp, xmlType(l_xsl_nonamespace)) INTO resp FROM dual;
    -- resp := resp.extract('/ProcessResponse/child::node()', 'xmlns:ns1="http://xmlns.oracle.com/FusionServices/HTTP_BPEL/BPELProcessHTTP');
    IF (resp IS NULL)THEN
    dbms_output.put_line('GetPayload: resp3 IS NULL');
    ELSE
    dbms_output.put_line('GetPayload: resp3 ' ||resp.getStringVal());
    END IF;
    i:=0;
    LOOP
    dbms_output.put_line(SUBSTR(soap_respond,1+ i*255,250));
    i := i+1;
    IF i*250> LENGTH(soap_respond) THEN
    EXIT;
    END IF;
    END LOOP;
    IF (resp IS NULL)THEN
    response := 'null response';
    ELSE
    response := REPLACE( REPLACE( REPLACE( resp.getStringVal(), '<', '<') , '>', '>') , '"', '"');
    END IF;
    RETURN response;
    END GetPayload;
    /

  • Got an error while installing oracle 10gR2 on RHEL 4

    Hi Everybody,
    After running ./runInstaller while installing oracle 10gR2 on RHEL4 ,i got an error message showing below can anyone guide me how can i proceed furthur?
    As Follows:-
    [oracle@localhost database]$ ./runInstaller Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-10-29_09-37-34PM. Please wait ...[oracle@localhost database]$ Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.Window.init(Unknown Source)
    at java.awt.Window.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at oracle.ewt.popup.PopupFrame.<init>(Unknown Source)
    at oracle.ewt.lwAWT.BufferedFrame.<init>(Unknown Source)
    at oracle.sysman.oio.oioc.OiocOneClickInstaller.<init>(OiocOneClickInstaller.java:378)
    at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)
    [oracle@localhost database]$ ./runInstaller
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be redhat-3, SuSE-9, redhat-4, UnitedLinux-1.0, asianux-1 or asianux-2
    Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-10-29_09-37-54PM. Please wait ...[oracle@localhost database]$ Xlib: connection to ":0.0" refused by server
    Xlib: No protocol specified
    Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
    at java.awt.Window.init(Unknown Source)
    at java.awt.Window.<init>(Unknown Source)
    at java.awt.Frame.<init>(Unknown Source)
    at oracle.ewt.popup.PopupFrame.<init>(Unknown Source)
    at oracle.ewt.lwAWT.BufferedFrame.<init>(Unknown Source)
    at oracle.sysman.oio.oioc.OiocOneClickInstaller.<init>(OiocOneClickInstaller.java:378)
    at oracle.sysman.oio.oioc.OiocOneClickInstaller.main(OiocOneClickInstaller.java:2091)

    Hi,
    You got these errors because runInstaller can not start the GUI. There are 2 solutions, you can choose one:
    1. logout Gnome/Kde, login as oracle user, and run runInstaller again.
    2.open a new root terminal,
    a) run "xhost +" as root.
    b) run "su - oracle" switch to oracle
    c) run "export DISPLAY=:0.0"
    d) then run "./runInstaller" again.
    cheers.
    Ice

  • How to install oracle 10gR2 datamining

    how to install oracle 10gR2 datamining ??????

    its very simple
    step 1: install u r oracle database with data warehousing , data mining feature.
    step 2: download the s/w of data miner from oracle website
    step 3: Create user in oracle dtabase with data mining privilages
    step 4: run odminer file from the data miner folder which u have downloaded from oracle site
    step 6:give the user /password/sid/host/port no u should know all this , are copy sid name while ur installing database.
    step 7: give the path of sqlload.exe in data miner TOOLs==>preferance file for importing the data from external databases
    thts it u are able 2 work with data miner

  • Getting error in Oracle EDQP Webservice call using Soap UI

    Hi ,
    I am trying to use Oracle EDQP webservice : http://<<hostname>>:<<port>>/datalens/ws/Processor
    when i trying to access the processOneLine or processList operation, i am getting the follwing error:
    <faultstring>oracle.pdq.api1.minicore.SaDetailException: 1318: Invalid job step - Either you must specify a step name when there are multiple output steps or there are no output steps that return a result.
    Code: 1318
    Details: Either you must specify a step name when there are multiple output steps or there are no output steps that return a result.</faultstring>
    Please help me to resolve this issue.
    Thanks in Advance.
    - Raj

    Hi Raj,
    Not sure if this is already resolved.
    Seems your DSA has atleast 2 outputs. As of Version 11.1.1.6.1 the webervice allows calls to DSAs with only 1 output. So your options are:
    Combine your outputs to single output
    Use other integration methods
    Hope this helps.
    Thanks!
    Anand Lonkar

  • Problem calling java from vb via activex bridge

    I am trying to call java from vb via ActiveX Bridge and I am running into problems. I would appreciate any help.
    I am using Visual Basic 2010 express, and Java JDK 1.6.0_16. I have used the http://download.oracle.com/javase/1.4.2/docs/guide/beans/axbridge/developerguide/index.html page as a guideline. To try to make it work I took the following steps:
    1. Wrote a very simple java class (below):
    package xxx;
    import java.io.Serializable;
    public class axb implements Serializable {
    public int get_axb_Handle() {
    int Address = 12345678;
    return Address;
    2. After I compiled, and created the jar file. I built the dll using the following command:
    "C:\Program Files\Java\jdk1.6.0_16\bin\packager" -out "C:\Program Files\Java\jdk1.6.0_16\jre\axbridge\bin" E:\axb\dist\axb.jar xxx.axb
    3. I then registered using: regsvr32 axb.dll
    4. In Visual Basic Express IDE I use Project -> Add Reference to add Iterop.axb (dump below), and axb namespace
    5. In my basic code I use the following lines
    Dim axb1 As axb.axb
    axb1 = New axb.axb <== Crash here with AccessViolationException ( full exception below)
    What am I missing? Any help would be greatly appreciated
    Thanks
    Iterop.axb partial dump
    ___[MOD] C:\Documents and Settings\Elie A. Cohen.USINC022\My Documents\Visual Studio 2010\Projects\Repo API Example\Repo API Example\obj\x86\Release\Interop.axb.dll
    | M A N I F E S T
    |___[NSP] axb
    | |___[INT] axb.axb
    | | | .class interface public abstract auto ansi import /*02000006*/
    | | | implements axb.axbDispatch/*02000003*/
    | | | implements axb.axbSource_Event/*02000005*/
    | | | .custom /*0C000018:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 34 45 36 44 30 44 41 38 2D 36 41 45 44 // ..$4E6D0DA8-6AED ...
    | | | .custom /*0C000019:0A000007*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.CoClassAttribute/*01000009*/::.ctor(class [mscorlib/*23000001*/]System.Type/*01000007*/) /* 0A000007 */ = ( 01 00 0C 61 78 62 2E 61 78 62 43 6C 61 73 73 00 // ...axb.axbClass. ...
    | |
    | |___[CLS] axb.axbClass
    | | | .class public auto ansi import /*02000004*/
    | | | implements axb.axbDispatch/*02000003*/
    | | | implements axb.axb/*02000006*/
    | | | implements axb.axbSource_Event/*02000005*/
    | | | .custom /*0C00000F:0A000008*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ClassInterfaceAttribute/*0100000A*/::.ctor(int16) /* 0A000008 */ = ( 01 00 00 00 00 00 ) ...
    | | | .custom /*0C000010:0A000009*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.ComSourceInterfacesAttribute/*0100000B*/::.ctor(string) /* 0A000009 */ = ( 01 00 0F 61 78 62 2E 61 78 62 53 6F 75 72 63 65 // ...axb.axbSource ...
    | | | .custom /*0C000011:0A000001*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.GuidAttribute/*01000002*/::.ctor(string) /* 0A000001 */ = ( 01 00 24 43 44 42 46 36 42 33 33 2D 45 32 33 46 // ..$CDBF6B33-E23F ...
    | | | .custom /*0C000012:0A000002*/ instance void [mscorlib/*23000001*/]System.Runtime.InteropServices.TypeLibTypeAttribute/*01000003*/::.ctor(int16) /* 0A000002 */ = ( 01 00 02 00 00 00 ) ...
    | | |___[MET] method .ctor : void()
    | | |___[MET] method equals : bool(object)
    | | |___[MET] method getClass : object()
    | | |___[MET] method get_axb_Handle : int32()
    | | |___[MET] method hashCode : int32()
    | | |___[MET] method notify : void()
    | | |___[MET] method notifyAll : void()
    | | |___[MET] method toString : string()
    | | |___[MET] method wait : object(object,object)
    AccessViolationException exception
    System.AccessViolationException was unhandled
    Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Source=mscorlib
    StackTrace:
    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
    at System.Activator.CreateInstance(Type type, Boolean nonPublic)
    at System.Activator.CreateInstance(Type type)
    at WindowsApplication1.Form1.getPatientHandle_Click(Object sender, EventArgs e) in C:\Documents and Settings\Elie A. Cohen.USINC022\my documents\visual studio 2010\Projects\Repo API Example\Repo API Example\Repo API Example.vb:line 13
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(ApplicationContext context)
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

    In case you haven't figured it out already... Or if anyone else is curious... Or for myself when I get old and forgetful...
    h2. Object Creation
    For starters, when you create an ActiveX object from within VB, use:
    Set myObject = CreateObject("JavaObject.Bean")When I refer to JavaObject.Bean, I'm meaning the full object name + ".Bean". So, in your case, you should use:
    Set myObject = CreateObject("xxx.axb.Bean")h2. Location
    The .dll file must be located in the JRE that is used at the time of calling. Meaning, the .dll file must be placed under <jre_home>\axbridge\bin and registered there.
    In your case:
    DLL:
    C:\Program Files\Java\jre6\axbridge\bin
    Jar:
    C:\Program Files\Java\jre6\axbridge\libh4. A Note:
    The only supported JRE is a 32bit version as far as I know with regards to the ActiveX bridge. Just like the packager.exe can only be found in the 32bit JDK.
    h2. Methods
    h3. Object Types
    ActiveX Bridge does not support passing literals or arrays. However, it does support passing java's primitive data types as Objects.
    Simply meaning:
    h4. Invalid:
    public int get_axb_Handle() {
         int Address = 12345678;
         return Address;
    }h4. Valid:
    public Integer get_axb_Handle() {
         int Address = 12345678;
         return Address;
    }On a normal circumstance, there's little difference between the two methods. However, in the second example, the JVM does a typecast from a literal data type to a object data type, resulting in a valid object to pass through to Visual Basic. Now, obviously there are multiple ways to do a proper change, new Integer(int) for example. It doesn't matter to me. At the end of the day, you have to pass an object.
    As a side note, the same idea applies when receiving data from Visual Basic.
    h4. Invalid:
    public void set_axb_Handle(int newHandle) {
         int Address = newHandle;
    }h4. Valid:
    public void set_axb_Handle(Integer newHandle) {
         int Address =newHandle;

  • How to call a shell script via ODI

    Hi,
    I need suggestion on following issues:
    1) How to call a shell script via ODI?.. I tried using OSCommand utility .inspite of the execution being successful the data is not written into the new file in the desired format. After processing new file is created in the mentioned location but its empty.
    2) I'm calling a procedure in ODI to load data into my fact. But once the fact gets loaded i want to update the log details (num of rows processed,num of rows inserted,num of rows rejected etc) in my log table. I'm planning to use a proc for updating but need to know from where can i find these details. Is there a table in work rep which gives me these info like how we get if we execute an interface.?
    Please help me out.. Its urgent
    Regards
    Surabhi

    Hello,
    Question 1 appears a little vague, please elaborate. If you're looking to capture a return value from the command execution, you will need to pipe the return value to a file, then read from there.
    The execution information is stored in the SNP_STEP_LOG table in the Work Repository. You will need to do a series of joins to retrieve the exact table that was updated. Good luck with this...

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • How to call back to C via JNI in Java started from C?

    Hi!
    This problem might seem outlandish, but I have not been able to find any other method to reach my goal. The situation is the following.
    There is a C++ program I intend to interface with a piece of Java code, called the manager. The C++ code invokes a VM, starts a Java glue code, that connects to the manager via RMI. This works fine. The glue code, however, can be called from the manager, via RMI as well. The problem is, that these calls should in turn call functions in the C++ code, that originally started the Java glue code. JNI can only load a library, but this is not what I want to do now. I want to somehow connect back to the C code that started the Java code. Is this possible at all?
    Thanks for your help,
    Ambrus

    What you want to do is not too tough, but there will be some details to be worked through. In particular, you have to figure out how to make your "callback" get from your "glue" code back into your C++.
    1. Calling back out is from java to C is pretty easy. There is a JNI function for registering a native method with the JVM. Here is an example of the registration code:
    // See if the service interface class is known.
    javaClass = javaEnv->FindClass("JavaInterfaceObject");
    if (javaClass != 0) {
    //Register a native method to place java server messages in the service log.
    // Define the service logger native method.
    JNINativeMethod methods[] = {
    {"addToMessageLog", "(Ljava/lang/String;)V", Java_addToMessageLog}
    // Register the method with the jvm.
    javaEnv->RegisterNatives(javaClass, methods, 1);
         javaEnv->ExceptionClear();     // Just in case not found.
         return TRUE;
    2. You have to define the native method:
    * Native method - callback to place java server messages in the service log.
    JNIEXPORT void JNICALL Server::Java_addToMessageLog(JNIEnv * javaEnv, jclass javaClass, jstring javaMsg) {
         jboolean     isCopy;
         const char* msg = javaEnv->GetStringUTFChars(javaMsg, &isCopy);
         Server::theServer->logger->addToMessageLog((char*)msg);
         if (isCopy)
              javaEnv->ReleaseStringUTFChars(javaMsg, msg);
    3. The real headache is that this is C code, not C++. In other words, if you really need to call into C++, then you need to seed your callback so that it has a pointer to the appropriate C++ object.

  • Call procedure via dynamic sql

    Dear Oracle experts,
    I try to call several stored procedures from several packages within the function below.
    These stored procedures all own a procedure returning a version string.
    I would like to write a function which gets a schemaname (for the schema which contains the package), and a packagename which calls a procedure within that package (all packages have a procedure called sp_packageversion which returns a versionstring) and returns the received versionstring.
    But my codes doesn't work because the dynamic sql doesn't call the procedure.
    What am I doing the wrong way ?
    function func_GetPackageVersion(prm_ecs_Schemaname varchar2, prm_objectname user_procedures.object_name%type
    ) return varchar2 is
    sqlstmt varchar2(100);
    objectversion varchar2(50);
    begin
    sqlstmt := prm_ecs_Schemaname || '.' || prm_objectname || '.sp_packageversion(objectversion)';
    execute immediate sqlstmt;
    return objectversion;
    end func_GetECSPackageVersion;
    Hope someone can help.
    Best regards,
    Daniel

    test@ora>
    test@ora>
    test@ora> --
    test@ora> -- the package
    test@ora> --
    test@ora> create or replace package my_pkg
      2  as
      3    procedure sp_packageversion (objectversion out varchar2);
      4  end;
      5  /
    Package created.
    test@ora>
    test@ora> create or replace package body my_pkg
      2  as
      3    procedure sp_packageversion (objectversion out varchar2)
      4    is
      5    begin
      6      objectversion := 'VERSION IS 10.1.2.3';
      7    end;
      8  end;
      9  /
    Package body created.
    test@ora>
    test@ora> --
    test@ora> -- the function
    test@ora> --
    test@ora> create or replace function func_GetPackageVersion (
      2    prm_ecs_Schemaname varchar2,
      3    prm_objectname     user_procedures.object_name%type
      4  )
      5  return varchar2
      6  is
      7    sqlstmt varchar2(4000);
      8    objectversion varchar2(50);
      9  begin
    10    execute immediate 'BEGIN '|| prm_ecs_Schemaname ||'.' || prm_objectname || '.sp_packageversion(:x); END; ' USING OUT objectversion;
    11    return objectversion;
    12  end;
    13  /
    Function created.
    test@ora>
    test@ora> --
    test@ora> -- anonymous pl/sql block for the function
    test@ora> --
    test@ora> declare
      2    p_ecs_Schemaname  varchar2(30) := 'TEST';
      3    p_objectname      user_procedures.object_name%type := 'MY_PKG';
      4    v_return_str      varchar2(32767);
      5  begin
      6    v_return_str := func_GetPackageVersion (p_ecs_Schemaname, p_objectname);
      7    dbms_output.put_line(v_return_str);
      8  end;
      9  /
    VERSION IS 10.1.2.3
    PL/SQL procedure successfully completed.
    test@ora>
    test@ora>
    test@ora>HTH
    isotope

  • Can my MAC automatically Record Calls from my RAZR via BlueTooth ???????

    Can my MAC automatically Record Calls from my RAZR via BlueTooth ?
    That would be so cool !

    well, that only possible if the call comes through the mac
    if it was a landline, then you connect the phoneline into the modem, thru the software, then back out the modem and out to the phone. I have sucessfully done this on a windows machine
    i suppose cellphones can be used as modems, so you could hook it upto the mac and then answer the call thru your mac's speakers and microphone...youll need to develop or find the appropriate software to this tho.

  • I recently thought I lost my iPhone and I erased it but now that I found it. I cannot get the this iPhone message is lost please call ********* I am out of the country my laptop is at home. I cannot access I tune. How do I fix this. I have an iPhone 4s

    I recently thought I lost my iPhone and I erased it but now that I found it. I cannot get the this iPhone message is lost please call ********* I am out of the country my laptop is at home. I cannot access I tune. How do I fix this. I need to get it back on so I can face time with my family. The phone says 3G but it keeps saying on list mode. I signed on icloud and removed it from the account and nothing. Please help!

    If you removed the device from your iCloud account rather than using the "Stop Lost Mode" option, then you will most certainly need to restore the iPhone, and that will require a computer running iTunes.
    http://support.apple.com/kb/HT1414
    Regards.

  • Need ANI details of calls landing during Out of business hours

    Hello All,
    Our Contact Center management has raised a new requirement to report with the ANI details of calls landing at any skill groups during put of business hours.
    Options that we have is
    1. Webview report - Call Type 22 and 23
    But in this, If we specify put of business timings and generate the report it will give the number of calls and not its ANI.
    2. Call detail report from our custom report application.
    Here the problem is, this report will give details of calls landing during business hours alone. The reason is that only the calls that utilizes VXML ports in CVP gets to this custom report. The calls coming in during of hours is handled at ICM level and to play the out of office hours prompt it utilizes CVP port not VXML and terminates the call.
    Is there any way to get this ANI details without having to modify this custom report much. Please assist in this. Let me know if you need any more details.

    That's pretty strange.
    Let's just see how you are doing this. Once you detect the out of hours situation in your Routing Script (either by checking a Global variable refreshed by an Admin script or by having a Time of Day node directly in the routing script), do you set a Call Type?
    Then after setting the call type, I assume you play a CVP message and Release the call. Correct?
    When you query the TCD on this call type you should only see your after hours calls. Let's look at one of the calls.
    You should see two rows in the TCD, one with the DNIS of your number on the gateway, or from the PSTN carrier, and one with the VRU transfer label (say 8111111111) - maybe that's in the DigitsDialed column, I'm not in front of an HDS database and can't check. This is all you should see for a call that comes out of hours.
    Both these legs should have the same RouterCallKey with different RouterCallKeySequenceNumbers.
    Do you see this?
    What is happening with another call at a similar time with a different RouterCallKey ? That doesn't make sense.
    Maybe you could do a query and show us the output?
    Regards,
    Geoff

  • My iPhone4 doesn't appear to have "FacTime" (App), yet when I "ring" it from my iPad's FaceTime, I hear a faint ringing tone but nowhere to answer the call? Anyone out there suggest what's wrong? (going to the App Store and searching "FaceTime" brings iPa

    My iPhone4 doesn't appear to have "FacTime" (App), yet when I "ring" it from my iPad's FaceTime, I hear a faint ringing tone but nowhere to answer the call? Anyone out there suggest what's wrong? (going to the App Store and searching "FaceTime" brings apps that have icons different to that of my iPads!)

    Yeah, I know I can restore it, but I might as well go ahead and try. I just finished a backup for icloud and itunes to make sure, I'll go ahead and restore it and set it up as new and see how that works. Seems like I have no other options at this point, I'd still like to know what they did with the Download tab in itunes store, if they removed it or if I'm just overlooking it.

  • Downloading and installing the iOS5.0.1 Following problems occured: with my iPhone 4s: Phone calls are dropping out in UAE, how to solve the problem?

    Downloading and installing the iOS5.0.1 Following problems occured: with my iPhone 4s: Phone calls are dropping out in UAE, how to solve the problem?

    You're not speaking to Apple on in this forum, nor will someone from Apple see this post.   We are just users like you and I.
    Have you tried to restore or reset your phone?
    Or contact your carrier in re: to your sim card

Maybe you are looking for