wcf - Request/Response pattern in SOA implementation -


In some Enterprise-like projects (.NET, WCF) I saw that all service contracts accept a single request

Parameter and always Response :

  [DataContract] Public class CustomerRequest: RequestBase {[DataMember] Public long id {get; Set; }} [DataContract] Public Class Customer Response: ResponseBus {[Datamember] Public Customer Inphone Customer {Receive; Set; }}  

Where RequestBase / ResponseBase Both the service methods and proxy bodies are wrapped in trials / catches, common stuff like, Therefore the only way to check for errors is to look at ResponseBase.ErrorCode (which is computation).

I want to know how this technique is called and why it is better to pass than what is necessary as the method standards and passing the standard WCF reference / using the fault mechanism?

The pattern you are talking about is based on the first development on the contract It is not necessary that you use WCF Use the error block pattern in, you can still bring back the Faltexception to the customer instead of using the error XML block. The error block has been used for a very long time and therefore, many people are used to using it. Besides, other platform developers (for example, Java) are not familiar with fault exceptions, although this is an industry standard .

Request / Response pattern in SOA (Service Oriented Architecture) is very valuable. , And I recommend using it instead of making those methods which take in parameters and pass a value or object back when you start making your message, you will see the benefits. As previously mentioned, those contracts have evolved from First Development, where one message will first produce classes using XSDs and on the basis of XSDs. This process was used in the classic web services to ensure that all your datatype will be sorted properly in SOAP. With the advent of the WCF, the datacentrectorializer is more intelligent and it knows how to sort the types of types that are not properly sorted (e.g., array list, list etc.).

The benefits of the request-feedback pattern are:

  • You can get all your requests and responses from the base objects, where you can maintain consistency for general properties. (Error block example).
  • According to nature web services probably require less documentation. This pattern only allows this. For example Take a method like Public BusScheduleResponse GetBusScheduleByDateRange (BusDateRangeRequest request); What customers are required to pass in and what they are getting back, as well as when they build the request, they can see by default what is necessary and what is optional say in this request Carrier [Flag Enum] (Required), Startdate (Required), Endadet (Required), Pryorrange (Optional), Minsats Available (Options), etc.
  • When the user gets a response, then there may be a lot of data in comparison to the normal returning object. Use your imagination, block block, tracking information, whatever.
    Buscidular Response In the example, it can simply return multiple arrays of schedule information for multiple carriers.

Hope it helps

Do not be confused with one word of caution and think that I have my own [messagecontent] s I am talking about making your request and answer data are contracts. I just want to make sure that I am not confusing you. No one should make their own message contracts in WCF, unless they have a very good reason to do so.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -