How to Set Up Processing for Inbound Messages with Text Content
Inbound Message Setup and Processing
- Create a sample message for use as the source format/template with the fields that would be extracted from the file specified. Fields to be used as arguments are wrapped in prefix "{$" and suffix "$}". There are different types of formats: free-form and fixed-position.
- Example of a free-form message, Device Position Update:
MsgType:Device Position Update
MsgDir:Forward
Sender:{$SENDER_NAME$}
Device:{$EXTERNAL_DEVICE_ID$}
DateSent:{$DATE_SENT$} {$TIME_SENT$}
DateHub:20090512 1205
DateSNI:20090512 120545
PosEventDate:{$EVENT_DATE$} {$EVENT_TIME$}
PosDate:20090512 1230
PosLatitude:{$LATITUDE$}
PosLongitude:{$LONGITUDE$}
PosLocation:{$LOCATION_GID$}
PosNearest City:Green Bay
PosNearest State:WI
PosDistance from Nearest City-ST:3 miles
PosDirection from Nearest City-ST:NNW
PosIgnition Indicator:ON
PosDirection Travelling:West
PosSpeed:56 MPH
EOBRRemainingtoWork:6:36
EOBRRemainingonDrive:6:36
EOM - Example of a fixed-position message:
MsgType:Fixed
MsgDir:Forward
{$SENDER_NAME$} 0 8
{$EXTERNAL_DEVICE_ID$} 9 15
DateHub:20090512 1205
DateSNI:20090512 120545
{$DATE_SENT$} 16 24
{$TIME_SENT$} 25 29
{$EVENT_DATE$} 30 38
{$EVENT_TIME$} 39 43
PosDate:20090512 1230
{$LATITUDE$} 44 48
{$LONGITUDE$}49 52
{$LOCATION_GID$}53 60
PosNearest City:Green Bay
PosNearest State:WI
PosDistance from Nearest City-ST:3 miles
PosDirection from Nearest City-ST:NNW
PosIgnition Indicator:ON
PosDirection Travelling:West
PosSpeed:56 MPH
EOBRRemainingtoWork:6:36
EOBRRemainingonDrive:6:36
EOM
Note: The first line “MsgType:Fixed” is mandatory to determine the type of Freeform message. The following lines indicate the fields wrapped in the “{$” and “$}“ and their respective start and end positions on the message line separated by whitespace characters.
E.g. {$SENDER_NAME$} 0 8
Indicates the field SenderName will appear at position 0-7 on the message line. - Example of a free-form message, Device Position Update:
- If the message will be used to generate a transmission XML, create a sample transmission XML:
- Using a text editor, create a sample Transmission XML for use as the output of the message. Specify in the XML where the fields/arguments extracted from the source message should be placed.
- For the Device Position Update, a sample Transmission XML should be created. In this example, you must replace your user name and password:
<Transmission xmlns="http://xmlns.oracle.com/apps/otm">
<TransmissionHeader>
<AckSpec>
<ComMethodGid>
<Gid>
<Xid>EMAIL</Xid>
</Gid>
</ComMethodGid>
<EmailAddress>myemailaddress@oracle.com</EmailAddress>
<AckOption>YES</AckOption>
</AckSpec>
</TransmissionHeader>
<TransmissionBody>
<GLogXMLElement>
<ShipmentStatus>
<IntSavedQuery>
<IntSavedQueryGid>
<Gid>
<DomainName>GUEST</DomainName>
<Xid>MATCH_SHIPMENT_BY_DEVICE_ID</Xid>
</Gid>
</IntSavedQueryGid>
<IntSavedQueryArg>
<ArgName>DEVICE_ID</ArgName>
<ArgName>{$EXTERNAL_DEVICE_ID$}</ArgName>
</IntSavedQueryArg>
</IntSavedQuery>
<StatusLevel>SHIPMENT</StatusLevel>
<StatusCodeGid>
<Gid>
<Xid>X7</Xid>
</Gid>
</StatusCodeGid>
<EventDt>
<GLogDate>{$EVENT_DATE$}{$EVENT_TIME$}</GLogDate>
</EventDt>
<StatusReasonCodeGid>
<Gid>
<Xid>NS</Xid>
</Gid>
</StatusReasonCodeGid>
<SSStop>
<SSLocation>
<LocationID>{$LOCATION_GID$}</LocationID>
<LocationRefnumQualifierGid>
<Gid>
<Xid>GLOG</Xid>
</Gid>
</LocationRefnumQualifierGid>
<Latitude>{$LATITUDE$}</Latitude>
<Longitude>{$LONGITUDE$}</Longitude>
</SSLocation>
</SSStop>
<DriverRefnum>
<DriverRefnumQualGid>
<Gid>
<DomainName>GUEST</DomainName>
<Xid>DRIVER NAME</Xid>
</Gid>
</DriverRefnumQualGid>
<DriverRefnumValue>{$SENDER_NAME$}</DriverRefnumValue>
</DriverRefnum>
</ShipmentStatus>
</GLogXMLElement>
</TransmissionBody>
</Transmission>
- Define a Stylesheet Profile for each sample message:
- Specify the Stylesheet Profile ID.
- Specify the Template Name with the same value as the Stylesheet Profile ID.
- Specify the Direction of "INBOUND".
- Specify the Type of "TEXT".
- Select the For Message XML check box.
- Create a Stylesheet Content ID using the sample message created above.
- Upload the sample message.
- Set stylesheet profile arguments:
- Click the Parse Stylesheet Content button to parse the content for the arguments.
- Add any additional Arguments needed for processing with default values.
- Specify any that are Required to proceed with processing.
- Set the Stylesheet Profile Set Fields:
- Select the Field Name to update.
- Select the Argument Name.
- Select the Assign Type as "ARG".
OR
Enter a Message Code Map ID. It represents the lookup table.
- Define a Stylesheet Profile for each Transmission XML Template. If necessary, refer to step 2 above regarding creating a sample transmission XML.
- Specify the Stylesheet Profile ID.
- Specify the Template Name with the same value as the Stylesheet Profile ID.
- Select the Direction of "INBOUND".
- Select the Type of "XML".
- Select the For Message XML check box.
- Create a Stylesheet Content ID using the sample transmission XML created above.
- Upload the sample transmission XML.
- Define a Message Type:
- Select a Message Direction of "INBOUND".
- Select the Generate Transmission XML option button.
- In the Result Stylesheet Profile field, select the stylesheet profile created for the transmission XML.
- Indicated that a notification is be placed in the Message Center.
- Select "ALWAYS" in the Send To Message Center drop-down.
- Enter the Message Center User ID.
OR
Enter the Message Center Involved Party Qualifier. - Enter the Message Center Stylesheet Profile ID to use for creating the Message Center entry.
- If the Message XML will be received without the Stylesheet Profile and Message Type specified in the XML, define a Message Profile. The Message Profile will be used to try to determine the correct stylesheet profile and message type.
- Enter an Attempt Sequence of "1".
- Enter the Stylesheet Profile for the sample message created above.
- The following are optional when the Message Profile, Stylesheet Profile, and Message Type are specified in the inbound message. Note that for submitting a message to the Message Center for an involved party, the association of Device to a Driver is needed.
- Create a Contact:
- Add the Message Profile ID defined above.
- Create a Device:
- Assign the Contact ID created above.
- Specify an External Device ID.
- Create a Contact:
Related Topics
How To Set Up Processing for Outbound Messages
How To Set Up Processing for Inbound Messages with XML Content