on 11-04-2014 6:35 PM
Hi Guys,
Can somebody share an ABAP code to call .NET webservice directly from ABAP program?. I am trying to pass the date from ABAP to .NET API.
Thanks,
Here is the main part of how you accomplish this.
DATA: client_init TYPE REF TO if_http_client
cl_http_client=>create_by_url(
EXPORTING url = 'http://server.your-website.com/api/contract'
IMPORTING client = client_init
).
client_init->send( ).
client_init->receive( ).
json = client_init->response->get_cdata( ).
client_init->close( ).
WRITE:/ json.
HERE IS MY FULL WORKING EXAMPLE REPORT PROGRAM. It's just a small prototype that consumes a web API service and writes JSON to the screen.
There are also many different JSON parsers for ABAP. One of them is used in the ABAP example posted to the code sharing site.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.