cancel
Showing results for 
Search instead for 
Did you mean: 

creating a XML document for a posting via HTTP

Former Member
0 Kudos

Hi, I am creating an XML document with the iXML type library using DOM as follows:

ixml = cl_ixml=>create( ).

document = ixml->create_document( ).

element = document->create_element( name = 'importdm' ).

rc = document->append_child( element ).

.....

.....

When I finished with the XML creation, then I want to append it to the request VIA HTTP_CLIENT->request->set_cdata( content ). (content is a STRING variable). The problem is that I dont know how to transform the document variable to CDATA.

Do anyone know how to do it?

Thanks for helping

Ariel

Accepted Solutions (0)

Answers (1)

Answers (1)

Ulli_Hoffmann
Contributor
0 Kudos

Hi Ariel,

use

response->if_http_entity~set_data( data = content length =...)

regards, Ulli

Former Member
0 Kudos

Ulli, I know how to set the data content in the response. The question is about how to put the document OBJECT (ixml document) into a CDATA variable.

Ariel

Ulli_Hoffmann
Contributor
0 Kudos

Hi Ariel,

try a xstring to string conversion:

DATA: conv TYPE REF TO CL_ABAP_CONV_IN_CE.

conv = CL_ABAP_CONV_IN_CE=>CREATE( input = Xcontent ).

conv->READ( importing data = content len = len ).

regards,

Ulli

Former Member
0 Kudos

Thanks Ulli.

Former Member
0 Kudos

Remember to give Ulli points for helping out!