5 Dec, 2006

What is a Message Exchange Pattern (MEP)?

Words "Message Exchange Pattern" or "MEP" are used in abundance in distributed computing field and mostly in Web services. Let's understand MEPs, generalized to Web services, here.

MEP is a pattern of message exchanged between SOAP nodes. Rather than talking in general terms, let's understand this using a concrete example. Take the following scenario. What will happen when you invoke a Web service which provides stock quotes? You first send out a SOAP message to the Web services server, which hosts the stock quote service. Then the server sends out the response, which contains the stock quote to you.

Let's look at this message exchange from the Web services server point-of-view. There is a message coming IN and a response message going OUT. This is a template for any request-response message and is named as IN-OUT message exchange pattern.

Let's take another example. A client sends a Web services server a SOAP message to switch-off logging. In this example, server receives IN message and it concludes the message exchange. This pattern is termed as IN-Only MEP. Sometimes, the server might want to inform the client using a SOAP fault message, in case of an error. This is termed as Robust In-Only MEP.

One important thing to note here is that all the MEPs are named as if we are thinking from the server or the ultimate receiver's point-of-view.

Just like the IN-OUT and IN-Only MEPs, there are more MEPs defined by various specifications and any one can define their custom MEPs. But SOAP 1.2 specification mandates assigning a URI to all the MEPs in order to uniquely identify them. WSDL 2.0 adjuncts defines a set of MEPs and have assigned URIs to identify them. For example, IN-Only MEPs has the URI "https://www.w3.org/2006/01/wsdl/in-only" while IN-OUT MEP has "https://www.w3.org/2006/01/wsdl/in-out".

So we can define an MEP as a template that establishes a pattern for the exchange of messages between SOAP nodes.

More Information:

 

About Author

  • Eran Chinthaka
  • Software Engineer
  • WSO2 Inc.