Home » SQL & PL/SQL » SQL & PL/SQL » Error consuming https web services (Oracle 10.2.0.1.0 - Red Hat Enterprise AS release 3)
icon4.gif  Error consuming https web services [message #296009] Thu, 24 January 2008 03:29 Go to next message
marbi
Messages: 3
Registered: January 2008
Junior Member
Hi,

I'm trying this piece of pl/sql code and I'm getting ORA-12547: TNS:lost contact error while trying to retrieve soap response at line UTL_HTTP.read_text(respuesta, envio); . What could be wrong? Thanks in advance.

declare
envio varchar2(32767);
peticion UTL_HTTP.req;
respuesta UTL_HTTP.resp;
cadena varchar2(32767);
begin

envio := 'xxx'; -- soap request

Utl_Http.Set_Response_Error_Check ( enable => true );
Utl_Http.Set_Detailed_Excp_Support ( enable => true );

utl_http.set_wallet('file:/oracle/wallets','xxx');
peticion := UTL_HTTP.begin_request ('https://xxx','POST','HTTP/1.1');

UTL_HTTP.set_header(peticion, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(peticion, 'Content-Length', LENGTH(envio));
UTL_HTTP.set_header(peticion, 'SOAPAction','');
UTL_HTTP.write_text(peticion,envio);
respuesta := UTL_HTTP.get_response(peticion);
UTL_HTTP.read_text(respuesta, envio);
UTL_HTTP.end_response(respuesta);
dbms_output.put_line(envio);

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 ( 'Http_Client_Error: ' || Utl_Http.Get_Detailed_Sqlerrm );

when others then
Dbms_Output.Put_Line ('Otros: ' || SQLERRM);
end; 
Re: Error consuming https web services [message #296013 is a reply to message #296009] Thu, 24 January 2008 03:34 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
ORA-12547: TNS:lost contact
 *Cause: Partner has unexpectedly gone away, usually during process
 startup.
 *Action: Investigate partner application for abnormal termination. On an
 Interchange, this can happen if the machine is overloaded.

Regards
Michel
Re: Error consuming https web services [message #296015 is a reply to message #296013] Thu, 24 January 2008 03:39 Go to previous messageGo to next message
marbi
Messages: 3
Registered: January 2008
Junior Member
The web service is ok, I'm using XMLSpy to test this webservice and I'm getting response for the soap request.
Re: Error consuming https web services [message #296539 is a reply to message #296009] Mon, 28 January 2008 02:21 Go to previous messageGo to next message
marbi
Messages: 3
Registered: January 2008
Junior Member
The problem is a database bug:


Bug 5575771 UTL_HTTP cannot handle https connections without a content-length

If UTL_HTTP is used to retrieve an HTTPS response with no content-length, it
throws an ORA-12547 on the final read (if the final read is shorter than the
buffer supplied).

Workaround:
Include a Content-Length section on all responses.
(This may not be possible since some responses may not
be under your control)
Re: Error consuming https web services [message #296543 is a reply to message #296539] Mon, 28 January 2008 02:30 Go to previous message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback.

Regards
Michel
Previous Topic: how to write a query for my necessity
Next Topic: Date
Goto Forum:
  


Current Time: Fri Dec 09 01:51:34 CST 2016

Total time taken to generate the page: 0.15518 seconds