Unable to invoke a protected web service from PL/Sql
Hi All
I am trying to invoke a protected web service from Plsql. But getting the below error.
error message is ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00104: Warning: element "html" is not declared in the DTD
Error at line 2
If i try to invoke the service after disabling the protection then i am able to call it and getting response. Pls let me know how to deal with this authentication issue.
Below is the invoking code i am using.
BEGIN
generate_envelope(p_request, l_envelope);
show_envelope(l_envelope);
l_http_request := UTL_HTTP.begin_request(p_url, 'POST','HTTP/1.0');
UTL_HTTP.set_header(l_http_request, 'Authorization', 'Basic Y29tcGxpYW5jZS5nZW46Y29tcGxpYW5jZQ11');
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_envelope));
UTL_HTTP.set_header(l_http_request, 'SOAPAction', p_action);
UTL_HTTP.write_text(l_http_request, l_envelope);
l_http_response := UTL_HTTP.get_response(l_http_request);
UTL_HTTP.read_text(l_http_response, l_envelope);
UTL_HTTP.end_response(l_http_response);
l_response.doc := XMLTYPE.createxml(l_envelope); -- Error Line
l_response.envelope_tag := p_request.envelope_tag;
l_response.doc := l_response.doc.extract('/'||l_response.envelope_tag||':Envelope/'||l_response.envelope_tag||':Body/child::node()',
'xmlns:'||l_response.envelope_tag||'="http://schemas.xmlsoap.org/soap/envelope/"');
show_envelope(l_response.doc.getstringval());
check_fault(l_response);
RETURN l_response;
END;
I tried invoking the service by passing username and password in LDE tool and captured the Request SOAP Message. I saw username/password encrypted to "Y29tcGxpYW5jZS5nZW46Y29tcGxpYW5jZQ11". Hence tried with that.
I have also tried the below line for authentication but it is not working.
utl_http.set_authentication(l_http_request, 'myusername', 'mypassword','Basic',false);
Pls assist me in resolving this.
Thanks,
PKV
One more update i tried printing l_http_response.status_code and got 302.
Thanks,
PKV
Similar Messages
-
Invoking a SAP web service from Dreamweaver MX
I am trying to invoke a SAP web service from ColdFusion and it looks like ColdFusion does not even recognize the rfc generated wsdl file as a wsld file. I have tried other wsdl url's outside my company and they work...so I know that web services at least work in ColdFusion. Can anyone advise on this topic?
Thanks!Paula,
I suppose you're using CFINVOKE (http://www.activsoftware.com/code_samples/code.cfm/CodeID/44/ColdFusion/Invoking_SOAP_Web_Services_with_ColdFusion_MX_CFINVOKE_Tag) or are you using a third party tool like CFX_SOAP (http://www.activsoftware.com/products/productdetail.cfm/id/1015)?
Are you working with WebAS 6.4 or 6.2?
It works with web services created with WebAS 6.4, but you should generate proxy classes. Check Thomas' weblog (second part of it)->https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1012. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]
The WSDL generated by this method is more standard than the one generated when you just Remote enable an FM and look at the webservice browser.
Th core of CF MX is Java and that engine is rather strict in standards.
Eddy -
Invoking Web Service From PL SQL package
Below is the sample code to invoke web service from pl/sql package using UTL_HTTP:
Declare
http_req UTL_HTTP.req;
http_resp UTL_HTTP.resp;
Begin
http_req :=
UTL_HTTP.begin_request
'http://'
|| lv_hosturl
-- || '.net/soa-infra/services/finance_rt/Payments/paymentsprocess_client_ep',
--new url
|| '.net/soa-infra/services/finance_rt/PaymentsReq/paymentsprocess_client_ep?WSDL',
'POST',
'HTTP/1.1'
UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
-- since we are dealing with plain text in XML documents
UTL_HTTP.set_header (http_req,
'Content-Length',
LENGTH (lv_soap_request)
UTL_HTTP.set_header (http_req, 'SOAPAction', '');
-- required to specify this is a SOAP communication
UTL_HTTP.write_text (http_req, lv_soap_request);
http_resp := UTL_HTTP.get_response (http_req);
UTL_HTTP.read_text (http_resp, lv_soap_respond);
UTL_HTTP.end_response (http_resp);
resp := XMLTYPE.createxml (lv_soap_respond);
End;Hi,
there are a lot of option to make plsql web services .
First you can stay with jdev 10.1.3
Use the xmldb servlets
use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
thanks Edwin -
How to invoke a Web Service from PL/SQL with Complex Type as input.
Hello,
I am trying to invoke a web service from PL/SQL using the UTL_DBWS package.
The web service expects a complex type as input (defined below):
<xs:complexType name="MsgType">
<xs:sequence>
<xs:element name="sender" type="xs:string"/>
<xs:element name="messageId" type="xs:string"/>
<xs:element name="messageType" type="xs:string"/>
<xs:element name="dateSent" type="xs:date"/>
</xs:sequence>
</xs:complexType>
How to construct input to this in PL/SQL Procedure?
Has any body tried this before?
An exmaple will be helpful.
ThanksDear,
I have read your article, it is useful for me. But I cannot Apply to my case. Please kindly help me. Thank you.
When running, the error occurs:
1:39:31 Execution failed: ORA-20000: soapenv:Server.userException - org.xml.sax.SAXParseException: Attribute name "password" associated with an element type "user" must be followed by the ' = ' character.
My webservice Url: http://abc.com.vn:81/axis/ABC_WS_TEST.jws?wsdl
I make PL/SQL (similiar as your example)
FUNCTION INVOKESENDMT
RETURN VARCHAR2
AS
l_request soap_api.t_request;
l_response soap_api.t_response;
l_return VARCHAR2(32767);
l_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_method VARCHAR2(32767);
l_soap_action VARCHAR2(32767);
l_result_name VARCHAR2(32767);
p_zipcode VARCHAR2(160);
BEGIN
--p_zipcode:='''TEST'' ; ''TEST'';''84912187098'';''84912187098'';''0'';''8118'';''1'';''000001'';''ThuNghiem'';''''';
p_zipcode:='TEST';
-- Set proxy details if no direct net connection.
--UTL_HTTP.set_proxy('myproxy:4480', NULL);
--UTL_HTTP.set_persistent_conn_support(TRUE);
-- Set proxy authentication if necessary.
--soap_api.set_proxy_authentication(p_username => 'TEST',
-- p_password => 'TEST');
l_url := 'http://abc.com.vn:81/axis/ABC_WS_TEST.jws';
l_namespace := 'xmlns="' || l_url || '"';
l_method := 'sendMT';
l_soap_action := l_url || '#sendMT';
l_result_name := 'sendMTResponse';
l_request := soap_api.new_request(p_method => l_method,
p_namespace => l_namespace);
soap_api.add_parameter(p_request => l_request,
p_name => 'user password sender receiver chargedflag servicenumber messagetype messageid textcontent binarycontent',
p_type => 'xsd:string',
p_value => p_zipcode);
l_response := soap_api.invoke(p_request => l_request,
p_url => l_url,
p_action => l_soap_action);
l_return := soap_api.get_return_value(p_response => l_response,
p_name => l_result_name,
p_namespace => l_namespace);
RETURN l_return;
END; -
Calling secured web service from Pl SQL
Hi
I am trying to call a secured web service from pl/sql using utl_http.
Is there a sample pl/sql program that i can refer to call a secured web service.
sample soap header that am trying to acheive.
<soap:Header>
<wsa:Action>http://myactaction</wsa:Action>
<wsa:MessageID>uuid:asdfadrewrwqr</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://myact</wsa:To>
<wsse:Security soap:mustUnderstand="1">
<wsse:UsernameToken wsu:Id="SecurityToken-321321">
<wsse:Username>mordfsafsdae</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">werwqrewrwe</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
Thanks a ton in advanceHi,
On way we can call a web service is to pass the Web Service URL to UTL_HTTP package:
Sample Web Service URL
===================
lv_url :=
'http://67.97.189.151:8888/plsqlsample/dbfunc?invoke=placeOrder'
|| '&'
|| 'param0=1'
|| '&'
|| 'param1=1'
|| '&'
|| 'param2=1';
Sample Call using UTL_HTTP
=====================
SELECT UTL_HTTP.request (lv_url)
INTO lv_result
FROM DUAL;
Thank you.
Regards,
Balu -
Creating PL/SQL web services from PL/SQL records
Hello
Jdeveloper does not allow to create web services from pl/sql packages that use PL/SQL records.to do this,we have to use the jpublisher ?without using the jpublisher,if we create a webservice then the following error is displayed in the web service xml output file.
<faultstring>Internal Server Error (Caught exception while handling request: java.rmi.RemoteException: java.sql.SQLException: ORA-06550: line 1, column 49: PLS-00181: unsupported preprocessor directive '$WS_SP_EVEN' )</faultstring>
</env:Fault>
Could any one suggest me, how to solve the above issue..?
Regards
MalathiThank you, with db adapter it was working and also
pl/sql web-services working successfully with object types.If we want to send the web-services to the client, do we need to send the entire folder that is created in the web-services folder of the external oc4j..?
Creating the client process:
we are using the wsdl file that is generated in the web-services and adding to the partner link to Invoke the operations of web-services. Is there any other way to invoke the webservices?Could any one please suggest me?
Thanking you
Malathi -
Error while calling .svc web service from pl/sql using utl_dbws
Hello Folks,
I am calling a .svc web service from pl/sql using utl_dbws and encountering the following error
javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
Can you help me find what am I doing wrong?
Thanks
RkHi,
Here are the details
1. What version?
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
2. What error message ... we need the full and complete error stack not your interpretation of it.
ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Messag
3. "I am calling means what?" We need the full and complete statement showing the values of all parameters.
The input to the web-service is a xmltype containing address information and the web-service returns a string
CREATE OR REPLACE FUNCTION get_id
RETURN VARCHAR2
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.CALL;
l_wsdl_url VARCHAR2 (32767);
l_namespace VARCHAR2 (32767);
l_service_qname UTL_DBWS.qname;
l_port_qname UTL_DBWS.qname;
l_operation_qname UTL_DBWS.qname;
l_xmltype_in SYS.XMLTYPE;
l_xmltype_out SYS.XMLTYPE;
l_return VARCHAR2 (32767);
BEGIN
l_wsdl_url := 'http://test.com/test.svc?wsdl';
l_namespace := 'http://test.org/';
l_service_qname := UTL_DBWS.to_qname (l_namespace, 'SName');
l_port_qname := UTL_DBWS.to_qname (l_namespace, 'BasicHttpBinding_ISName');
l_operation_qname := UTL_DBWS.to_qname (l_namespace, 'Iden');
l_service :=
UTL_DBWS.create_service
(wsdl_document_location => urifactory.geturi
(l_wsdl_url),
service_name => l_service_qname
l_call :=
UTL_DBWS.create_call (service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname
l_xmltype_in :=
SYS.XMLTYPE
('<IdenRequest xmlns:i="http://www.w3.org/XMLSchema-instance" xmlns="http://test.org/SNameIden.WCFService">
<address />
<zip>12345</zip>
<state>AA</state>
<street>W Test </street>
</address>
</IdenRequest>'
l_xmltype_out :=
UTL_DBWS.invoke (call_handle => l_call,
request => l_xmltype_in);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
l_return := l_xmltype_out.EXTRACT ('//Iden/text()').getstringval();
RETURN l_return;
END;
/ -
Calling a Web Service from PL/SQL Procedure
How can you call a web service from a pl/sql package , also is it valid to call a web service from pl/sql according to Fusion Standards..
Hi,
On way we can call a web service is to pass the Web Service URL to UTL_HTTP package:
Sample Web Service URL
===================
lv_url :=
'http://67.97.189.151:8888/plsqlsample/dbfunc?invoke=placeOrder'
|| '&'
|| 'param0=1'
|| '&'
|| 'param1=1'
|| '&'
|| 'param2=1';
Sample Call using UTL_HTTP
=====================
SELECT UTL_HTTP.request (lv_url)
INTO lv_result
FROM DUAL;
Thank you.
Regards,
Balu -
Urgent: Calling web service from PL/SQl fails with XML parsing
Hi,
I am trying to call a web service from PL/SQL (using SOAP protocol and UTL_HTTP built in Package).I am using Oracle 9i .I am calling from pl/sql block invoking web service method created in java.
I am getting the below response object as a SOAP protocol, but i couldn't able to parse the SOAP.
Could you please provide the values of FirstName, LastName and ErrorDescription
declare
request_env varchar2(32767);
v_xml XMLTYPE;
l_user_first_name varchar2(100);
l_user_last_name varchar2(100);
l_error_value varchar2(100);
begin
response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
<axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
<axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
<axis2ns1:ErrorDescription />
</UserInfoObjResponse>
</soapenv:Body>
</soapenv:Envelope>';
dbms_output.put_line('Length of Request:' || length(response_env));
dbms_output.put_line ('Request: ' || response_env);
v_xml := XMLTYPE(response_env);
-- SELECT EXTRACTVALUE(v_xml, '//UserInfoObjResponse/FirstName') INTO l_user_fast_name varchar2(100); FROM DUAL;
dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
dbms_output.put_line ('l_error_value: ' || l_error_value);
end;In Oracle 9i:
SQL> declare
2 response_env varchar2(32767);
3 v_xml XMLTYPE;
4 l_user_first_name varchar2(100);
5 l_user_last_name varchar2(100);
6 l_error_value varchar2(100);
7 begin
8 response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
9 <soapenv:Body>
10 <UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
11 <axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
12 <axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
13 <axis2ns1:ErrorDescription />
14 </UserInfoObjResponse>
15 </soapenv:Body>
16 </soapenv:Envelope>';
17
18 dbms_output.put_line('Length of Request:' || length(response_env));
19 -- dbms_output.put_line ('Request: ' || response_env);
20
21 v_xml := XMLTYPE(response_env);
22
23 select EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:FirstName/text()') first_name,
24 EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:LastName/text()') last_name,
25 EXTRACTVALUE(v_xml,'/*:Envelope/*:Body/*:UserInfoObjResponse/*:ErrorDescription/text()') error_description
26 into l_user_first_name, l_user_last_name, l_error_value
27 from dual;
28
29 dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
30 dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
31 dbms_output.put_line ('l_error_value: ' || l_error_value);
32 end;
33 /
Length of Request:530
l_user_first_name: First Name Output
l_user_last_name : Last Name Output
l_error_value:
PL/SQL procedure successfully completed.In Oracle 10g:
SQL> declare
2 response_env varchar2(32767);
3 v_xml XMLTYPE;
4 l_user_first_name varchar2(100);
5 l_user_last_name varchar2(100);
6 l_error_value varchar2(100);
7 begin
8 response_env:='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
9 <soapenv:Body>
10 <UserInfoObjResponse xmlns:axis2ns1="http://www.test.com/services">
11 <axis2ns1:FirstName >First Name Output</axis2ns1:FirstName>
12 <axis2ns1:LastName>Last Name Output</axis2ns1:LastName>
13 <axis2ns1:ErrorDescription />
14 </UserInfoObjResponse>
15 </soapenv:Body>
16 </soapenv:Envelope>';
17
18 dbms_output.put_line('Length of Request:' || length(response_env));
19 -- dbms_output.put_line ('Request: ' || response_env);
20
21 v_xml := XMLTYPE(response_env);
22
23 select r.*
24 into l_user_first_name, l_user_last_name, l_error_value
25 from XMLTABLE('/' PASSING v_xml
26 COLUMNS
27 first_name varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:FirstName/text()',
28 last_name varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:LastName/text()',
29 error_description varchar2(30) PATH '/*:Envelope/*:Body/*:UserInfoObjResponse/*:ErrorDescrition/text()'
30 ) r;
31
32 dbms_output.put_line ('l_user_first_name: ' || l_user_first_name);
33 dbms_output.put_line ('l_user_last_name : ' || l_user_last_name);
34 dbms_output.put_line ('l_error_value: ' || l_error_value);
35 end;
36 /
Length of Request:530
l_user_first_name: First Name Output
l_user_last_name : Last Name Output
l_error_value:
PL/SQL procedure successfully completed.Max
http://oracleitalia.wordpress.com
Edited by: Massimo Ruocchio on Feb 14, 2010 11:55 PM
Added the first one. -
Access a web service from pl/sql
I am trying to access a web service from pl/sql. I have downloaded the code from
http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
But when I try to execute the sql, I am getting the following error:
SQL> @local.sql
Package created.
Package body created.
No errors.
BEGIN dbms_output.put_line(time_service.get_local_time('94065')); END;
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-12545: Connect failed because target host or object does not exist
ORA-06512: at "WEB.DEMO_SOAP", line 71
ORA-06512: at "WEB.TIME_SERVICE", line 15
ORA-06512: at line 1
It is failing at:
resp := demo_soap.invoke(req,
'http://www.ripedev.com/webservices/LocalTime.asmx',
'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
But in the examples that I got from downloading source code, site used was:
'http://www.alethea.net/webservices/LocalTime.asmx',
'http://www.alethea.net/webservices/LocalTimeByZipCode');
This site was not accessible. So I changed to the working site as follows, but still I
am getting the above error.
But I can access this site, if I type in the above address in the address bar of IE.
Can any body help?
I have oracle9i client installed on my machine and able to connect to server thru toad and sql plus.
or IF any body refers me to a good website for the topic of "using webservies from pl/sql" that would be great too!Here is the complete code:
time_service:
CREATE OR REPLACE PACKAGE time_service AS
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY time_service AS
-- Location of Web service definition
-- http://www.alethea.net/webservices/LocalTime.asmx?WSDL
-- http://www.ripedev.com/webservices/LocalTime.asmx?WSDL
-- http://www.xmethods.com/sd/2001/CurrencyExchangeService.wsdl
--'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode style=document');
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2 IS
req demo_soap.request;
resp demo_soap.response;
BEGIN
dbms_output.put_line('before new request..');
req := demo_soap.new_request('LocalTimeByZipCode',
'xmlns="http://ripedev.com/xsd/ZipCodeResults.xsd"');
dbms_output.put_line('before add param..');
demo_soap.add_parameter(req, 'ZipCode', 'xsd:string', zipcode);
dbms_output.put_line('before invoke..');
resp := demo_soap.invoke(req,
'http://www.ripedev.com/webservices/LocalTime.asmx',
'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
dbms_output.put_line('before return..');
RETURN demo_soap.get_return_value(resp, 'LocalTimeByZipCodeResult',
'xmlns="http://www.ripedev.com/webservices/"');
END;
BEGIN
dbms_output.put_line('inside main time_service..');
END;
show errors
SET serveroutput ON
exec dbms_output.put_line(time_service.get_local_time('94065'));
Here is demo_soap.sql:
Rem
Rem $Header: soapdemo.sql 21-may-2002.13:48:17 rpang Exp $
Rem
Rem soapdemo.sql
Rem
Rem Copyright (c) 2002, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem soapdemo.sql - <one-line expansion of the name>
Rem
Rem DESCRIPTION
Rem A PL/SQL demo package for making SOAP RPC calls.
Rem
Rem NOTES
Rem This demo package can only be used in oracle 9ir2. It utilizes 9iR2's
Rem XDB (XMLType and HttpUriType) and 9iR1's enhancements to UTL_HTTP to
Rem make SOAP RPC calls.
Rem
Rem MODIFIED (MM/DD/YY)
Rem rpang 05/21/02 - created
Rem
Rem A PL/SQL demo package that makes a SOAP RPC calls.
Rem
CREATE OR REPLACE PACKAGE demo_soap AS
/* A type to represent a SOAP RPC request */
TYPE request IS RECORD (
method VARCHAR2(256),
namespace VARCHAR2(256),
body VARCHAR2(32767));
/* A type to represent a SOAP RPC response */
TYPE response IS RECORD (
doc xmltype);
* Create a new SOAP RPC request.
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request;
* Add a simple parameter to the SOAP RPC request.
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2);
* Make the SOAP RPC call.
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response;
* Retrieve the sipmle return value of the SOAP RPC call.
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2;
END;
show errors
CREATE OR REPLACE PACKAGE BODY demo_soap AS
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request AS
req request;
BEGIN
req.method := method;
req.namespace := namespace;
RETURN req;
END;
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2) AS
BEGIN
req.body := req.body ||
'<'||name||' xsi:type="'||type||'">'||value||'</'||name||'>';
END;
PROCEDURE generate_envelope(req IN OUT NOCOPY request,
env IN OUT NOCOPY VARCHAR2) AS
BEGIN
env := '<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body><'||req.method||' '||req.namespace||'
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
req.body||'</'||req.method||'></SOAP-ENV:Body></SOAP-ENV:Envelope>';
END;
PROCEDURE show_envelope(env IN VARCHAR2) AS
i pls_integer;
len pls_integer;
BEGIN
i := 1; len := length(env);
WHILE (i <= len) LOOP
dbms_output.put_line(substr(env, i, 60));
i := i + 60;
END LOOP;
END;
PROCEDURE check_fault(resp IN OUT NOCOPY response) AS
fault_node xmltype;
fault_code VARCHAR2(256);
fault_string VARCHAR2(32767);
BEGIN
fault_node := resp.doc.extract('/soap:Fault',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
IF (fault_node IS NOT NULL) THEN
fault_code := fault_node.extract('/soap:Fault/faultcode/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
fault_string := fault_node.extract('/soap:Fault/faultstring/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
raise_application_error(-20000, fault_code || ' - ' || fault_string);
END IF;
END;
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response AS
env VARCHAR2(32767);
http_req utl_http.req;
http_resp utl_http.resp;
resp response;
BEGIN
generate_envelope(req, env);
-- show_envelope(env);
http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(env));
utl_http.set_header(http_req, 'SOAPAction', action);
utl_http.write_text(http_req, env);
http_resp := utl_http.get_response(http_req);
utl_http.read_text(http_resp, env);
utl_http.end_response(http_resp);
resp.doc := xmltype.createxml(env);
resp.doc := resp.doc.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
-- show_envelope(resp.doc.getstringval());
check_fault(resp);
RETURN resp;
END;
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2 AS
BEGIN
RETURN resp.doc.extract('//'||name||'/child::text()',
namespace).getstringval();
END;
END;
show errors -
Calling Web Service from PL/SQL (ORA-31011: XML parsing failed)
hi all,
i want to invoke a web service from PL/SQL.
i found a soap_api package from "Tim Hall".
but it gives error in "ealtas.soap_api.invoke function"
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00007: unexpected end-of-file encountered
ORA-06512: at "SYS.XMLTYPE", line 48
ORA-06512: at "EALTAS.SOAP_API", line 135
ORA-06512: at line 44
set scan off;
declare
P_ADRES_WS VARCHAR2(100) := 'http://<host>:<port>/dswsbobje/qaawsservices/biws?wsdl=1&cuid=AVhBxL14I2dDjz8yFoznRLY';
P_ENVELOPE VARCHAR2(32767);
P_FNC VARCHAR2(256) := 'runQueryAsAService';
ol_req ealtas.soap_api.t_request;
ol_resp ealtas.soap_api.t_response;
message varchar2(500);
BEGIN
p_envelope := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:db="DB_SUBS_BUDGET">
<soapenv:Body>
<db:runQueryAsAService>
<db:login>DWH_BO</db:login>
<db:password>Pass1234</db:password>
</db:runQueryAsAService>
</soapenv:Body>
</soapenv:Envelope>
ol_req := ealtas.soap_api.new_request(P_FNC, 'xmlns="'||P_ADRES_WS||'"');
ol_resp := ealtas.soap_api.invoke(ol_req, P_ADRES_WS, p_fnc,P_ENVELOPE);
ealtas.soap_api.show_envelope(p_envelope);
message := ealtas.soap_api.get_return_value(ol_resp, 'Db_Timeid', 'xmlns:m="'||P_ADRES_WS||'"');
DBMS_OUTPUT.PUT_LINE('AAAA -'||message);
end;
thanks.
ealtas.AlexAnd thanks for your help.
ACL is ok.
can you help me about how can i edit this function. i tried many times but i could not do it :( .
web service url : <host>:<port>/dswsbobje/qaawsservices/biws?WSDL=1&cuid=AVhBxL14I2dDjz8yFoznRLY
what must be these variables values ?
l_url :=
l_namespace :=
l_method :=
l_soap_action :=
l_result_name :=
this is the xml;
<?xml version="1.0" encoding="UTF-8" ?>
- <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="DB_SUBS_BUDGET" xmlns:tns1="dsws.businessobjects.com" targetNamespace="DB_SUBS_BUDGET" xmlns="http://schemas.xmlsoap.org/wsdl/" name="queryasaservice">
- <types>
- <s:schema elementFormDefault="qualified" targetNamespace="DB_SUBS_BUDGET">
- <s:element name="runQueryAsAService">
- <s:complexType>
- <s:sequence>
<s:element name="login" type="s:string" />
<s:element name="password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:complexType name="Row">
- <s:sequence>
<s:element name="Db_Timeid" type="s:string" nillable="true" />
<s:element name="Db_Tariff" type="s:string" nillable="true" />
<s:element name="Grossadds" type="s:double" nillable="true" />
<s:element name="Cancellations" type="s:double" nillable="true" />
<s:element name="Netadds" type="s:double" nillable="true" />
<s:element name="Subs" type="s:double" nillable="true" />
<s:element name="Churn_P" type="s:double" nillable="true" />
</s:sequence>
</s:complexType>
- <s:complexType name="Table">
- <s:sequence>
<s:element name="row" maxOccurs="unbounded" type="s0:Row" />
</s:sequence>
</s:complexType>
- <s:element name="runQueryAsAServiceResponse">
- <s:complexType>
- <s:sequence>
<s:element name="table" type="s0:Table" />
<s:element name="message" type="s:string" />
<s:element name="creatorname" type="s:string" />
<s:element name="creationdate" type="s:dateTime" />
<s:element name="creationdateformated" type="s:string" />
<s:element name="description" type="s:string" />
<s:element name="universe" type="s:string" />
<s:element name="queryruntime" type="s:int" />
<s:element name="fetchedrows" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="QaaWSHeader">
- <s:complexType>
- <s:sequence>
<s:element name="sessionID" type="s:string" minOccurs="0" maxOccurs="1" nillable="true" />
<s:element name="serializedSession" type="s:string" minOccurs="0" maxOccurs="1" nillable="true" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
- <message name="runQueryAsAServiceSoapIn">
<part name="parameters" element="s0:runQueryAsAService" />
<part name="request_header" element="s0:QaaWSHeader" />
</message>
- <message name="runQueryAsAServiceSoapOut">
<part name="parameters" element="s0:runQueryAsAServiceResponse" />
</message>
- <portType name="QueryAsAServiceSoap">
- <operation name="runQueryAsAService">
<documentation>Get Web Service Provider server info</documentation>
<input message="s0:runQueryAsAServiceSoapIn" />
<output message="s0:runQueryAsAServiceSoapOut" />
</operation>
</portType>
- <binding name="QueryAsAServiceSoap" type="s0:QueryAsAServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
- <operation name="runQueryAsAService">
<soap:operation soapAction="DB_SUBS_BUDGET/runQueryAsAService" style="document" />
- <input>
- <soap:header message="s0:runQueryAsAServiceSoapIn" part="request_header" use="literal">
<soap:headerfault message="s0:runQueryAsAServiceSoapIn" part="request_header" use="literal" />
</soap:header>
<soap:body use="literal" parts="parameters" />
</input>
- <output>
<soap:body use="literal" />
</output>
</operation>
</binding>
- <service name="DB_SUBS_BUDGET">
<documentation />
- <port name="QueryAsAServiceSoap" binding="s0:QueryAsAServiceSoap">
<soap:address location="http://<host>:<port>/dswsbobje/qaawsservices/queryasaservice?&cuid=AVhBxL14I2dDjz8yFoznRLY&authType=secEnterprise&locale=en_US&timeout=60&ConvertAnyType=false" />
</port>
</service>
</definitions> -
SR: Calling Web Services from PL/SQL gives http 500 errors
Hi, people from Oracle Support sent me to this forum.
I'm trying to call the Calendar Web Services from PL/SQL using the utl_http package, but I'm getting http-500 errors.
I'm using the example from http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
Here's the code
procedure showHtml
as
req soap_rpc.request;
resp soap_rpc.response;
BEGIN
req := soap_rpc.new_request('cwsl:NoOp',
'xmlns:cwsl="http://www.oracle.com/WebServices/Calendaring/1.0/"');
resp := soap_rpc.invoke(req,
'http://nllx004.nl.oracle.com/ocws-bin/ocas.fcgi',
dbms_output.put_line(resp.doc.getStringVal());
END;
Can anyone help?I am new to web services and am having trouble getting the utl_http.set_header call to work using pl/sql. listed below is the code.
CREATE OR REPLACE PACKAGE BODY adm_iModules_test
AS
NAME: Admissions iModules testing program
PURPOSE:
Ver Date Author Description
REVISIONS:
1.0 01/04/08 Julie Michael 1. Created this package body.
PROCEDURE adm_iModules_test_output
IS
--cursor to select data to populate output file
CURSOR c_iModules_main
IS
SELECT DISTINCT spriden_id sprid_id,
spriden_pidm sprid_pidm,
spriden_last_name sprid_last,
spriden_first_name sprid_first,
spriden_MI sprid_mid,
spriden_create_date sprid_create_date,
spriden_activity_date sprid_activity_date,
spbpers_pidm pers_pidm,
spbpers_name_prefix prefix,
spbpers_name_suffix suffix,
spbpers_dead_ind deceased_ind,
spbpers_dead_date deceased_date,
spbpers_birth_date, --added birth date
spbpers_sex, --added gender
goremal_pidm emal_pidm,
goremal_email_address email_address,
saradap_pidm app_pidm,
zzrimod_member_id imod_id,
gobtpac_external_user user_id
FROM spriden,
spbpers,
goremal,
saradap,
zzrimod,
gobtpac
WHERE spriden_pidm = spbpers_pidm
AND spriden_change_ind IS NULL
AND spriden_pidm = goremal_pidm
AND goremal_emal_code = 'PERS'
AND goremal_preferred_ind = 'Y'
AND spriden_pidm = saradap_pidm
AND spriden_pidm = 120116
AND spriden_pidm = gobtpac_pidm
AND spriden_pidm = zzrimod_pidm(+)
AND goremal_preferred_ind = 'Y'
AND saradap_term_code_entry in ('200810','200820','200830');
v_record VARCHAR2 (32000) := null;
v_record_counter NUMBER := 0;
f_iModules_output_test UTL_FILE.file_type;
f_iModules_filename_test VARCHAR2 (50) := 'Adm_iModules_Test.TXT';
f_iModules_dir_test VARCHAR2 (100) := 'TMP';
v_separator VARCHAR2 (50) := ',';
v_id VARCHAR2 (90) := '';
v_fname VARCHAR2 (40) := '';
v_lname VARCHAR2 (40) := '';
v_user VARCHAR2 (90) := '';
v_login VARCHAR2 (100) := '';
v_password VARCHAR2 (100) := '';
-- v_link VARCHAR2 (32767) := 'http://imodules.com/Web%20Services/';
--the below item 'http://admin.imodules.com - was https://admin.imodules.com
v_link VARCHAR2 (32767) := 'http://admin.imodules.com/ws_10/MemberQuery.asmx?WSDL';
v_non_existing_ids VARCHAR2 (100) := '"false"';
v_style VARCHAR2 (5) := '"1"';
v_imod_member_id VARCHAR2 (100) := '';
v_spriden_first_name VARCHAR2 (60) := '';
req Utl_Http.req; --for posting
resp Utl_Http.resp; --for posting
v_msg VARCHAR2(80); --for posting
H_Name VARCHAR2(255); --for posting
H_Value VARCHAR2(1023); --for posting
v_data_xml VARCHAR2(10000);
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
f_iModules_output_test := UTL_FILE.fopen (f_iModules_dir_test, f_iModules_filename_test, 'w',32767);
v_record := '';
--needed for posting
-- Utl_http.set_proxy(proxy => 'xxx.yyy.com',
-- no_proxy_domains => 'xxx.com');
req := Utl_Http.begin_request(url => v_link,
method => 'POST');
-- FOR v_iModules2 IN c_iModules_main
-- LOOP
-- v_record_counter := v_record_counter + 1;
-- END LOOP;
-- v_record := 'DUQ'||','||v_record_counter||','||to_char(SYSDATE,'mm/dd/yyyy');
UTL_FILE.put_line (f_iModules_output_test, v_record, false);
v_record := null;
FOR v_iModules IN c_iModules_main
LOOP
v_id := v_imodules.sprid_id;
v_fname := v_imodules.sprid_first||'test';
v_lname := v_imodules.sprid_last;
v_user := '"'||v_imodules.email_address||'"';
v_imodules.imod_id := '29';
v_imod_member_id := '"'||v_imodules.imod_id||'"';
v_spriden_first_name := '"SPRIDEN_FIRST_NAME"';
v_login := '"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"';
v_password := '"xxxxxxxxxxxxxxxxxxxxxxxx"';
v_record :='<?xml version="1.0" encoding="utf-8"?>'||
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'||' '||
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'||
'<soap:Body>'||'<Update xmlns:m='||v_link||'>'||'<AUTHENTICATION login='||v_login||' '||
'password='||v_password||' '||'addNonExistingIDs='||v_non_existing_ids||' '||'style='||
v_style||'/>'||'<MemberInformation ZZRIMOD_MEMBER_ID='||v_imod_member_id||'>'||
'<SPRIDEN_FIRST_NAME>'||v_fname||'</SPRIDEN_FIRST_NAME>'||'</MemberInformation>'||'</Update>'||
'</soap:Body></soap:Envelope>';
-- v_record := v_record := v_record||'<Update xmlns:m='||v_link||'>'||'<AUTHENTICATION login='||v_user||'>'||' '||
-- 'password='||v_password||' '||'addNonExistingIDs='||v_non_existing_ids||' '||'style='||
-- v_style||'/>'||'<MemberInformation ZZRIMOD_MEMBER_ID='||v_imod_member_id||' '||
-- 'column='||'"SPRIDEN_FIRST_NAME"'||' '||'newValue='||v_fname||'/>'||'</Update>';
dbms_output.put_line('code: '||v_record);
--v_record := v_record||v_separator||v_id||v_separator||v_name||v_separator||v_email;
--Http posting calls
Utl_Http.set_header(r => req,
name => 'Content-Type',
value => 'text/xml');
Utl_Http.set_header(r => req,
name => 'Content-Length',
value => to_char(length(v_record)) );
--JAM 03/25/08 - added to accomodate the missing soap action error
Utl_Http.set_header(r => req,
name => 'SOAPAction',
value => 'http://admin.imodules.com/ws_10/MemberQuery.asmx?WSDL');
Utl_Http.set_header(r => req,
name => 'MessageType',
value => 'CALL');
-- Utl_Http.set_authentication(r => req,
-- username => 'zzz',
-- password => 'ppppp',
-- scheme => 'Basic',
-- for_proxy => FALSE);
Utl_Http.write_text(r => req,
data => v_record);
resp := Utl_Http.get_response(r => req,
return_info_response => TRUE);
DBMS_OUTPUT.put_line('Status Code: ' || resp.status_code);
DBMS_OUTPUT.put_line('Reason Phrase: ' || resp.reason_phrase);
dbms_output.put_line('testing');
FOR i IN 1 .. Utl_Http.get_header_count(r => resp)
LOOP
Utl_Http.get_header(r => resp,
n => i,
name => H_Name,
value => H_Value);
--DBMS_OUTPUT.put_line( ... );
END LOOP;
BEGIN
LOOP
Utl_Http.read_text(r => resp, DATA => v_msg);
DBMS_OUTPUT.put_line(v_msg);
END LOOP;
EXCEPTION
WHEN Utl_Http.end_of_body THEN
NULL;
END;
Utl_Http.end_response(r => resp);
-- EXCEPTION
-- WHEN Utl_Http.request_failed THEN
-- DBMS_OUTPUT.put_line('Request failed: '||Utl_Http.Get_Detailed_Sqlerrm);
-- WHEN Utl_Http.http_server_error THEN
-- DBMS_OUTPUT.put_line('Http_Server_Error: '||Utl_Http.Get_Detailed_Sqlerrm);
-- WHEN Utl_Http.http_client_error THEN
-- DBMS_OUTPUT.put_line('Client Error: '||Utl_Http.Get_Detailed_Sqlerrm);
-- WHEN others THEN
-- DBMS_OUTPUT.put_line('Others2: '||Utl_Http.Get_Detailed_Sqlerrm);
-- Utl_Http.end_response(r => resp);
-- END;
--End of Htp posting calls
--UTL_FILE.put_line (f_iModules_output_test, v_record, false);
--htp.p('<post>'||v_record||'</post>');
END LOOP;
EXCEPTION
WHEN Utl_Http.request_failed THEN
DBMS_OUTPUT.put_line('Request failed: '||Utl_Http.Get_Detailed_Sqlerrm);
WHEN Utl_Http.http_server_error THEN
DBMS_OUTPUT.put_line('Http_Server_Error: '||Utl_Http.Get_Detailed_Sqlerrm);
WHEN Utl_Http.http_client_error THEN
DBMS_OUTPUT.put_line('Client Error: '||Utl_Http.Get_Detailed_Sqlerrm);
WHEN others THEN
DBMS_OUTPUT.put_line('Others2: '||Utl_Http.Get_Detailed_Sqlerrm);
Utl_Http.end_response(r => resp);
END;
-- close output file
--UTL_FILE.fclose (f_iModules_output_test);
--COMMIT;
/*EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
DBMS_OUTPUT.put_line ('Other Exception:' || SQLERRM);
-- DBMS_OUTPUT.put_line ('Other Exception:' || Utl_Http.Get_Detailed_Sqlerrm);
--COMMIT; */
-- END adm_iModules_test_output;
END adm_iModules_test;
Message was edited by:
user627523 -
Calling web services from PL/SQL
Hi,
We have a requirement where we need to call a web services from PL/SQL.
I believe we have a PL/SQL API that allows you to consume external web services.
I was looking for other possible options too to consume web Service from PL/SQL.
Can any one suggest the other possible options , and which option is best to consume web service.
Thanks
ABAB,
I didn't realize you cannot attach documents to your post. You will have to provide me with an email address that I can send the documents to. They are a little rough (ie not commented etc) but they do illustrate the point. The basic idea is to build up the payload of the soap envelope using pl/sql. Meaning as I loop through the cursor I use each record in the cursor to build an xml string. This string of xml becomes the payload of the soap message. This could also be done using xml functionality provided by the db meaning xmlelement, xmlforest etc. The issue I ran into was the size of the message. That is why I elected to build the xml message by string concatenation as I moved through the cursor.
Ryan -
New to Web Services - need to call a HTTPS web service from PL/SQL
I am new to Web Services and need to call HTTPS web service from PL/SQL program. I am using 10g Database.
I have been reading there are 2 options -
1. UTL_HTTP - with this package its possible to call HTTPS web services
2. UTL_DBWS
Questions -
1. Is it possible to call a HTTPS web service using UTL_DBWS ? I have not been able to find any information on it.
2. Can someone point me to UTL_HTTP and UTL_DBWS examples calling a HTTPS web service ?
3. The HTTPS web service that I need to call needs username/password to connect - how will I incorporate this in the pl/sql code ?
Appreciate the help.
Cheers,
newWebServicesUserHi,
1. UTL_DBWS not work for https from what I understand
2. Here is a sample example:
[http://www.oracle-base.com/articles/9i/ConsumingWebServices9i.php#]
Be careful, you must change http/1.0 IN 1.1 inside package SOAP_API.
Here is an example for a prime number where the SOAP message is already construct:
CREATE OR REPLACE procedure test_ws_2
IS
http_req utl_http.req;
http_resp utl_http.resp;
request_env varchar2(32767);
response_env varchar2(32767);
begin
-- Set proxy details if no direct net connection.
UTL_HTTP.set_proxy('http://<USER>:<PASS>@10.0.2.21:8070', NULL);
UTL_HTTP.set_persistent_conn_support(TRUE);
request_env:='<?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/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">'||
'<SOAP-ENV:Body><GetPrimeNumbers xmlns="http://microsoft.com/webservices/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
'<max xsi:type="xsd:int">10</max>'||
'</GetPrimeNumbers></SOAP-ENV:Body></SOAP-ENV:Envelope>';
dbms_output.put_line('Length of Request:' || length(request_env));
dbms_output.put_line ('Request: ' || request_env);
http_req := utl_http.begin_request('http://www50.brinkster.com/vbfacileinpt/np.asmx','POST', utl_http.HTTP_VERSION_1_1);
utl_http.set_header(http_req, 'Content-Type', 'text/xml; charset=utf-8');
utl_http.set_header(http_req, 'Content-Length', length(request_env));
utl_http.set_header(http_req, 'SOAPAction', '"http://microsoft.com/webservices/GetPrimeNumbers"');
utl_http.write_text(http_req, request_env);
dbms_output.put_line('');
http_resp := utl_http.get_response(http_req);
dbms_output.put_line('Response Received');
dbms_output.put_line('--------------------------');
dbms_output.put_line ( 'Status code: ' || http_resp.status_code );
dbms_output.put_line ( 'Reason phrase: ' || http_resp.reason_phrase );
utl_http.read_text(http_resp, response_env);
dbms_output.put_line('Response: ');
dbms_output.put_line(response_env);
utl_http.end_response(http_resp);
end test_ws_2;
Otherwice for testing url, i recommand you to use that function: Re: Error using UTL_HTTP over HTTPS
it's a verry helpful function when you have an error.
wrote:
When testing using UTL_HTTP, you MUST ensure that you open a new session after importing the SSL certificates into your Wallet,
as I've learned (the hard way) that existing sessions point to the wallet contents that were present when the session was opened.
If you don't realise/know this, it can cause a lot of additional frustration during testing, when you keep getting the ORA-29024 exception AFTER
you've imported the SSL certificates................. ;) 3. i think you can use that after the begin_request but not sure :
UTL_HTTP.set_authentication(r => http_req,
username => ,
password => ,
scheme => ,
for_proxy => );
Edited by: Malebodja on Oct 22, 2009 6:53 AM
Edited by: Malebodja on Oct 22, 2009 6:55 AM -
Support for Creating Web Service from pl/sql package in JDeveloper 11
We have been creating all of our web services from pl/sql packages in our Oracle database using JDeveloper 10.1.3.1. I understand that this capability is not supported in Jdev 11. We have been mandated to either move up to JDeveloper 11, or consider switching to eclipse, or even VS2008 and run .NET services from IIS. I have seen work-around solutions using TopLink and Jdev 11. Are there plans to revive this feature in the near future? We're now looking at switching to .NET since we could scrap our OAS instances and use IIS to publish web services. The only reason we were sticking with Oracle was the ease in converting all our existing package to web services with Jdev.
Is anyone else in the same situation. If so, what solutions are you considering?Hi,
there are a lot of option to make plsql web services .
First you can stay with jdev 10.1.3
Use the xmldb servlets
use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
thanks Edwin
Maybe you are looking for
-
Budget Exceeded but no Error message Assign more than allocated
Hi Gurus, I am stuck in a situation where the Error Message BP603 while creating a PO for a wbs at level 2. IN cj30 , i found out that Budget = 69500000 and assigned = 69950772 if i create a PO OF even .30 (thirty paisa) the budget exceeded amount =
-
Should I boot from external hard disk and how do I achieve this?
I'm in a downward spiral and need advice about if booting off of an external hard disc is the right thing to do and how to go about it. How I got into this mess I'll write below. My immediate problem is that I want to be able to install a copy of osx
-
Main centre button only working intermittently
Several times a day now I will have to turn my iphone 4 off,& then turn it back on to be able to access a different function. It used to only do it occasionally...now it is locked in this manner for hours at a time. Any suggestions???
-
AR Form is not opening........
I instaled Mult-org set Up but while setting up of Receivables we find an error for opening a thre form of Payments term and all the other form of Receipts the error is showing that "FRM-40735:PRE-Form trigger-raised unhandled exception NO_DATA_FOUND
-
I have a question that I wonder if anybody has encountered before and can help me with. Is there any way to have full length region after your region has been set up? To be precise, I need to have a 'footer' region in my page. Yet my page already loo