Show TOC Entering content frame

Procedure documentation Activating Extended XML Handling Locate the document in its SAP Library structure

Use

In ABAP, you cannot tell whether an initial interface parameter has not been given a value, or whether it was 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

Client proxy

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

Server proxy

Inbound processing on the server side of the ABAP proxy runtime sets the default value for parameters before calling the application, 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, initial, scalable elements 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 construct 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. The protocol section describes how to fetch 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, at the receiver, you can set the ABAP proxy runtime to complete the control table for fields. 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 when parsing messages to 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. The proxy runtime correspondingly 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.

Controlling at the Sender

The ABAP proxy generation functions generate control tables of 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 occur in the message, and how. For a table line, set the field FIELD to the ABAP field name, 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

Field appears with type-correct initial value in the message; it controls default handling and performance optimization. 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

Field does not occur in message, independently of its value and 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 completes 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 was sent in the message for this field.

sai_ctrl_none

Field was not part of the message.

 

 

 

 

 

 

Leaving content frame