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: 

HTTP_POST structure / syntax

Former Member
0 Kudos

Hello All,

i have a requirement to connect to a web service which is not traditional, meaning when i try to make a proxy for it, it gives me a lot of headaches.

Therefore, i am trying to use HTTP_POST, as i have found that there is a number of people who have had success with it, in non traditional web services.

My issue is this, what is the structure used to load the header and the body internal tables? there doesn't seem to be a lot of documentation on this subject, at least that i can find. I will need to call the web service and pass it parameters and receive information back from the service. and, this is a third party, or external web service.

any information on this would be welcomed.

thanks,

Erik Thiessen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

in another thread Chan-Seok Jeon showed the proper structure of the body internal table. here it is, and thanks about Chan-Seok Jeon.

* Set Header

APPEND 'Content-Type: text/xml; charset=euc-kr' TO LT_REQ_HEAD.

* Set Parameter

APPEND '<?xml version="1.0" encoding="euc-kr"?>             ' TO LT_REQ_BODY.

APPEND '<root>                                              ' TO LT_REQ_BODY.

APPEND '<params>                                            ' TO LT_REQ_BODY.

APPEND '<param id="admMode" type="STRING">Y</param>         ' TO LT_REQ_BODY.

APPEND '<param id="block" type="STRING">A23</param>         ' TO LT_REQ_BODY.

APPEND '<param id="gubun" type="STRING">lot</param>         ' TO LT_REQ_BODY.

APPEND '<param id="ocomp" type="STRING"></param>            ' TO LT_REQ_BODY.

APPEND '<param id="path" type="STRING"></param>             ' TO LT_REQ_BODY.

APPEND '<param id="shipno" type="STRING">S630</param>       ' TO LT_REQ_BODY.

APPEND '<param id="userid" type="STRING">AAAAAAAAAA</param> ' TO LT_REQ_BODY.

APPEND '<param id="plate" type="STRING">Y</param>           ' TO LT_REQ_BODY.

APPEND '<param id="print_view" type="STRING">V</param>      ' TO LT_REQ_BODY.

APPEND '</params>                                           ' TO LT_REQ_BODY.

APPEND '<dataset id="ds_input">                             ' TO LT_REQ_BODY.

APPEND '<colinfo id="chk" size="1" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="dwgno" size="2" type="STRING"/>        ' TO LT_REQ_BODY.

APPEND '<colinfo id="fab" size="3" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="filechk" size="3" type="STRING"/>      ' TO LT_REQ_BODY.

APPEND '<colinfo id="filename" size="30" type="STRING"/>    ' TO LT_REQ_BODY.

APPEND '<colinfo id="grp" size="1" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="lot" size="3" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="revno" size="3" type="STRING"/>        ' TO LT_REQ_BODY.

APPEND '<colinfo id="ship" size="5" type="STRING"/>         ' TO LT_REQ_BODY.

APPEND '<record>                                            ' TO LT_REQ_BODY.

APPEND '<chk>1</chk>                                        ' TO LT_REQ_BODY.

APPEND '<dwgno>01</dwgno>                                   ' TO LT_REQ_BODY.

APPEND '<fab>COM</fab>                                      ' TO LT_REQ_BODY.

APPEND '<filechk>Oilechk>                                   ' TO LT_REQ_BODY.

APPEND '<filename>XXXXXXXXXXXXX.XXX</filename>              ' TO LT_REQ_BODY.

APPEND '<grp>4L</grp>                                       ' TO LT_REQ_BODY.

APPEND '<lot>A23</lot>                                      ' TO LT_REQ_BODY.

APPEND '<revno>0</revno>                                    ' TO LT_REQ_BODY.

APPEND '<ship>S630</ship>                                   ' TO LT_REQ_BODY.

APPEND '</record>                                           ' TO LT_REQ_BODY.

APPEND '</dataset>                                          ' TO LT_REQ_BODY.

APPEND '</root>                                             ' TO LT_REQ_BODY.

You are just passing the exact structure of the xml to http_post.

thanks,

Erik

1 REPLY 1

Former Member
0 Kudos

in another thread Chan-Seok Jeon showed the proper structure of the body internal table. here it is, and thanks about Chan-Seok Jeon.

* Set Header

APPEND 'Content-Type: text/xml; charset=euc-kr' TO LT_REQ_HEAD.

* Set Parameter

APPEND '<?xml version="1.0" encoding="euc-kr"?>             ' TO LT_REQ_BODY.

APPEND '<root>                                              ' TO LT_REQ_BODY.

APPEND '<params>                                            ' TO LT_REQ_BODY.

APPEND '<param id="admMode" type="STRING">Y</param>         ' TO LT_REQ_BODY.

APPEND '<param id="block" type="STRING">A23</param>         ' TO LT_REQ_BODY.

APPEND '<param id="gubun" type="STRING">lot</param>         ' TO LT_REQ_BODY.

APPEND '<param id="ocomp" type="STRING"></param>            ' TO LT_REQ_BODY.

APPEND '<param id="path" type="STRING"></param>             ' TO LT_REQ_BODY.

APPEND '<param id="shipno" type="STRING">S630</param>       ' TO LT_REQ_BODY.

APPEND '<param id="userid" type="STRING">AAAAAAAAAA</param> ' TO LT_REQ_BODY.

APPEND '<param id="plate" type="STRING">Y</param>           ' TO LT_REQ_BODY.

APPEND '<param id="print_view" type="STRING">V</param>      ' TO LT_REQ_BODY.

APPEND '</params>                                           ' TO LT_REQ_BODY.

APPEND '<dataset id="ds_input">                             ' TO LT_REQ_BODY.

APPEND '<colinfo id="chk" size="1" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="dwgno" size="2" type="STRING"/>        ' TO LT_REQ_BODY.

APPEND '<colinfo id="fab" size="3" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="filechk" size="3" type="STRING"/>      ' TO LT_REQ_BODY.

APPEND '<colinfo id="filename" size="30" type="STRING"/>    ' TO LT_REQ_BODY.

APPEND '<colinfo id="grp" size="1" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="lot" size="3" type="STRING"/>          ' TO LT_REQ_BODY.

APPEND '<colinfo id="revno" size="3" type="STRING"/>        ' TO LT_REQ_BODY.

APPEND '<colinfo id="ship" size="5" type="STRING"/>         ' TO LT_REQ_BODY.

APPEND '<record>                                            ' TO LT_REQ_BODY.

APPEND '<chk>1</chk>                                        ' TO LT_REQ_BODY.

APPEND '<dwgno>01</dwgno>                                   ' TO LT_REQ_BODY.

APPEND '<fab>COM</fab>                                      ' TO LT_REQ_BODY.

APPEND '<filechk>Oilechk>                                   ' TO LT_REQ_BODY.

APPEND '<filename>XXXXXXXXXXXXX.XXX</filename>              ' TO LT_REQ_BODY.

APPEND '<grp>4L</grp>                                       ' TO LT_REQ_BODY.

APPEND '<lot>A23</lot>                                      ' TO LT_REQ_BODY.

APPEND '<revno>0</revno>                                    ' TO LT_REQ_BODY.

APPEND '<ship>S630</ship>                                   ' TO LT_REQ_BODY.

APPEND '</record>                                           ' TO LT_REQ_BODY.

APPEND '</dataset>                                          ' TO LT_REQ_BODY.

APPEND '</root>                                             ' TO LT_REQ_BODY.

You are just passing the exact structure of the xml to http_post.

thanks,

Erik