MESSAGE CONTRACT PROGRAMMING MODEL

Abstract
Embodiments described herein provide for a message contract programming model, which is a mechanism for service developers to control the processing, layout, and creation of messages (e.g., SOAP) without losing the benefits of a strongly-typed data contract model. Such programming model is based on attributes, which can be used to define the action or operations, headers, and body parts components of a message. These attributes may be used on a type annotated with message contract or on a service operation to control the manner in which the message (e.g., SOAP) is constructed from a service process, process parameters, and/or return values. The use of the message contract in conjunction with a message formatter as defined herein provides for many advantageous features and embodiments described herein.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited and other advantages and features of the invention can be obtained, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered to be limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:



FIG. 1 illustrates a distributed system configured to utilize an open-ended object model in accordance with example embodiments;



FIG. 2A illustrates the use of a message contract to create a general message object in accordance with example embodiments;



FIG. 2B illustrates using a message formatter for communication with a service operation in accordance with example embodiments;



FIG. 3 illustrates a flow diagram for a method of using a single message object to create message instances of multiple messaging formats in accordance with example embodiments;



FIGS. 4A and 4B illustrate flow diagrams for methods of simultaneously exposing a message infoset as both an XML view and a Type view in accordance with example embodiments;



FIG. 5 illustrates a flow diagram for a method of indexing headers for a SOAP message as an array in accordance with example embodiments;



FIGS. 6A and 6B illustrate flow diagrams for methods of efficiently processing a SOAP message by attaching thereto properties representing processing state for portions of the message in accordance with example embodiments;



FIG. 7 illustrates a flow diagram for a method of formatting a layout of a message object using a message contract in accordance with example embodiments;



FIG. 8 illustrates a flow diagram for a method of creating an instance of a message object by using a message contract in accordance with example embodiments;



FIG. 9 illustrates a flow diagram for a method of automatically creating a NPDL contract in accordance with example embodiments; and



FIG. 10 illustrates a flow diagram for a method of determining a type of encoding to use for a SOAP message in accordance with example embodiments.


Claims
  • 1. In a distributed messaging system, a method of formatting a layout of a message object using a message contract that maps elements to various portions thereof, the method comprising: receiving a request to create a message object in accordance with a message contract, which includes one or more attributes corresponding to one or more elements of a message class;parsing the message contract for identifying the one or more attributes that define what elements of the message class map to one or more portions of the message object; andpopulating the one or more portions of the message object with the one or more elements in accordance with the one or more attributes defined within the message contract.
  • 2. The method of claim 1, wherein the one or more elements include one or more of a type, struct, field, property, or operation.
  • 3. The method of claim 1, wherein the message object includes an envelope comprising a header portion and a body portion, and wherein the one or more attributes define that the one or more elements be populated within either the header portion or body portion.
  • 4. The method of claim 1, wherein populating the one or more portions of the message object with the one or more elements comprises: receiving one or more values corresponding to the one or more elements; andcreating an instance of the message object by populating the one or more portions with the one or more values in accordance with the one or more attributes defined within the message contract.
  • 5. The method of claim 4, wherein the one or more elements include one or more of a type, struct, field, property, or operation.
  • 6. The method of claim 4, wherein the message object includes an envelope comprising a header portion and a body portion, and wherein the one or more attributes define that the one or more values be populated within either the header portion or body portion.
  • 7. A computer program comprising one or more computer readable media having stored thereon computer executable instructions that, when executed by a processor, can cause the distributed messaging system to perform the method of claim 4.
  • 8. In a distributed messaging system, a message contract used in creating message objects, instances, and NPDL contracts used to communicate with a service, the message contract including: one or more elements of a message class that correspond to one or more operations of a service; andone or more attributes annotated to the one or more elements, which map the one or more elements to one or more portions of a message object.
  • 9. The message contract of claim 8, wherein the one or more elements include one or more of a type, struct, field, property, or operation.
  • 10. The message contract of claim 8, wherein the message object includes an envelope comprising a header portion and a body portion, and wherein the one or more attributes define that the one or more elements be populated within either the header portion or body portion.
  • 11. In a distributed messaging system, a method of automatically creating one or more portions of an NPDL contract used by clients in communicating with a service, the method comprising: receiving a request to create a NPDL contract, which defines how a client is to communicate with a service;receiving a message contract, which includes one or more attributes corresponding to one or more elements of a message class;based on the received message contract, creating at least a portion of the NPDL contract by specifying where and what elements should be included in a message object or instance thereof when communicating with the service.
  • 12. The method of claim 11, wherein the NPDL contract is a WSDL document.
  • 13. The method of claim 11, wherein the one or more elements include one or more of a type, struct, field, property, or operation.
  • 14. The method of claim 11, wherein the message object or instance thereof needs to include an envelope comprising a header portion and a body portion, and wherein the one or more attributes define that the one or more elements be as populated values within either the header portion or body portion.
  • 15. A computer program comprising one or more computer readable media having stored thereon computer executable instructions that, when executed by a processor, can cause the distributed messaging system to perform the method of claim 11.
Provisional Applications (2)
Number Date Country
60764124 Jan 2006 US
60764306 Feb 2006 US