Previous Table of Contents Next


15.4.3 Reply Message


   Reply messages are sent in response to Request messages if and only if the response expected flag in the request is set to TRUE. Replies include inout and out parameters, operation results, and may include exception values. In addition, Reply messages may provide object location information. In GIOP versions 1.0 and 1.1, replies flow only from server to client.

   Reply messages have three elements, encoded in this order:

   15.4.3.1 Reply Header

   The reply header is defined as follows:

   module GIOP { // IDL extended for 1.2 and 1.3

   #ifndef GIOP_1_2 // GIOP 1.0 and 1.1

   enum ReplyStatusType_1_0 { // Renamed from ReplyStatusType NO_EXCEPTION, USER_EXCEPTION, SYSTEM_EXCEPTION, LOCATION_FORWARD

   };

   // GIOP 1.0

   struct ReplyHeader_1_0 { // Renamed from ReplyHeaderIOP::ServiceContextList service_context;unsigned long request_id;ReplyStatusType_1_0 reply_status;

   };

   // GIOP 1.1typedef ReplyHeader_1_0 ReplyHeader_1_1;// Same Header contents for 1.0 and 1.1

   #else // GIOP 1.2, 1.3 enum ReplyStatusType_1_2 {

   NO_EXCEPTION,USER_EXCEPTION,SYSTEM_EXCEPTION,LOCATION_FORWARD,LOCATION_FORWARD_PERM,// new value for 1.2NEEDS_ADDRESSING_MODE // new value for 1.2

   };

   struct ReplyHeader_1_2 {unsigned long request_id;ReplyStatusType_1_2 reply_status;IOP::ServiceContextList service_context;

   };

   typedef ReplyHeader_1_2 ReplyHeader_1_3; #endif // GIOP_1_2 };

   The members have the following definitions:

   There is no padding after the reply header when an unfragmented reply message body is empty.

   15.4.3.2 Reply Body

   In GIOP version 1.0 and 1.1, reply bodies are marshaled into the CDR encapsulation of the containing Message immediately following the Reply Header. In GIOP version 1.2 and 1.3, the Reply Body is always aligned on an 8-octet boundary. The fact that GIOP specifies the maximum alignment for any primitive type is 8 guarantees that the ReplyBody will not require remarshaling if the Message or the Reply Header are modified. The data for the reply body is determined by the value of reply_status. There are the following types of reply body:

   When a GIOP Reply message contains a `reply_status' value of SYSTEM_EXCEPTION, the body of the Reply message conforms to the following structure:

   module GIOP { // IDL

   struct SystemExceptionReplyBody { string exception_id; unsigned long minor_code_value; unsigned long completion_status; };

   };

   The high-order 20 bits of minor_code_value contain a 20-bit “Vendor Minor Codeset ID? (VMCID); the low-order 12 bits contain a minor code. A vendor (or group of vendors) wishing to define a specific set of system exception minor codes should obtain a unique VMCID from the OMG, and then use those 4096 minor codes as they see fit; for example, defining up to 4096 minor codes for each system exception. Any vendor may use the special VMCID of zero (0) without previous reservation, but minor code assignments in this codeset may conflict with other vendor's assignments, and use of the zero VMCID is officially deprecated.

   Note – OMG standard minor codes are identified with the 20 bit VMCID \x4f4d0. This appears as the characters ‘O’ followed by the character ‘M’ on the wire, which is defined as a 32-bit constant called OMGVMCID \x4f4d0000 (see Section 4.12.4, “Standard Minor Exception Codes,? on page 4-73) so that allocated minor code numbers can be or-ed with it to obtain the minor_code_value.

   Note – Usage of LOCATATION_FORWARD_PERM is now deprecated, due to problems it causes with the semantics of the Object::hash() operation. LOCATATION_FORWARD_PERM features could be removed from some future GIOP versions if solutions to these problems are not provided.

   For example, the reply body for a successful response (the value of reply_status is NO_EXCEPTION) to the Request example shown on page 15-37 would be equivalent to the following structure:

   struct example_reply {

double return_value; // return value
string str;
long p; // ... to the rightmost
};

   Note that the object_key field in any specific GIOP profile is server-relative, not absolute. Specifically, when a new object reference is received in a LOCATION_FORWARD Reply or in a LocateReply message, the object_key field embedded in the new object reference’s GIOP profile may not have the same value as the object_key in the GIOP profile of the original object reference. For details on location forwarding, see Section 15.6, “Object Location,? on page 15-49.