Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Application server error in http client

Former Member
0 Kudos

Hello ,

I'm using cl_http_client , and when i execute my program ,i don't get a respinse :  p_content = http_client->response->get_cdata( )

I get an error : Application server error.

It seems a problem in service activation , but i don't know how to fix it.

Thank  you

3 REPLIES 3

kaus19d
Active Contributor
0 Kudos

Hi ,

The details are not enough to get you a proper solution, perhaps some print-screens can help. What are your SAP product you have been using?? The database or OS??

Thanks,

Kaushik

Former Member
0 Kudos

Hi Kaushik,

This is the code i'm trying to execute :

REPORT ZPW_WEBSERVICE.

*&---------------------------------------------------------------------*

*&      Selection Screen

*&---------------------------------------------------------------------*

PARAMETERS : p_cnt TYPE t005t-landx .

*&---------------------------------------------------------------------*

*&      Types and Data

*&---------------------------------------------------------------------*

DATAhttp_client    TYPE REF TO if_http_client ,

        http_url       TYPE string                ,

        p_content      TYPE string                .

*&---------------------------------------------------------------------*

*&      Start of Selection

*&---------------------------------------------------------------------*

START-OF-SELECTION .

* Build the url string based on input

   CONCATENATE 'http://www.webservicex.net/globalweather.asmx'

   '/GetCitiesByCountry?CountryName='

   p_cnt

   INTO http_url .

* Creation of new IF_HTTP_Client object

   CALL METHOD cl_http_client=>create_by_url

     EXPORTING

       url                = http_url

     IMPORTING

       client             = http_client

     EXCEPTIONS

       argument_not_found = 1

       plugin_not_active  = 2

       internal_error     = 3

       OTHERS             = 4.

   http_client->request->set_header_field( name  = '~request_method'

   value = 'GET' ).

* Send the request

   http_client->send( ).

* Reterive the result

   CALL METHOD http_client->receive

     EXCEPTIONS

       http_communication_failure = 1

       http_invalid_state         = 2

       http_processing_failed     = 3

       OTHERS                     = 4.

   p_content = http_client->response->get_cdata( ).




In the debugger, i'm trying to display p_content :

kaus19d
Active Contributor
0 Kudos

Check whether your ICM services if required, restart once the ICM service. Also check for the program with your Developer if its required to activate the Program/Table, generally in ECC system can be achieved via SE11. I guess, as The current SCN is moving now to the new SCN Site  http://people.sap.com, you have to wait until Monday & then maybe required to re-post this matter after that.

Thanks,

Kaushik