The bottom line is that you will need to re-factor the web service calls. The old soap object was much easier.
Using the PBDom is sometimes a pain for relatively simple XML, I would write your own simple XML parser as that is quite often easier.
Either way you have some work to do to be compliant with modern SSL standards.
We would be happy to help if you think it would be useful.
Regards
David
And - FYI: PB2019R2 should give us TLS 1.3
Regards ... Chris
I am finding difficult using PBDOM to parse XML data contain huge data. My requirement is to read few tags data, Can you please help me with sample XML parser that would help me to load XML string data and read the value.
Thanks,
Ashok
Function of_xmltag
Call this function passing the XML and the tag you require, this will return the first occurrence of the tag in the XML chunk passed in. Call the function with a boolean flag of TRUE to remove that Tag Chuck from the source XML. In this way you can read successive values for the same tag in the source XML.
===========================================================================================
public function string of_xmltag (ref string as_xml, string as_tag, boolean ab_removexml);// Get the tag from the XML
string ls_response
long ll_pos1, ll_pos2, ll_pos3
ls_response = of_xmltag( as_xml, as_tag ) // Get the XML
if NOT ab_removexml then return ls_response
// Cut the chunc of XML out of the source
if len(ls_response ) > 0 then
ll_pos1 = pos (as_xml, ls_response) // Find this bit
// Now work backwards to find the tag
ll_pos2 = pos(reverse(left(as_xml, ll_pos1)), reverse(as_tag)) + len(as_tag) - 1 // no of characters back from pos 1
ll_pos3 = pos(mid(as_xml, ll_pos1 + len(ls_response)), '')
if ll_pos3 = 0 then
ll_pos3 = pos(mid(as_xml, ll_pos1 + len(ls_response)), '/>') + ll_pos1+ len(ls_response)
else
ll_pos3 += ll_pos1+ len(ls_response) + len(as_tag) + 1 // length of peice to remove
end if
ll_pos1 = ll_pos1 - ll_pos2 // adjust pos1 to be actual start postition.
as_xml = trim(replace(as_xml, ll_pos1, ll_pos3,' ') ) // Cut ls_response out of the source XML
end if
return ls_response
=================================================================================
public function string of_xmltag (string as_xml, string as_tag);// Get the tag from the XML
string ls_response
long ll_pos1, ll_pos2
ls_response = ''
// Find tag
ll_pos1 = pos(as_xml,'')
if ll_pos1 = 0 then
// Tag with attributes?
ll_pos1 = pos(as_xml,' 0 then
ll_pos1 += (2 + len(as_tag))
ll_pos2 = pos(as_xml,'')
if ll_pos2 = 0 then
ll_pos2 = pos(mid(as_xml, ll_pos1), '/>' )
ls_response = mid(as_xml, ll_pos1, ll_pos2 -1)
else
ls_response = mid(as_xml, ll_pos1, ll_pos2 - ll_pos1)
end if
end if
==========================================================================================
Hope this helps
David