RXS_soapDecode()

Call this subprocedure to take XML from its encoded form (i.e. <tagname>content</tagname>) to actual XML that can be parsed (i.e. content).

The reason this subprocedure is named soapDecode speaks to why this API is needed in the first place. Many programmers in .NET and Java environments have their code generated which inherently means the encoding style usually defaults to RPC (Remote Procedure Call) vs. Document Literal. Note that RXS_soapDecode can also be used to encode values if your program is composing the XML to be sent to an RPC style web service. In the end RXS_soapDecode is simply an easy to use find/replace mechanism to use on files and variable data.

The following are the default from/to array values if pFrom and pTo are not specifed on the call to RXS_soapDecode:


from(1) = '&lt;';
to(1) = '<';
from(2) = '&gt;';
to(2) = '>';
from(3) = '&quot;';
to(3) = '"';
from(4) = '&apos;';
to(4) = '''';
from(5) = '&amp;';
to(5) = '&';

Subprocedure Prototype

D RXS_soapDecode  pr

Converts XML from encoded to decoded form.

D  pFileOrData                        like(RXS_XmlData)

Used to specify a file in the IFS or actual XML residing in an RPG variable. If an IFS file is specified it must either be fully qualified (i.e. /home/user/mydoc.xml) or must reside in the default transaction directory (i.e. /www/myrxs/trans.) If it resides in the default transaction directory then you can just specify it as 'mydoc.xml.'

D  pType                              value like(RXS_Type)

Use RXS_STMF if the value passed in pFilePathOrData is a path to an IFS file. Use RXS_VAR if the value passed in pFilePathOrData contains XML.

Valid Values:

  • RXS_STMF
  • RXS_VAR

D  pFrom                        10a   dim(10) varying options(*nopass)

Used to specify a list of from values in an array that correspond to the to values in pTo.

Default Value: from(1)='<', from(2)='>', from(3)='"', from(4)=''', from(5)=&'

D  pTo                          10a   dim(10) varying options(*nopass)

Used to specify a list of to values in an array that correspond to the from values in pFrom.

Default Value: to(1)='<', to(2)='>', to(3)='"', to(4)='\'', to(5)='&'