SOA & Web Services: Basic

Adopt from

[1] http://en.wikipedia.org/wiki/Service-oriented_architecture

[2] http://msdn.microsoft.com/en-us/library/byxd99hx(v=VS.90).aspx

[3] http://msdn.microsoft.com/en-us/library/ms996486.aspx


Developers may prefer object oriented programming nowadays. Instead of installing a piece of assemblies on the local computer, developers want to access the functionalilities hosted in the web directly. Here comes the idea of web service and service-oriented architecture (SOA).

SOA is a flexible set of design principles used during the phases of systems development and integration in computing. A system based on a SOA will package functionality as a suite of interoperable services that can be used within multiple, separate systems from several business domains [1]. In SOA, server will be responsible for the complex computation, and the clients only needs a simple software(e.g. the browser) for the output. In .net framework, we need to do the following in the simplest case:

1. Use the WebMethod attribute in the server side.

public class Service1 : System.Web.Services.WebService
{
    [System.Web.Services.WebMethod(BufferResponse=false)]
    public int Multiple(int a, int b)
    {
       //implementation code
       return (a*b);
    }
}

2. Compile the server code into assembly in WSDL

WSDL describes the complete contract for application communication [3].

3. Client downloads the assembly and imports the assembly into the project.

All networking codes will be generated automatically in the client side system for .Net and Java. This produces the interface using the proxy object, which has a concrete object in the remote server, for the developer to call.

本篇發表於 C# 並標籤為 , , , 。將永久鏈結加入書籤。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *