now this web service works fine with my functions
- Code: Select all
-- First function without parameter
declare
l_env t_soap_envelope;
l_xml xmltype;
fitt xmltype;
l_val varchar2(4000);
l_start_date date;
begin
l_env := t_soap_envelope ('http://www.webservicex.net', 'geoipservice.asmx', 'GetGeoIPContext', 'xmlns="http://www.webservicex.net/"');
--l_env.add_param ('IPAddress', '10.1.1.138');
l_start_date := sysdate;
l_xml := flex_ws_api.make_request(p_url => l_env.service_url, p_action => l_env.soap_action, p_envelope => l_env.envelope);
-- flex_ws_util.get_value() in questo caso non ci serve, ma:
l_val := flex_ws_util.get_value (l_xml, 'GetGeoIPContextResponse', null, 'error');
--flex_ws_util.log_request (l_env.service_url, l_env.service_method, l_env.envelope, l_xml, l_start_date,
-- p_log_text => 'Converting 100 feet to meters', p_val1 => l_val);
l_val := substr(l_xml.getClobVal(),39,length(l_xml.getClobVal()));
dbms_output.put_line('XML DI RISPOSTA: ');
dbms_output.put_line(l_val);
end;
- Code: Select all
--Second function with parameter
declare
l_env t_soap_envelope;
l_xml xmltype;
fitt xmltype;
l_val varchar2(4000);
l_start_date date;
begin
l_env := t_soap_envelope ('http://www.webservicex.net', 'geoipservice.asmx', 'GetGeoIP', 'xmlns="http://www.webservicex.net/"');
l_env.add_param ('IPAddress', '10.1.1.138');
l_start_date := sysdate;
l_xml := flex_ws_api.make_request(p_url => l_env.service_url, p_action => l_env.soap_action, p_envelope => l_env.envelope);
-- flex_ws_util.get_value() in questo caso non ci serve, ma:
l_val := flex_ws_util.get_value (l_xml, 'GetGeoIPResponse', null, 'error');
--flex_ws_util.log_request (l_env.service_url, l_env.service_method, l_env.envelope, l_xml, l_start_date,
-- p_log_text => 'Converting 100 feet to meters', p_val1 => l_val);
l_val := substr(l_xml.getClobVal(),39,length(l_xml.getClobVal()));
dbms_output.put_line('XML DI RISPOSTA: ');
dbms_output.put_line(l_val);
end;
though the response is:
- Code: Select all
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetGeoIPContextResponse xmlns="http://www.webservicex.net/">
<GetGeoIPContextResult>
<ReturnCode>1</ReturnCode>
<IP>my ip</IP>
<ReturnCodeDetails>Success</ReturnCodeDetails>
<CountryName>European Union</CountryName>
<CountryCode>EU</CountryCode>
</GetGeoIPContextResult>
</GetGeoIPContextResponse>
</soap:Body>
</soap:Envelope>
How to do for extract the values??
I tested some solutions:
- https://forums.oracle.com/forums/thread ... dID=387277
and
- http://asitha.wordpress.com/2009/09/15/xmltype/
without success
For the complex types... i wait you for some suggestions!!
Thanks for your patience...
Cheers