Share via


The ItineraryHelper Class

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The ItineraryHelper class simplifies and centralizes itinerary manipulation tasks when working with ESB itineraries. You will directly use this class only in cases where itinerary manipulation is required, such as when creating custom agents that must be able to advance their own itinerary.

The ItineraryHelper class is part of the project named ESB.Itinerary.csproj, located in the \Source\Core\Source\ESB.Itinerary** **folder. The ESB Guidance Core installer installs and registers the ItineraryHelper class in the global assembly cache.

The ItineraryHelper class exposes the following public static methods:

  • AdvanceItinerary. This method takes as its single parameter a reference to a message, and it advances the itinerary by one step. It populates the service instance with the properties of the service for the next step, marks the current service as completed, sets the time stamp, and updates other relevant context properties. To update the properties correctly, you must pass the message to this function from within a Message Construct shape.
  • CurrentStep. This method takes as its single parameter a reference to a message, and it returns an instance of the ItineraryStep class for the current step. It also changes the state of the current service instance from Pending to Active and sets the BeginTime property.
  • GetItineraryHeader. This method retrieves the value of the itinerary property from the BizTalk message context.
  • GetResolvers. This method** **returns a typed collection of resolvers as a ResolverCollection instance, populated by parsing the itinerary SOAP header.
  • GetServiceResolversXML. This method** **returns an XML string that represents the resolvers associated with a specific service located at specific position within the itinerary.
  • ProcessItinerary. This method takes as its single parameter a reference to a message, reads the itinerary, and writes it to a custom BizTalk context property in the message for future retrieval. The method returns True if the itinerary header exists and it can populate the context property; it returns False if header does not exist.
  • ValidateItinerary. This method takes as its single parameter a reference to a message, sets the default values of the Itinerary context property within the message, removes any values that should not be set, and updates the Itinerary property. The method raises an exception if it cannot validate and rewrite the property.