SIFWorks ADK 2.0
IMessageInfo Interface
NamespacesEdustructures.SifWorksIMessageInfo

[This is preliminary documentation and is subject to change.]

Provides information about an XML message, such as envelope and header attributes, the source of the message, and optionally the raw XML document that comprises the message.
Declaration Syntax
C#Visual BasicVisual C++
public interface IMessageInfo
Public Interface IMessageInfo
public interface class IMessageInfo
Members
All MembersMethodsProperties



IconMemberDescription
AttributeNames
Gets the names of all attributes. Implementations of this interface may define attributes to hold values specific to the messaging protocol.

GetAttribute(String)
Gets the value of an attribute. Implementations of this interface may define attributes to hold values specific to the messaging protocol.

Message
Gets the content of the raw XML message

PayloadTag
Gets the SIF payload message element tag

PayloadType
Gets the SIF payload message type

SetAttribute(String, String)
Sets the value of an attribute. Implementations of this interface may define attributes to hold values specific to the messaging protocol.

Zone
Gets the zone from which the message originated

Remarks

A concrete implementation of this interface is available for each messaging protocol supported by the ADK. For instance, the SifMessageInfo class provides access to specific information regarding Schools Interoperability Framework SIF_Message envelopes and SIF_Header headers.

Raw XML Message Content

When the adk.keepMessageContent agent property is enabled, the Message property will return the XML document that was received as a single String. When this option is disabled (the default), the ADK does not keep a copy of raw message content in memory and will return a null value.

Using MessageInfo in Message Handlers

A MessageInfo instance is passed as a parameter to message handlers such as Publisher.onRequest and Subscriber.onEvent. Cast the parameter to a concrete type to obtain protocol-specific information about the message.

Examples
For example, the following shows how to obtain the value of the SIF_SourceId and SIF_MsgId elements from the SIF_Header, as well as the version of SIF declared by the SIF_Message envelope:
CopyC#
public void onEvent( Event event, Zone zone, MessageInfo info ) 
{ 
    // Cast to SIFMessageInfo to get SIF-specific header info 
    SIFMessageInfo inf = (SIFMessageInfo)info;  
    // Obtain SIF-specific header values 
    String sourceId = inf.getSourceId(); 
    String msgId = inf.getMsgId(); 
    SIFVersion version = inf.getSIFVersion();  
    // Display some information about this SIF_Event... 
    System.out.println( "SIF_Event message with ID " + msgId +  
        " received from agent " + sourceId +  
        " in zone " + zone.getZoneId() + "." 
        " This is a SIF " + version.toString() + " message." ); 

    ...

Assembly: Edustructures.SifWorks.Adk (Module: Edustructures.SifWorks.Adk) Version: 2.0.0.10