Creating a Sample E-mail Event SOAP Message

This section contains instructions for creating a sample e-mail event SOAP message using the ExampleEventDefinitionSOAPMessage_forEmail.xml template.

The contents of the template are included here for your reference.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:wsa="http://www.w3.org/2005/08/addressing" 
xmlns:ns="http://www.eclipse.org/alf/schema/EventBase/1" 
xmlns:myev="http://www.example.org/MyEventDefinitionEventExtensions">
  <soapenv:Header>
    <wsa:To>mailto:eventemail@serverName?X-Service-Path=/eventmanager
     /services/ALFEventManagerOneWayDocLit</wsa:To>
    <wsa:MessageID>urn:uuid:421A2EE66BA3A42A8C1203350641340</wsa:MessageID>
    <wsa:Action>urn:EventNotice</wsa:Action>
  </soapenv:Header>
  <soapenv:Body>
    <ns:ALFEventNoticeDoc version="1.0">
      <ns:Base>
        <ns:EventId>1</ns:EventId>
        <ns:Timestamp>2008-05-12T21:19:20.671Z</ns:Timestamp>
        <ns:EventType>MyEventDefinitionEvent</ns:EventType>
        <ns:ObjectType>MyEventDefinitionObject</ns:ObjectType>
        <ns:ObjectId>1</ns:ObjectId>
        <ns:Source>
          <ns:Product>MyEventDefinition</ns:Product>
          <ns:ProductVersion>1.0</ns:ProductVersion>
          <ns:ProductInstance>MyEventDefinitionInstance</ns:ProductInstance>
        </ns:Source>
        <ns:User>
          <ns:ALFSecurity>
            <ns:UsernameToken>
              <ns:Username>username</ns:Username>
              <ns:Password>password</ns:Password>
            </ns:UsernameToken>
          </ns:ALFSecurity>
        </ns:User>
       </ns:Base>
      <ns:Extension>
        <myev:MyEventDefinitionData>Test Data</myev:MyEventDefinitionData>
      </ns:Extension>
    <//ns:ALFEventNoticeDoc>
  </soapenv:Body>
</soapenv:Envelope>
Note: The element prefixes (for example, wsa:) used in the rest of this section are simply shortcut references to the defining namespace. They are provided to help you identify the values in the template, but the prefixes are not part of the element name.

To create a sample e-mail event SOAP message, you must update all of the bolded values in the template as follows:

  1. Set the following element values for the particular system you are using:
    • <wsa:To>mailto:event@yourdomain.com?X-Service-Path=/eventmanager/services/ALFEventManagerOneWayDocLit</wsa:To>

      The WS-Addressing <To> element value must contain a valid xs:anyURI in the format shown. The e-mail portion of the URI, in this case eventemail@yourdomain.com, should be set to the e-mail address that you have been provided for sending events to the system.

      Note: In the SBM On-Demand environment, the e-mail address you should use is usually event@yourdomain.com. In other words, you should replace eventemail@serverName in the template with event@yourdomain.com.
    • <ns:Username>username</ns:Username>
    • <ns:Password>password</ns:Password>

      The values of the preceding two elements should be set to the user name and password credentials for the system that you use for raising the event.

  2. Set the following element values per event type, as defined in your event definition WSDL:
    • <ns:EventType>MyEventDefinitionEvent</ns:EventType>

      Set this element to the EventType value for this event.

    • <ns:ObjectType>MyEventDefinitionObject</ns:ObjectType>

      Set this element to the ObjectType value for this event.

    • <ns:Product>MyEventDefinition</ns:Product>

      Set this element to the Product value for your event definition.

    • <ns:ProductVersion>1.0</ns:ProductVersion>

      Set this element to the ProductVersion value for your event definition.

    • <ns:ProductInstance>MyEventDefinitionInstance</ns:ProductInstance>

      Set this element to the ProductInstance value for your event definition.

  3. Set the following element values for each event instance:
    • <wsa:MessageID>urn:uuid:421A2EE66BA3A42A8C1203350641340</wsa:MessageID>

      Set this element to a unique ID for each event sent. A UUID is suggested. If you use ALFEventManagerOneWayDocLit in the <wsa:To> element, this value is not critical since no reply is expected; however, it might be useful in the future.

    • <ns:EventId>1</ns:EventId>

      Set this element to a unique ID for each event sent. Although this is not critical, it allows you to identify the particular instance of the event, which might be useful to correlate data.

    • <ns:ObjectId>1</ns:ObjectId>

      This element identifies the instance of the object responsible for the event. Although this is not critical, a value recognized by your event definition might be useful for accessing data in your event definition to correlate data.

    • <ns:Timestamp>2008-05-12T21:19:20.671Z</ns:Timestamp>

      This element records the time the event was sent. It must be in xsd:dateTime format (a subset of ISO 8601). It can be set to nil as shown, where xsi: is the namespace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance".

      <ns:Timestamp xsi:nil="true"/>

    • <myev:MyEventDefinitionData>Test Data</myev:MyEventDefinitionData>

      This element is the Extension data for this event, as defined by your event definition. The sample event definition only defines one element (MyEventDefinitionData) in its Extension data. Your event definition can send more complex data.

Related Topics

Testing Events from an External Source

Defining an Event Definition