We need to design and describe an interface for a distributed system, parts of which will be implemented in .NET (most probably WCF). Besides to method-specific attributes each WS call will need to accept/provide some common attributes (e.g. authentication tokens or paging parameters for the request, or version and error info for the response). There will be tens to hundreds of different WS calls. We also expect to use WIF or similar technology for understanding SAML tokens and identity federation.

My preferred approach is (so far) to use a XML structure with some common header and a variable body for each call, e.g.

```
<Request>
   <Header>
     <Paging>...</Paging>
     ...
   </Header>
   <Body method="GetInvoices">
     <!-- specific attributes for GetInvoices web method -->
   </Body>
</Request>

```

**Questions:** 

* Is this a good approach or do you recommend an alternative one?
* How to apply existing .NET technologies in order to simplify/automate dealing with this format as much as possible, namely
	+ write the interface for a specific call and generate service/schema description for the body part(similar how WCF generates WSDL service description from the method contract)
	+ parse the XML upon receipt, translate it into a call of the desired method with correct parameters (what I don't want to end up with is to have one big method with a big switch and 100s of cases...)

**UPDATE (1.7.2014)**

My question formulation has been perhaps somewhat vague. The real issue I am struggling with is to be able to apply ready-made .NET technologies for service generation (i.e. define a service contract and let VS generate WSDL service descriptions etc.) but at the same time make the message format flexible enough to allow for adding some out-of-band information which I intend to process separately. 

For example I would like to have authentication data in the header (unsure yet in which form - possibly some authentication tokens, or SAML). Then I would like to intercept the request before it actually ends in the corresponding web method and reject it or set some context based on the authentication data, so that the web method can rely on the context. The same goes for paging in web methods where it is applicable, or success/failure messages for the response.

For sake of interoperability/generality I started with a "pure" XML approach, but now I can imagine a better solution would be to extend common SOAP message format like this:

```
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
       <!-- out of band data -->
   </s:Header>
   <s:Body>
      <GetInvoices xmlns="http://tempuri.org/">
          <!-- arguments  of GetInvoices() -->
      </GetInvoices >
   </s:Body>
</s:Envelope>

```

The question is then if this makes sense and whether it is implementable in WCF (how)?