Manual HTTP POST from ABAP
I'm trying to use a kind of botched web service implementation that doesn't come with a WSDL file - so, no generated proxy for me to use. It also needs me to send an XML file via an HTTP POST - not in a SOAP envelope. This presents a problem for me - understandably, this isn't part of WebAS 6.40's web services stuff.
Does anyone know of a way of manually posting something via HTTP in ABAP? I'm sure there must be some function module or class that exposes that functionality - I just can't find it! Any ideas anyone?
Yes I ahve done manual ABAP HTTP_POST from ABAP.
Check this blog , I have mentioned this in it.
***********The sample code **************
REPORT Z_HTTP_POST .
PARAMETERS : uri(100) lower case
default 'http://192.168.1.1:8181/ankur/testServlet' .
Len type I.
DATA: t_request_header type table of sbcheader with header line,
t_request_body type table of sbcbody with header line,
t_response_header type table of sbcheader with header line,
t_response_body type table of sbcbody with header line .
CALL FUNCTION 'HTTP_POST'
ABSOLUTE_URI = Uri
REQUEST_ENTITY_BODY_LENGTH = 300
BLANKSTOCRLF = 'X'
STATUS_CODE = Status_code
STATUS_TEXT = Status_text
RESPONSE_ENTITY_BODY_LENGTH = Len
REQUEST_ENTITY_BODY = t_request_body
RESPONSE_ENTITY_BODY = t_response_body
RESPONSE_HEADERS = t_response_header
REQUEST_HEADERS = t_request_header
CONNECT_FAILED = 1
TIMEOUT = 2
INTERNAL_ERROR = 3
TCPIP_ERROR = 4
SYSTEM_FAILURE = 5
COMMUNICATION_FAILURE = 6
OTHERS = 7
Write:/ the header data : .
Loop at t_response_header.
Write:/ the Body data : .
Loop at t_response_body.