title: How to configure Oracle wallet to avoid ORA-29273 when request geocoding?
body: <p>I got a problem to get geocoding from Google when I used a government licensed Google API key. This project is developed for government, so we should be able to use this API key. And I was told by government agent that as long as I use this API key and they add our company's domain to their list, we should be able to get geocoding without Google free limit. I am using Oracle 11gR2, Apex 4.1. The google does return some result (1600 geocodings) and after a while my program had exception.However, I got the following problem:</p>
  
  <pre><code>ORA-29273: HTTP request failed
  ORA-06512: at "SYS.UTL_HTTP", line 1722
  ORA-29259: end-of-input reached
  ORA-06512: at "SORS.SOR_TEST_SERVICE", line 24
  ORA-06512: at "SORS.SOR_TEST_SERVICE", line 187
  ORA-06512: at line 6
  29273. 00000 - "HTTP request failed"
  *Cause: The UTL_HTTP package failed to execute the HTTP request.
  *Action: Use get_detailed_sqlerrm to check the detailed error message.
  Fix the error and retry the HTTP request.
  </code></pre>
  
  <p>and I searched online and found the following thread on OTN:</p>
  
  <p><a href="https://forums.oracle.com/forums/thread.jspa?threadID=2253491" rel="nofollow">https://forums.oracle.com/forums/thread.jspa?threadID=2253491</a></p>
  
  <p>It looks I need to get Google API certificate and install it on Oracle wallet. I do not any experience about it. Can anyone give me a road map about it? For example, how can I get a Google certificate? Shall I contact with Google, or send request with license API key? or API key is a certificate? an example would be very helpful!</p>
  
  <p>Here is my code</p>
  
  <pre><code>   procedure Get_Geocoding(P_s_Address in varchar2, P_s_Geocoding out varchar2, P_n_accuracy out    number, P_b_success out boolean) is
  
    l_address varchar2(4000);
    l_url varchar2(32000);
    l_response varchar2(3200);
    n_first_comma number;
    n_second_comma number;
    n_level_length number;
  
   BEGIN
      /* TODO implementation required */
  
      l_address:=APEX_UTIL.URL_ENCODE(P_s_Address);
      l_address := replace(l_address,' ','+');
  
      l_url := 'http://maps.google.com/maps/geo?q='||l_address||'&amp;'||'output=csv'||'&amp;'||'key=my API key';
      l_response := utl_http.request(l_url, APEX_APPLICATION.G_PROXY_SERVER);
  
  
  
      n_first_comma:=instr(l_response,',',1,1);
      n_second_comma:=instr(l_response,',',1,2);
      n_level_length:=n_second_comma-n_first_comma-1;
  
      P_n_accuracy:=to_number(substr(l_response,n_first_comma+1, n_level_length));
  
      l_response:=substr(l_response,instr(l_response,',',1,2)+1);
  
  
  
     P_s_Geocoding:=l_response;
       if (P_s_Geocoding&lt;&gt;'0,0') then
         P_b_success:=true;
       else
        P_b_success:=false;
       end if;
  
   END;
  </code></pre>
  
  <p>}</p>
  
  <p>Thanks a lot!</p>
  
  <p>Sam</p>