"WCF Technology Insider" translation 12:1th Part _ 2nd Chapter _ Service-oriented: Concept summary

Source: Internet
Author: User
Tags integer soap xmlns

Concept Summary

I hope you have a clear understanding of service orientation from this section of this chapter. In the next few chapters, let's look at how these concepts work in a WCF system. In our example, I talk about building a simple order Processing service that accepts customer orders. To keep the concept simple and straightforward, there are 2 message participants, as shown in Figure 2-3.

Figure 2-3: A simple example of a message exchange

The purpose of this sample code is to enhance your knowledge of the service and provide WCF introductions, not to describe all aspects of WCF or to establish a complete functional order processing system. The type and mechanism in the example will be described in detail in this book.

Contract

Obviously, service-oriented system development should first be to create a contract. For the simple example, an order contains a product ID, a quantity (quantity), and a status message. With these three fields, an order can be represented using the following pseudo schema code:

<Order>
  <ProdID>xs:integer</ProdID>
  <Qty>xs:integer</Qty>
  <Status>xs:string</Status>
</Order>

From our message autonomy and configuration address discussion, we know that messages require more address structures if we want to use ws-addressing. In our Order Processing service, message senders and receivers uniformly use SOAP messages that adhere to the Ws-addressing specification to restrict the structure of the message. With this rule, here is an example of a reasonably structured message:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap- envelope" xmlns:wsa="http://
schemas.xmlsoap.org/ws/2004/08/addressing">
  <s:Header>
     <wsa:Action  s:mustUnderstand="1">urn:SubmitOrder</wsa:Action>
     <wsa:MessageID>4</wsa:MessageID>
     <wsa:ReplyTo>
       <wsa:Address>  http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
       </wsa:Address>
     </wsa:ReplyTo>
     <wsa:To  s:mustUnderstand="1">http://localhost:8000/Order</wsa:To>
  </s:Header>
   <s:Body>
     <Order>
       <ProdID>6</ProdID>
       <Qty>6</Qty>
       <Status>order placed</Status>
     </Order>
  </s:Body>
</s:Envelope>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.