You can model a Windows Communication Foundation (WCF)
message contract.
Before you begin
To use the stereotypes required in this procedure, you must
apply the .Net WCF profile to the model. The C# transformation profile
is optional for creating C# structs.
About this task
To model a WCF message contract in a diagram:
Procedure
- Add a UML class in the diagram.
- Apply the «Message Contract» stereotype to the class. Optionally, to create a C# struct, also apply the «CSharp Struct»
stereotype to the class.
- On the Stereotypes page of the Properties view, under Stereotype
Properties, set the message contract properties as required
for your implementation.
- In the class, add one or more UML attributes.
- To each attribute you generate into the Simple Object Access
Protocol (SOAP) header of the message, apply the «Message Header»
stereotype.
- To each attribute you generate into the SOAP body of the
message, apply the «Message Body Member» stereotype.
Example
The following image shows a sample diagram of a message contract.
What to do next
After modeling the message contract, you can configure and
run a UML-to-C# transformation to generate the C# code.