IDOProtocol .NET class library
The IDOProtocol .NET class library contains classes that correspond to each level in the hierarchy of an IDO request or response. These classes are used to construct IDO requests and responses. All IDOProtocol classes are in the Mongoose.IDO.Protocol namespace.
The top level of the IDOProtocol class hierarchy is implemented by the IDORequestEnvelope class, and the IDO request or RequestHeader in XML, is implemented by the IDORequest class. The request payload implementation varies depending on the request type.
- For an OpenSession request, the payload is implemented by the OpenSessionRequestData class.
- For a LoadCollection request, the payload is implemented by the LoadCollectionRequestData class.
There are other similar classes for each request type that carries a payload.
The IDO responses are implemented in classes that mirror the requests, with the IDOResponseEnvelope at the top of the hierarchy.
Executing an IDO runtime Invoke call using IDOProtocol classes
As an example, these steps are required to execute an IDO runtime Invoke call using IDOProtocol classes:
- Create a new IDORequestEnvelope instance.
- Set the IDORequestEnvelope.SessionID property.
- Create a new instance of IDORequest.
- Set the IDORequest.Type property to Invoke.
- Create a new instance of InvokeRequestData.
- Set the InvokeRequestData.IDOName property.
- Set the InvokeRequestData.MethodName property.
- Add the parameters to the InvokeRequestData.Parameters collection.
- Add the IDORequest to the IDORequestEnvelope.Requests collection.
- Set the payload for the IDORequest using the IDORequest.SetPayload method.
- Send the completed IDORequestEnvelope to the IDO runtime and receive the IDOResponseEnvelope in return.
Using the IIDOCommands interface
Whether you write the code on the client side or in an IDO extension class, the framework also provides wrapper methods through the IIDOCommands interface. These wrappers typically reduce IDO interactions to a single line of code.
When you use the IIDOCommands interface, you can only specify one IDO request per command and receive one response per command. But when you use the IDOProtocols classes instead, you can build one IDORequestEnvelope that includes multiple requests, and then receive one response that includes information for all the requests.
Using the ApplicationDB class
The ApplicationDB class, part of the Mongoose.IDO.DataAccess namespace, is available only to extension classes. This class provides direct access to the application database and access to common framework features, such as application messages and session variables. See ApplicationDB class.