Application Development and Automation 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: 
Read only

Question on writing xml string to application server

Former Member
0 Likes
728

Hi

I have an XML string that is basically the payload of a client proxy call request from within an ABAP program. I need to move this payload XML into a file on the application server. Here is the code that I used :

*********************************************************************************

data : v_xml type string,

payload_protocol TYPE REF TO if_wsprotocol_payload,

payload TYPE REF TO if_ws_payload,

lo_pointer TYPE REF TO XSTRING.

call method 0_clientproxy-->Method " This is the call to consume the ext.websvc method

payload_protocol ?= 0_clientproxy->get_protocol(

if_wsprotocol=>payload ).

payload = payload_protocol->get_sent_request_payload( ).

v_xml = payload->get_xml_text( ).

open dataset w_phyfile for output in text mode encoding utf-8.

transfer v_xml to w_phyfile.

close dataset.

***********************************************************************************

However when I see the file in the application server , it does not have the entire contents of the xml string. To doublecheck the xml request payload, I used the following construct - instead of writing the file to server.

lo_pointer = payload->get_xml_pointer( ).

cl_proxy_service=>show_xml_document( lo_pointer->* ).

I could see the full xml in the window that came up .

Where am I going wrong when I write the xml to the application server ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
609

Hi,

some tips:

- Check sy-subrc after open dataset.

- Check sy-subrc after close dataset.

- Check if v_xml not initial in transfer moment.

- Check if user has authority for record in app server.

- Try to change mode encoding.

Just some suggestions...

4 REPLIES 4
Read only

Former Member
0 Likes
610

Hi,

some tips:

- Check sy-subrc after open dataset.

- Check sy-subrc after close dataset.

- Check if v_xml not initial in transfer moment.

- Check if user has authority for record in app server.

- Try to change mode encoding.

Just some suggestions...

Read only

0 Likes
609

Thanks for the suggestions. I actually see a file of size 7098620 bytes in AL11 transaction. When I open the file in AL11 - I don't see the entire contents - see a single long line...

Any ideas on how do I get the file from AL11 ?

Karthik.M

Read only

0 Likes
609

If you see only one line with AL11, it means that there are none "carriage return" character in the xml string, it's only a problem because AL11 does not format files on screen. It also displays only 254 characters maximum in width on screen (AL11 is limited).

If you have ECC, you may use transaction CG3Y to copy file to frontend.

Otherwise, you will find lots of code examples in SDN to copy it (search for GUI_DOWNLOAD)

Or use FTP

Edited by: Sandra Rossi on Jan 1, 2009 12:29 AM (added : Or use FTP)

Read only

0 Likes
609

Thanks - I was able to get the file using CG3Y. Points awarded.