Fault while calling service from pl sql
Hi,
I am using utl_http to call a web service. The service is returning the following fault. Can anyone help me with the resolution for the following? Any sample pl/sql would be a boon.
<faultcode>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please t
ry later ---> System.Configuration.ConfigurationException: WSE535: The following SecurityToken QName is unsupported: http://docs.oasis-open.org/wss
/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Username. Please check your configuration for registered SecurityToken qnames.
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.LoadXmlSecurityToken(XmlElement element)
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.GetTokenFromXml(XmlElement element)
at Microsoft.Web.Services2.Security.Security.LoadToken(XmlElement element, SecurityConfiguration configuration, Int32& tokenCount)
at Microsoft.Web.Services2.Security.Security.LoadXml(XmlElement element)
at Microsoft.Web.Services2.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
--- End of inner exception stack trace ---</faultstring>
Hi,
I am using utl_http to call a web service. The service is returning the following fault. Can anyone help me with the resolution for the following? Any sample pl/sql would be a boon.
<faultcode>soap:Server</faultcode><faultstring>System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please t
ry later ---> System.Configuration.ConfigurationException: WSE535: The following SecurityToken QName is unsupported: http://docs.oasis-open.org/wss
/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Username. Please check your configuration for registered SecurityToken qnames.
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.LoadXmlSecurityToken(XmlElement element)
at Microsoft.Web.Services2.Security.Tokens.SecurityTokenManager.GetTokenFromXml(XmlElement element)
at Microsoft.Web.Services2.Security.Security.LoadToken(XmlElement element, SecurityConfiguration configuration, Int32& tokenCount)
at Microsoft.Web.Services2.Security.Security.LoadXml(XmlElement element)
at Microsoft.Web.Services2.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
--- End of inner exception stack trace ---</faultstring>
Similar Messages
-
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 BI Publisher Web Service from pl/sql
I am trying to call the BI publisher web service from pl/sql.
I get the following response back
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">my-obiee</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The bit that concerns me is
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
The code that I used to call this is
DECLARE
req utl_http.req;
resp utl_http.resp;
value VARCHAR2(1024);
p_data_type varchar2(4000):= 'application/soap+xml;';
p_data_in VARCHAR2(3000) :=
'<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soapenv:Body>
<pub:scheduleReport xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<scheduleRequest>
<deliveryRequest>
<ftpOption>
<ftpServerName>ino-ed-oel2.inoapps.com</ftpServerName>
<ftpUserName>*******</ftpUserName>
<ftpUserPassword>*****</ftpUserPassword>
<remoteFile>/opt/UAT/db/tech_st/11.1.0/employees.pdf</remoteFile>
</ftpOption>
</deliveryRequest>
<reportRequest>
<attributeFormat>pdf</attributeFormat>
<reportAbsolutePath>http://10.100.100.44:9704/xmlpserver/~administrator/XXXXXXX.xdo</reportAbsolutePath>
<parameterNameValues>
<item>
<name>dname</name>
<multiValuesAllowed>false</multiValuesAllowed>
<values>
<item>153002</item>
</values>
</item>
</parameterNameValues>
</reportRequest>
<userJobName>BILL</userJobName>
</scheduleRequest>
<userID>******</userID>
<password>******</password>
</pub:scheduleReport>
</soapenv:Body>
</soapenv:Envelope>';
BEGIN
--utl_http.set_proxy('proxy.my-company.com', 'corp.my-company.com');
req := utl_http.begin_request('http://10.100.100.44:9704/xmlpserver/services/PublicReportService?wsdl', 'POST');
utl_http.set_header(req, 'content-type', p_data_type);
utl_http.set_header(req, 'content-length', length(p_data_in));
utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0');
utl_http.write_text(req, p_data_in);
resp := utl_http.get_response(req);
dbms_output.put_line ('status code: ' || resp .status_code);
dbms_output.put_line ('reason phrase: ' || resp .reason_phrase);
LOOP
utl_http.read_line(resp, value, TRUE);
dbms_output.put_line(value);
END LOOP;
utl_http.end_response(resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
END;
Any help would be greatly receivedI had the same problem this morning. You need to add a line to the HTTP header to declare a value for SOAPAction.
You can set this as an empty string, but for some reason it is required.
Try adding this among your header declarations:
utl_http.set_header(req, 'SOAPAction', ''); -
Fault while calling a Web service using SOAP 1.2
Hi ,
I have created a simple PL/SQL web service using Jdeveloper from PL/SQL using SOAP 1.2.
But while i call that from PL/SQL, i am getting a version mismatch.
While the same service created from SOAP 1.1 is working fine.
Can anyone Help???Yip - Acrobat or Reader Extensions are needed.
Try right click on the PDF and open in Internet Explorer and try your submit (hopefully the domain is trusted) -
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 -
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. -
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 -
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 -
How to call web services from PL/SQL?
Hi,
Can one help in how to call web services from PL/SQL? Steps, pros and cons, etc....
Thanks in advanceHere's some example skeleton code to get you started...
PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
soap_request VARCHAR2(30000);
soap_respond CLOB;
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
soap_err exception;
v_code VARCHAR2(200);
v_msg VARCHAR2(1800);
v_len number;
v_txt Varchar2(32767);
BEGIN
UTL_HTTP.SET_PROXY(p_proxy);
-- Define the SOAP request according the the definition of the web service being called
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
' <SOAP-ENV:Body>'||
' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
' <m:UserName>'||p_username||'</m:UserName>'||
' <m:Password>'||p_password||'</m:Password>'||
' </m:DownloadRequest>'||
' </SOAP-ENV:Body>'||
'</SOAP-ENV:Envelope>';
http_req:= utl_http.begin_request
( 'http://www.website.net/webservices/GetDetailsService.asmx'
, 'POST'
, 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
LOOP
utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
soap_respond := soap_respond || v_txt; -- build up CLOB
END LOOP;
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
END;Using secure web services (https)...
Web serivces call in Plsql
As for 'pros and cons'... there's nothing to compare against... either you want to call a web service or you don't. -
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> -
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 -
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 -
Exception while calling stored procedure in SQL server
Hi,
I run into a problem while calling a proc in SQL server. I am using a database control to do so. The proc returns a integer. This is the first time I use SQL server. Any thoughts? Thanks in advance.
My method call is:
int createAccount(SQLParameter[] param)
The sql is:
{call espsiCompany(?, ?, ?)}
The error is:
java.lang.NullPointerException
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.getStatement_v2(DatabaseControlImpl.jcs:1885)
at com.bea.wlw.runtime.core.control.DatabaseControlImpl.invoke(DatabaseControlImpl.jcs:2691)
at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:373)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:423)
at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:396)
at com.bea.wlw.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:388)
at services.OnyxDBControl.createAccount(OnyxDBControl.ctrl)
at services.OnyxDBControlTest.createAccount(OnyxDBControlTest.jws:18)Hi. That's not the signature of the procedure. What I'd like to see is
the SQL used to create the procedure, eg:
create procedure myProc @foo int, @bar varchar(30) ....
as
begin
end
Jun Li wrote:
Here you go. Thanks for your time.
DECLARE @RC int
DECLARE @iSiteId int
DECLARE @iCompanyId int
DECLARE @chLanguageCode char(4)
DECLARE @vchAssignedId varchar(255)
DECLARE @vchCompanyName varchar(255)
DECLARE @vchAddress1 varchar(255)
DECLARE @vchAddress2 varchar(255)
DECLARE @vchAddress3 varchar(255)
DECLARE @vchCity varchar(255)
DECLARE @chRegionCode char(4)
DECLARE @chCountryCode char(4)
DECLARE @vchPostCode varchar(40)
DECLARE @vchPhoneNumber varchar(40)
DECLARE @vchEmailAddress varchar(255)
DECLARE @vchURL varchar(255)
DECLARE @iCompanyTypeCode int
DECLARE @iCompanySubTypeCode int
DECLARE @iFamilyId int
DECLARE @iParentId int
DECLARE @iPrimaryContactId int
DECLARE @vchContactFirstName varchar(255)
DECLARE @vchContactLastName varchar(255)
DECLARE @iDivisionCode int
DECLARE @iSICCode int
DECLARE @iMarketSector int
DECLARE @vchTaxId varchar(255)
DECLARE @vchDunnsNumber varchar(255)
DECLARE @iPhoneTypeId int
DECLARE @iAddressTypeId int
DECLARE @iSourceId int
DECLARE @iStatusId int
DECLARE @bValidAddress tinyint
DECLARE @iAccessCode int
DECLARE @bPrivate tinyint
DECLARE @vchUser1 varchar(255)
DECLARE @vchUser2 varchar(255)
DECLARE @vchUser3 varchar(255)
DECLARE @vchUser4 varchar(255)
DECLARE @vchUser5 varchar(255)
DECLARE @vchUser6 varchar(255)
DECLARE @vchUser7 varchar(255)
DECLARE @vchUser8 varchar(255)
DECLARE @vchUser9 varchar(255)
DECLARE @vchUser10 varchar(255)
DECLARE @chInsertBy char(10)
DECLARE @dtInsertDate datetime
DECLARE @tiLockRecord tinyint
DECLARE @tiRecordStatus tinyint
DECLARE @tireturnType tinyint
-- Set parameter values
EXEC @RC = [ONYXPROD].[dbo].[espsiCompany] @iSiteId, @iCompanyId OUTPUT , @chLanguageCode, @vchAssignedId, @vchCompanyName, @vchAddress1, @vchAddress2, @vchAddress3, @vchCity, @chRegionCode, @chCountryCode, @vchPostCode, @vchPhoneNumber, @vchEmailAddress, @vchURL, @iCompanyTypeCode, @iCompanySubTypeCode, @iFamilyId, @iParentId, @iPrimaryContactId, @vchContactFirstName, @vchContactLastName, @iDivisionCode, @iSICCode, @iMarketSector, @vchTaxId, @vchDunnsNumber, @iPhoneTypeId, @iAddressTypeId, @iSourceId, @iStatusId, @bValidAddress, @iAccessCode, @bPrivate, @vchUser1, @vchUser2, @vchUser3, @vchUser4, @vchUser5, @vchUser6, @vchUser7, @vchUser8, @vchUser9, @vchUser10, @chInsertBy, @dtInsertDate, @tiLockRecord, @tiRecordStatus, @tireturnType
Maybe you are looking for
-
so i just changed my computer from an old Dell to a Macbook White but unfortunately my iPod seems unable to make the switch. it never is recognized (not even as a random USB device) by my new computer and i can't get it to appear in iTunes. yet, clea
-
Ipod in washer....
After my 4g ipod went through the washing machine I did not plug it in or charge it I opened her up and let her dry (waranty over by 1 year) I left it open for about 2 days, put it back together and it worked. It now functions perfect other than when
-
LiveCycle: Change PDF Attachment name
I have been able to customize the subject name and body of the email as well as create specific groups that the email needs to go through, but can not figure out how to change the file name to the attachement. Currently its just a bunch of numbers a
-
Data Source configuration for ADF BC application
Hi, I am working on a POC using ADF BC. I want to configure a data source in weblogic server and want to connect to that data source in my ADF BC application. Please let me know how and where to configure this data source in ADF BC app. Thanks, Prave
-
Migrating a user to another tablespace!
Dear All I need to migrate a user and all the tables associated with the user to a new tablespace and schema in other database. This is from Development to Production server. In Production Server i created a new schema and a tablespace associated wit