‎2015 Dec 11 5:55 AM
Hi,
I have looked around and spent considerable time in the ABAP debugger without cracking this. Hope someone here can help me.
I have generated an ABAP SOAP proxy for consuming a web service. All works well.
This web service uses a generic method to retrieve data for any entity. To achieve this the response has the data stored in the XML element attributes rather than in the element content.
So instead of seeing something like this....
<Object>
<Name>Fred</Name>
<Address>1 Plane Street</Address>
<City>Sydney</City>
</Object>
...I need to handle something like this...
<Object name="Fred" address="1 Plane Street" city="Sydney">
</Object>
I can't figure out how to do this from the generated proxy class. Has anyone come across this before?
Thanks
Graham Robbo
‎2015 Dec 11 6:33 AM
So the web service can be called and returns the correct data - you just can't access the top-level nodes attributes?
If that is the case you could get them via the PAYLOAD protocol (IF_WS_PAYLOAD).
i.e.
payload_handler = cl_proxy_access=>get_payload_handler(
proxy_name = 'CO_...'
proxy_method = 'EXECUTE_SYNCHRONOUS' ).
Then use "GET_PAYLOAD_FROM_RESPONSE_DATA()".
* Show payload for test purposes
lo_pointer = lo_payload->get_xml_pointer( ).
cl_proxy_service=>show_xml_document( lo_pointer-> ).
‎2015 Dec 11 6:33 AM
So the web service can be called and returns the correct data - you just can't access the top-level nodes attributes?
If that is the case you could get them via the PAYLOAD protocol (IF_WS_PAYLOAD).
i.e.
payload_handler = cl_proxy_access=>get_payload_handler(
proxy_name = 'CO_...'
proxy_method = 'EXECUTE_SYNCHRONOUS' ).
Then use "GET_PAYLOAD_FROM_RESPONSE_DATA()".
* Show payload for test purposes
lo_pointer = lo_payload->get_xml_pointer( ).
cl_proxy_service=>show_xml_document( lo_pointer-> ).
‎2015 Dec 11 6:34 AM
What's wrong with this editor - the formatting of my response above is all over the place - sorry about that.
‎2015 Dec 11 7:16 AM
Thanks mate - that link to the docu really helped. Not sure why I couldn't find that but you have saved my weekend.
Cheers
Graham Robbo
‎2015 Dec 11 7:17 AM