title: How to call a soap webservice through PLSQL
body: <p>Here is my webservice link</p>
  
  <pre><code>http://83.143.26.34/MMWebService/MMWebSrv.asmx?WSDL
  </code></pre>
  
  <p>I want to call SendTextMessage method through PLSQL. Can Any one help me out?</p>
  
  <p>Here is the plsql code I have used. I am getting timed out exception. But it was fine through SOAP-UI.</p>
  
  <pre><code>declare
    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://83.143.26.34:4000/MMWebService/MMWebSrv.asmx';
    l_namespace   := 'xmlns:ser="urn:MMWebSrvService"';
    l_method      := 'SendTextMessage';
    l_soap_action := l_url || '/' || l_method;
    l_result_name := 'return';
    l_request     :=  soap_api.new_request(p_method    =&gt; l_method,
                                               p_namespace =&gt; l_namespace);
    soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strUsername',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'BIHL');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strPassword',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'monday@123');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strFrom',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserFrom');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strTo',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; '74747574');
      soap_api.add_parameter(p_request =&gt; l_request,
                                 p_name    =&gt; 'strMessage',
                                 p_type    =&gt; 'xsd:string',
                                 p_value   =&gt; 'UserMsg');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strSubject',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserSub');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strService',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserSrv');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'nOptions',
                                p_type    =&gt; 'xsd:int',
                                p_value   =&gt; 10);
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strTimeToSend',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; sysdate);
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strReference',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserRef');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strBillText',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserTxt');
     soap_api.add_parameter(p_request =&gt; l_request,
                                p_name    =&gt; 'strSessionID',
                                p_type    =&gt; 'xsd:string',
                                p_value   =&gt; 'UserSID');
  
    l_response :=  soap_api.invoke(p_request  =&gt; l_request,
                                       p_url      =&gt; l_url,
                                       p_action   =&gt; l_soap_action);
  
    l_return := soap_api.get_return_value(p_response  =&gt; l_response,
                                               p_name      =&gt; l_result_name,
                                               p_namespace =&gt; NULL);
  
  EXCEPTION
    WHEN OTHERS THEN
      pkg_pub_scd_ci.p_log_error('webservice to send a message' || ' -- ' ||
                                 sqlerrm ||
                                 dbms_utility.format_error_backtrace);
  end;
  </code></pre>