08-28-2014 11:29 PM
Hi, experts.
My program Dumps when i try to use some external webservice using a xml inside other xml node.
Im using wsdl generated proxies.
He's the code.
DATA: proxy TYPE REF TO ZBRWEBSERVICE_WEBSERVICE_WSACT .
DATA : v_output TYPE ZBRWEBSERVICE_WSACTIVEWSACTI30.
DATA : V_INPUT TYPE ZBRWEBSERVICE_WSACTIVEWSACTI31.
data: v_string type string.
data: err_string type string.
data: lo_soap_exception type ref to CX_AI_SOAP_FAULT.
CONCATENATE '<ROWDATA><ROW TOKEN="" SOMEXMLATTRIBUTES="" '
'SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" COT_CLIRETIRA="N" '
'SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" XML="10.500"SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" OTA="12304.760" '
'COT_KM="0.00000" COT_PRIORI="V" COT_OBS=""'/></ROWDATA>'
INTO v_string.
v_input-xml = v_string.
TRY.
CREATE OBJECT proxy
EXPORTING
logical_port_name = 'WEBSERVICE'.
CATCH cx_ai_system_fault.
ENDTRY.
TRY.
CALL METHOD proxy->zws_method
EXPORTING
INPUT = v_input
IMPORTING
output = v_output.
catch CX_AI_SOAP_FAULT into lo_soap_exception.
err_string = lo_soap_exception->get_text( ).
ENDTRY.
I always got CX_AI_SOAP_FAULT saying the XML is not in valid format. if i remove the slash at the end of ROW tag there is no dump but the webservice im using says the xml is not valid too (malformed). either way i can't retrive the information.
I tried many things and i've searched a lot but cant find a clue about how to solve this.
08-28-2014 11:59 PM
Should you keep the blank space at the end of each string that you are concatenating? if yes, try to replace ' (regular quotation mark) for ` (back quotation mark)
CONCATENATE `<ROWDATA><ROW TOKEN="" SOMEXMLATTRIBUTES="" `
`SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" COT_CLIRETIRA="N" `
`SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" XML="10.500"SOMEXMLATTRIBUTES="" SOMEXMLATTRIBUTES="" OTA="12304.760" `
`COT_KM="0.00000" COT_PRIORI="V" COT_OBS=""'/></ROWDATA>`
Regards,
Felipe
08-29-2014 2:26 AM
The spaces are not that relevant. And i tried this before and only the slash at the end of ROW tag seems to be.
08-29-2014 7:59 AM
Could you try replacing <row token="" /> with <row token=""></row> ?
08-29-2014 3:09 PM
08-29-2014 3:22 PM
Did you try using CDATA ?
<![CDATA[ now here comes your xml string ]]>
08-29-2014 3:30 PM
yes i have, ECC parses the info the right way, so does de webservice but when the webservice try to use the info in his internal functions it can't identify which data i'm sending.
08-29-2014 3:37 PM
Isn't it then a problem of the external webservice that they have to solve, because CDATA is the way you need to send unparsed data.
08-29-2014 7:11 PM
thats right, but i can't do nothing about it becouse its a 3rd party webservice.