Suppose you have a Wrapped Doc/Lit operation, foo. The one complex input parameter contains a single element with two child elements, bBoolean and iInteger. The one complex output parameter also contains a single element with two child elements, iInteger and cString. Using the wrapped form, you might run the foo procedure with the INPUT parameter (param1) set to the XML string as shown in this example:

Wrapped Doc/Lit operation—wrapped form

DEFINE VARIABLE param1 AS LONGCHAR NO-UNDO.
DEFINE VARIABLE param2 AS LONGCHAR NO-UNDO.

param1 = "
<ns0:foo xmlns:ns0='http://tempuri.org/'> 
  <ns0:bBoolean>true</ns0:bBoolean> 
  <ns0:iInteger>17</ns0:iInteger>
</ns0:foo>"

RUN foo IN hWebService (INPUT param1, OUTPUT param2).

DISPLAY "Returned from web service call:" SKIP
  "  param2 = " SKIP param2 NO-LABEL FORMAT "x(200)".

On the return, you might display an XML string in the OUTPUT parameter (param2) as follows:

Returned from web service call:
  param2 = 
<ns0:fooResponse xmlns:ns0='http://tempuri.org/'>
  <ns0:iInteger>18</ns0:iInteger>
  <ns0:cString>Hello world!</ns0:cString>
</ns0:fooResponse>

Clearly, to work with the individual values contained in these parameters, you must treat them as complex data (see Complex data example).