9 Replies Latest reply: Jun 6, 2012 3:45 AM by 344384 RSS

    too many http requests and null self argument is disallowed

    344384
      Hi

      I have this piece of code which was working fine till yesterday but now it doesnt work,
            UTL_HTTP.SET_HEADER (HTTP_REQ, 'Content-Length', LENGTH (SOAP_REQUEST));
            UTL_HTTP.SET_HEADER (HTTP_REQ,'SOAPAction','"http://webapi/Streets_Events_Get"');
            UTL_HTTP.WRITE_TEXT (HTTP_REQ, SOAP_REQUEST);
            UTL_HTTP.WRITE_TEXT (HTTP_REQ, SOAP_REQUEST);
      
             INSERT INTO XXHCC_STAGING_XML   VALUES  ((XMLTYPE (SOAP_REQUEST)), SYSDATE,'Street_Events_Get SOAP Request');
             COMMIT;
             
             --dbms_output.put_line('req is ' || http_req);      
      
            HTTP_RESP := UTL_HTTP.GET_RESPONSE (HTTP_REQ);
            UTL_HTTP.READ_TEXT (HTTP_RESP, SOAP_RESPOND);
            INSERT INTO XXHCC_STAGING_XML  VALUES  ((XMLTYPE (SOAP_RESPOND)), SYSDATE,'ssssss');
            COMMIT; 
      
            UTL_HTTP.END_REQUEST(http_req);
            UTL_HTTP.END_RESPONSE (HTTP_RESP);
      I m posting a SOAP request and getting back a response, but now whats happening is I can see my Request xml in the staging table, but i dont get anything back in the response, May be the response is empty and when it inserts into staging table the empty response xml, it fails.

      If i execute in PL/SQL i get the following error
      ERROR at line 1:
      ORA-30625: method dispatch on NULL SELF argument is disallowed
      ORA-06512: at line 9
      But in my error log i get is
      ORA-29273: HTTP request failed
      ORA-06512: at "SYS.UTL_HTTP", line 1222
      ORA-29270: too many open HTTP requests
      I m doing an END Request in the code above, but I dont know how to overcome this error

      The webservice is working fine when tested independently.

      My Environment is

      Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
      PL/SQL Release 9.2.0.6.0 - Production

      Can someone let me know,

      Many thanks

      Sri
        • 1. Re: too many http requests and null self argument is disallowed
          Jason_(A_Non)
          I'm just guessing but you run your code and get the
          ORA-30625: method dispatch on NULL SELF argument is disallowed
          and then after a while you eventually start getting
          ORA-29270: too many open HTTP requests
          If so, ORA-29270 happens because I don't see your code closing the HTTP connection when an error happens. In other words, does your error handling close the connection as well?

          The ORA-30625 is happening because your are calling an XMLType based function and passing in a NULL value. This usually happens (to me) when I nest XMLType functions and one returns NULL due to an error. I have no clue what your line 9 is so I can't guess what you are doing to get the error though.
          • 2. Re: too many http requests and null self argument is disallowed
            344384
            Hi

            I m assuming the following code closes all the connections
                  UTL_HTTP.END_REQUEST (http_req);
                  UTL_HTTP.END_RESPONSE (HTTP_RESP);
            I m calling the procedure from sql plus like this
            SQL> var clob_out clob;
            SQL> 
            SQL> declare
              2   xml_out xmltype;
              3   begin
              4   xxhcc_crm_integration.Street_Events_Get('19101705','03/03/2011','23/04/2011',xml_out);
              5   :clob_out := xml_out.getclobval();
              6   end;
              7  /
            declare
            *
            ERROR at line 1:
            ORA-30625: method dispatch on NULL SELF argument is disallowed
            ORA-06512: at line 5
            Is there a parameter for no. of http connections to be made from PL/SQL, any kind of setting, I assume the webservice is not returning any response bcos of too many http requests and therefore its failing

            Can someone please let me know how to go about?

            Thanks

            Sri
            • 3. Re: too many http requests and null self argument is disallowed
              344384
              In my SOAP RESPOND variable I get server failure error, So i think its not connecting to the webservice, which is on my pc,

              I dont know what to do next, it was working fine 2 days back, and I can access the web url from browser and it works fine, So something in pl/sql which is not allowing me to connect now.....
              utl_http.set_proxy (proxy => 'http://confirm:c0nf1rm@91.1.15.3:8080');
                    
              http_req :=utl_http.begin_request ('"http://hullcc-37692/WebApi/WebService1.asmx"','POST','HTTP/1.1');
                        
              utl_http.set_header (http_req, 'Content-Type', 'text/xml');
                    
              utl_http.set_detailed_excp_support(true);
              
              utl_http.set_authentication (http_req, 'confirm', 'c0nf1rm');      
              
              utl_http.set_header (http_req, 'Content-Length', length (soap_request));
              
              utl_http.set_header (http_req,'SOAPAction','"http://webapi/Streets_Events_Get"');
              
              utl_http.write_text (http_req, soap_request);
              
                     insert into xxhcc_staging_xml   values  ((xmltype (soap_request)), sysdate,'Street_Events_Get SOAP Request');
                     commit;
                           
              http_resp := utl_http.get_response (http_req);
              utl_http.read_text (http_resp, soap_respond);
                          
                    insert into xxhcc_staging_xml  values  ((xmltype (soap_respond)), sysdate,'ssssss');
                     commit;           
                    
              --RESP := XMLTYPE.CREATEXML (SOAP_RESPOND);
                                 
              utl_http.end_request(http_req);
              utl_http.end_response (http_resp);
              --RESP := XMLTYPE.CREATEXML (SOAP_RESPOND);
              When i debug line by line, i get an error in the Insert into staging XMLTYPE(SOAP_RESPOND) bcos SOAP_RESPOND contains Server Failure Error.

              Not sure why its not conecting to the URL which is my pc only.

              I m stuck here, Any inputs appreciated?

              Thanks

              S
              • 4. Re: too many http requests and null self argument is disallowed
                344384
                I think i got it, when i give the ip address of my machine it works but when i give the actual name of my pc it doesnt work

                Can someone tell me what needs to be done as its not doing the domain name resolution i mean the oracle server.

                or should i have to request for a static ip address.

                Thanks

                S
                • 5. Re: too many http requests and null self argument is disallowed
                  Jason_(A_Non)
                  All you should need is
                  UTL_HTTP.END_RESPONSE (HTTP_RESP);
                  Here is the documentation on the difference. Since you are completing a normal process and not aborting after you send the request, that is all you need.
                  http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/u_http.htm#BHABGIAA
                  ERROR at line 1:
                  ORA-30625: method dispatch on NULL SELF argument is disallowed
                  ORA-06512: at line 5
                  This is because xml_out variable is null as you appear to have discovered in your later posts.
                  Is there a parameter for no. of http connections to be made from PL/SQL, any kind of setting, I assume the webservice is not returning any response bcos of too many http requests and therefore its failing
                  The issue is not because of the remote web server but because of your code failing to close the connection. Without seeing the full path of your code, I cannot determine why it appears to not be executing the END_RESPONSE line above. I still suspect it is throwing an error you are hiding in your code.
                  when i give the ip address of my machine it works but when i give the actual name of my pc it doesnt work
                  Does your host file resolve the name of your machine to the current IP address? I doubt your companies DNS does but I could be wrong. The easiest fix is to add an entry to the host file on your OS to resolve that issue.
                  • 6. Re: too many http requests and null self argument is disallowed
                    344384
                    I was thining of using
                    SELECT UTL_INADDR.get_host_address('ABC-37692')FROM dual
                    This would give me the IP Address and then i can use it in the begin_request method.

                    I hope what i m doing is the right way.

                    Thanks

                    Sri
                    • 7. Re: too many http requests and null self argument is disallowed
                      344384
                      Hi

                      I m thinking of using this stmt to get the IP Address and then use it in the begin_request method
                      SELECT UTL_INADDR.get_host_address('ABC-37692')FROM dual
                      Is it the right way of doing it?

                      Thanks

                      Sri
                      • 8. Re: too many http requests and null self argument is disallowed
                        Jason_(A_Non)
                        Never used that package before but it appears it should, as long as something somewhere supports resolving the name into an IP address. You also need to consider the machine this code will be deployed to. Will it already be able to resolve the name to an IP address when UTL_HTTP is used? Servers usually are configured to be able to do that since I suspect the web service will not reside on the server. This is where you need to change your dev environment to function like the Test/Prod environment will and not code in fixes that work on your dev machine but add overhead to the Test/Prod environments.

                        * All the above is based on past experiences and it could be your networks are setup differently and all I said is wrong.
                        • 9. Re: too many http requests and null self argument is disallowed
                          344384
                          Yeah I know what u r saying, i will test if the method works fine in the DEV and LIVE environments, We have like TEST,DEV and LIVE setups, and I m sure if it has worked on one of the environment it shuld work in others too.

                          As of now the webservice is hosted on my pc, We wuld be moving that to a server and i hope all servers shuld be able to communicate with each other.