General messages Interface definition - IDL

To be able to make a sequence of different capabilities, a union Capability is created, encompassing all derived capabilities. A union normally has a discriminator. This can be a long value, but this is generally not preferred because you have to remember the value indicating the intended capability. Therefore, an enumeration of capabilities is included in the CORBA profile. enum CapabilityType { ctAllSupportedRequest, ctDefaults, ctDefaultTimeOut, ctExplain, ctMessaging, ctQuery, ctSession, ctSoftwareInformation, ctSupportedCollections }; union Capability switchCapabilityType { case ctAllSupportedRequest : AllSupportedRequest allSupportedRequest; case ctDefaults : Defaults defaults; case ctDefaultTimeOut : DefaultTimeOut timeOut; case ctExplain : Explain explain; case ctMessaging : Messaging messaging; case ctQuery : Query query; case ctSession : Session session; case ctSoftwareInformation : SoftwareInformation softwareInformation; case ctSupportedCollections : SupportedCollections supportedCollections; };

9.6.6 General messages

The General Model is a message-based model, where messages are designed in the form of a class hierarchy. In CORBA IDL, the messages are translated as structs. Writing them in the form of interfaces is not useful. In CORBA, the objects instances of interfaces stay on a remote server machine and are referred to by a client machine. They are not transferred over the network. This is definitely not the intention for messages. All messages have the same form as the messages described in the General Model. However, messages in the form of structs cannot inherit from each other in CORBA. Therefore the Message class is also included in the CORBA profile and a member of all other messages, called base. struct Message { long long sessionID; wstring destinationID; RequestID requestID; wstring additionalInfo; }; All other messages, which in the General Model inherit from Message, have in the CORBA profile the Message as a structure member. The next messages do not add extra 94 Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. structure members. Alternatively, they might have been modelled by a typedef. But to be consistent with the rest of the messages these message have base as a structure member. Note that the response in the General Model also contains a string structure member diagnostic . This parameter is not specified in the CORBA profile. Error handling will be handled by exceptions, the standard CORBA facility. Exceptions are described below. WWWCORBA bridges can catch these exceptions and convert them into diagnostic info if necessary. struct InitSessionRequest { Message base; }; struct InitSessionResponse { Message base; }; struct TerminateRequest { Message base; }; struct TerminateResponse { Message base; Status status; }; The status and cancel messages add a few structure members in addition to the base structure member. struct StatusRequest { Message base; RequestID requestIDtoStatus; }; struct StatusResponse { Message base; RequestID requestIDtoStatus; Status status; }; struct CancelRequest { Message base; RequestID requestIDtoCancel; boolean freeResources; }; struct CancelResponse { Message base; Status status; RequestID canceledRequest; }; Copyright © 2007 Open Geospatial Consortium, Inc. All Rights Reserved. 95 The explain server messages add sequence of capabilities to the base message. The capability-type sequence can be filled with capability-types to specify which capabilities are requested from the server. The server responds with reporting each capability in a sequence of capabilities. typedef sequenceCapabilityType CapabilityTypeSeq; struct ExplainServerRequest { Message base; CapabilityTypeSeq capabilities; }; struct ExplainServerResponse { Message base; CapabilityTypeSeq capabilities; };

9.6.7 Discovery messages