Reputation: 57
I’m using soap_api method for accessing web services in oracle. When I create add_numbers function and I execute add_numbers function then Function doesn’t execute. fires following error when calling web service in select statement
select add_numbers(2,5) from dual
error is
I’m using this function and soap_api methods from this link. taken example from
http://www.oracle-base.com/articles/9i/consuming-web-services-9i.php#Top
Function for calling web services.
CREATE OR REPLACE FUNCTION add_numbers (p_int_1 IN NUMBER, p_int_2 IN NUMBER) RETURN NUMBER 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);
BEGIN
l_url := 'http://192.168.0.75:9001/LicWebService.asmx';
l_namespace := 'xmlns="http://192.168.0.75:9001/"';
l_method := 'AddNum';
l_soap_action := 'http://192.168.0.75:9001/AddNum';
l_result_name := 'return';
l_request := soap_api.new_request(p_method => l_method, p_namespace=> l_namespace);
soap_api.add_parameter(p_request => l_request,p_name => 'int1',p_type => 'xsd:integer',p_value => p_int_1);
soap_api.add_parameter(p_request => l_request,p_name=> 'int2', p_type=> 'xsd:integer',p_value => p_int_2);
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 => NULL);
END;
Kindly suggest me where i am making mistake.
Upvotes: 1
Views: 5175
Reputation: 7912
Either your TNS is not set up properly or the TNS service is not running. This is the reason why the UTL_HTTP
api isn't working (which is used by SOAP_API
).
Follow this link to troubleshoot and resolve this.
Upvotes: 1