Skip to Content
0
May 15, 2008 at 09:01 PM

Using custom request handler.

385 Views

Hi All,

I craeted a request handler class by implementing the interface if_http_extension.

the code is:

method IF_HTTP_EXTENSION~HANDLE_REQUEST.

data: my_response type string ,
      itab_header_fields type tihttpnvp,
      wa_header_fields type ihttpnvp .

      server->request->get_header_fields( CHANGING FIELDS = itab_header_fields ).

      concatenate '<HTML>'
                  '<BODY>'
                  '<TABLE>'
                  into my_response .

      loop at itab_header_fields into wa_header_fields .
      concatenate
                 my_response
                 '<TR><TD>'
                 wa_header_fields-name
                 '<TD><TD>'
                 wa_header_fields-value
                 '</TD><TR/>'
                 into my_response .

       concatenate
                  my_response
                  
'</H2>DEMO:Own Request Handler</H2>'
                
                  '</BODY>'
                  '</HTML>'
                  into my_response .

                 server->response->set_header_field( name = 'Contentp-Type'
                                                     value = 'text/html'  ).

                  server->response->set_cdata( data = my_response  ) .

                  if_http_extension~flow_rc = if_http_extension=>co_flow_ok .
     endloop.

endmethod.

The calss is activated.

How can i test the handler that i have created?

I know i have to create a node in sicf txn and make an entery in the request handler table,but where to create the node and how to make entery in the request handler table.

BR,

Anubhav.

Edited by: Anubhav Jain on May 15, 2008 11:02 PM