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: 

REST WEB SERVICE - I only get a little part of the response data.

Former Member
0 Kudos

Hi

Iu2019m trying to consume a REST Web services ([http://en.wikipedia.org/wiki/REST] ) with abap and using the class cl_http_client.

I am able to connect and read information from the Web Service but I only get a little part of the data.

I get the data by using the method get_data (class: cl_http_response) and the data is written in the local variable lv_response_hex.


Data lv_response_hex type string.
Data mo_http_client type ref to cl_http_client.

  call method mo_http_client->response->get_data
    receiving
      data               = lv_response_hex.

However, there are circa 400-600 characters in lv_response_hex. Sometimes I get ca 6800 characters but the whole data is about 10000(or even more) characters.

The web service definitely works correctly because I tried to get the whole data with another program and I got it.

Thank you very much!

Best regards

Stefan

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The string needs to be defined as xstring.

Data lv_response_hex type xstring.

Regards,

Rich Heilman

Former Member
0 Kudos

Hello Rich

Thank you for your prompt reply.

I replaced string with xstring but the data is still uncompleted.

Best regards

Stefan

0 Kudos

hi Stefan,

try this

Data lv_response_hex type clob.

Regards

Renu