Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9090

Calling a web service from abap

$
0
0

Hi all,

 

I want to call a webservice from ABAP.

In my report i use the below code .

 

web_rul =' http://test.asmx'.

 

CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL

         EXPORTING

         URL                = WEB_URL

         IMPORTING

         CLIENT             = CLIENT

         EXCEPTIONS

         ARGUMENT_NOT_FOUND = 1

         PLUGIN_NOT_ACTIVE  = 2

         INTERNAL_ERROR     = 3

         OTHERS             = 4.

 

         CLIENT->REQUEST->SET_HEADER_FIELD( NAME  = '~REQUEST_METHOD' VALUE = 'GET' ).

         CLIENT->SEND( ).

 

         CALL METHOD CLIENT->RECEIVE

         EXCEPTIONS

         HTTP_COMMUNICATION_FAILURE = 1

         HTTP_INVALID_STATE         = 2

         HTTP_PROCESSING_FAILED     = 3

         OTHERS                     = 4.

 

         RET_DATA = CLIENT->RESPONSE->GET_CDATA( ).

         REPLACE  ALL OCCURRENCES OF '&LT;' IN RET_DATA WITH '<' .

         REPLACE ALL OCCURRENCES OF '&GT;' IN RET_DATA WITH '>' .


Please correct me if my approach is wrong. when i execute the report the value in ret_Data is

####<html>####    <head><link rel="alternate" type="text/xml" href="test.asmx?disco" />####    <style type="text/css">##    ####BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px


what is the mistake in this. how should i call the webservice from abap.


Regards,

Subasree


Viewing all articles
Browse latest Browse all 9090

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>