XML Response to large?
Posted: Mon Mar 20, 2023 3:20 pm
Hello,
I created a program based on example16. I am connecting to a SOAP service, sending XML. I am recieving back an XML response and trying to use XML-INTO and populate into a ds to get the values that I require.
Here is my ds:
dcl-ds search_status qualified;
result_guid char(50);
company_id char(25);
dts_search_date char(25);
dts_status char(10);
dts_match char(1);
dts_last_validated_date char(25);
dts_override char(1);
dts_override_date char(25);
num_hits char(5);
end-ds;
I build the XML and do the following:
monitor;
PostResult = http_string( 'POST': url: PostData: 'text/xml');
on-error;
ErrorMsg=http_error();
PostResult='<Result>Error</Result>';
endmon;
I then do:
monitor;
//Parse output
xml-into search_status %xml(PostResult: 'case=any ns=remove +
path=Envelope/Body/DPSIntegratedSearchResponse+
/DPSIntegratedSearchResult/dts_search_results+
/entry/search_status');
on-error;
error = 'Unable to parse XML data';
return;
*inlr = *on;
endmon;
It fails every time. When I look at the data in debug mode I am not getting any data that I care about really. It seems like there is a lot of spaces before the data I am looking for. I can't seem to attach the log file here, but I have it if needed.
Any assistance is appreciated.
Erin
I created a program based on example16. I am connecting to a SOAP service, sending XML. I am recieving back an XML response and trying to use XML-INTO and populate into a ds to get the values that I require.
Here is my ds:
dcl-ds search_status qualified;
result_guid char(50);
company_id char(25);
dts_search_date char(25);
dts_status char(10);
dts_match char(1);
dts_last_validated_date char(25);
dts_override char(1);
dts_override_date char(25);
num_hits char(5);
end-ds;
I build the XML and do the following:
monitor;
PostResult = http_string( 'POST': url: PostData: 'text/xml');
on-error;
ErrorMsg=http_error();
PostResult='<Result>Error</Result>';
endmon;
I then do:
monitor;
//Parse output
xml-into search_status %xml(PostResult: 'case=any ns=remove +
path=Envelope/Body/DPSIntegratedSearchResponse+
/DPSIntegratedSearchResult/dts_search_results+
/entry/search_status');
on-error;
error = 'Unable to parse XML data';
return;
*inlr = *on;
endmon;
It fails every time. When I look at the data in debug mode I am not getting any data that I care about really. It seems like there is a lot of spaces before the data I am looking for. I can't seem to attach the log file here, but I have it if needed.
Any assistance is appreciated.
Erin