estou com problemas para utilizar o pacote UTL_HTTP, retorna a seguinte mensagem de erro da requisição
System.InvalidOperationException: Request format is invalid: text/xml;charset=utf-8.
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
Alguém tem experiência com está package (UTL_HTTP)?
Segue o código fonte que retorna o erro apresentado acima.
declare
l_url varchar2(500);
l_http_request UTL_HTTP.req;
l_http_response UTL_HTTP.resp;
l_request soap_api.t_request;
l_response soap_api.t_response;
VA_ERROR_MSG VARCHAR2(4000);
begin
-- Test statements here
l_xml := '<?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>
<fu_upld xmlns="http://www.pontsystems.com.br/">
<pa_tp_cd_usua>J</pa_tp_cd_usua>
<pa_cd_usua>CNPJ da empresa</pa_cd_usua>
<pa_ds_xml_nfe>' || l_xml || '</pa_ds_xml_nfe>
</fu_upld>
</soap:Body>
</soap:Envelope>';
pack_debug.del;
L_URL := 'http://portalnfe.wmsul.com.br/GNFe_Port_ws/cls_403_nfe_xml.asmx/fu_upld';
l_http_request := UTL_HTTP.begin_request(l_url, 'POST', 'HTTP/1.1');
--
UTL_HTTP.set_header(l_http_request, 'Content-Type', 'text/xml;charset=utf-8');
UTL_HTTP.set_header(l_http_request, 'Content-Length', LENGTH(l_xml));
UTL_HTTP.set_header(l_http_request, 'SOAPAction', '"http://www.pontsystems.com.br/fu_upld"');
UTL_HTTP.write_text(l_http_request, l_xml);
pack_debug.ADD(TO_CLOB(l_xml), 'write_text');
l_http_response := UTL_HTTP.get_response(l_http_request);
UTL_HTTP.read_text(l_http_response, l_xml);
UTL_HTTP.end_response(l_http_response);
pack_debug.ADD(TO_CLOB(l_xml), 'RESPONSE');
l_response.doc := XMLTYPE.createxml(l_xml);
l_response.envelope_tag := 'soap'; --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/"');
soap_api.check_fault(l_response);
--RETURN l_response;
exception
when others then
VA_ERROR_MSG := sqlerrm || CHR(10) || ' ERRO: ****************REQUISIÇÃO****************' || CHR(10) || ' Código Erro:' ||
l_http_request.private_hndl || ' - URL:' || l_http_request.url || '- METHOD:' || l_http_request.method || ' - HTTP_VERSION: ' ||
l_http_request.http_version || CHR(10) || 'ERRO: ****************RESPOSTA****************' || CHR(10) || ' Código Erro:' ||
l_http_response.private_hndl || ' - STATUS_CODE:' || l_http_response.status_code || '- REASON_PHRASE:' ||
l_http_response.reason_phrase || ' - HTTP_VERSION: ' || l_http_response.http_version;
DBMS_OUTPUT.PUT_LINE(VA_ERROR_MSG);
raise_application_error(-20001, 'erro');
end;