Activating Extended XML HandlingLocate this document in the navigation structure

Use

Within an ABAP proxy type, you cannot distinguish whether a value is initial or whether no value was provided. The XDS standard defines how default values are handled. The following standard procedure exists for proxy objects:

Serialization

Any optional elements and attributes that are initial are suppressed during serialization of proxy types.

Deserialization

During deserialization, ABAP proxy runtime sets the default value if an element is empty or an attribute is missing. If an element has an attribute xsi:nil="true" or an element 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

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

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

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.      

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.