Show TOC

Procedure documentationActivating Extended XML Handling Locate this document in the navigation structure

 

In ABAP, you cannot tell whether an initial interface parameter has not been given a value at all, or whether it has been given an initial value. The XSD standard sets out how to handle default values. The following standard procedure exists for proxy generation:

Standard Procedure for Default Handling

Consumer Proxy

When XML data stream is created, the default value is set in all initial fields.

Provider Proxy

Inbound processing on the server side of the ABAP proxy runtime sets the default value for parameters before the application is called if element tags are empty or attribute tags are missing. If elements have an attribute nil = "true" or the element tag is missing completely, the corresponding parameter is left initial.

To improve performance, optional, scalable elements that are initial and without a default value are suppressed in the message.

You can override this standard procedure.

Prerequisites

If you choose to override the standard procedure, this will affect system performance. This is because the additional information must be evaluated when you set up the message or it must be supplied during parsing. For this reason, you must inform the ABAP proxy runtime explicitly if you want to use this service.

The payload protocol is an instance of the interface IF_WSPROTOCOL_PAYLOAD. In the section Protocols, you will find a description of how you get this instance before the proxy call on the sender side or in inbound processing on the receiver side. To activate extended XML handling, proceed as follows:

  • To inform the proxy runtime on the sender side that you want to override the standard procedure, call the method SET_EXTENDED_XML_HANDLING before the client proxy call, and set the parameter EXTENDED_XML_HANDLING to 'X'. For fields where you want to override the standard procedure, complete a control table (as explained in the following section). Using the control table, you can determine whether a value should occur in the message payload, and how.

  • Regardless of whether you set the parameter EXTENDED_XML_HANDLING at the sender or not, you can set the ABAP proxy runtime at the receiver to complete the control table for fields. For this purpose, call the method SET_EXTENDED_XML_HANDLING of the payload protocol and set the parameter EXTENDED_XML_HANDLING to 'X'. The ABAP proxy runtime then determines, during parsing of messages for this proxy, whether the field was transferred to the message, whether the field contained an initial value, or whether it had no value at all. Accordingly, the proxy runtime completes a control table that can be evaluated by the application.

    Note Note

    Use the method GET_EXTENDED_XML_HANDLING to query whether you have activated the extended XML handling.

    End of the note.

Procedure

Controlling at the Sender

The ABAP proxy generation function generates a control table of the type PRXCTRLTAB (line type PRXCTRL) for each complex type. This component has the name CONTROLLER. Using this table you can define for each individual field whether it is to appear in the message, and how. For a table line, set the field FIELD to the ABAP field names, the field VALUE to a value from the type pool sai, and attach the line to the table. The field VALUE can have the following values:

Value Range for Field VALUE of Table CONTROLLER

Value

Meaning

sai_ctrl_initial

The field appears with an initial value appropriate for the type in the message; it therefore overrides default handling and performance optimization. The value is ignored for structures or complex types.

sai_ctrl_nil

The value xsi:nil is sent in the message for this field.

sai_ctrl_none

The field does not appear in the message, irrespective of this value or the default.

Interpretation of the Control Table on the Receiver Side

On the receiver side as well, the control table is generated in the same way as every other structure. In this case, the proxy runtime fills the control table during parsing with values that the application can then evaluate.      

Possible Values for the VALUE Field of the CONTROLLER Table on the Inbound Side

Value

Meaning

sai_ctrl_initial

Initial value was sent for the field.

sai_ctrl_nil

The value xsi:nil is sent in the message for this field.

sai_ctrl_none

Field was not part of the message.