Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 5.89 KB

DEMO.md

File metadata and controls

103 lines (79 loc) · 5.89 KB

Introduction

Motivation

Monolithic application

In software engineering, a monolithic application describes a single-tiered software application in which the user interface and data access code are combined into a single program from a single platform.

System integration

In engineering, system integration is defined as the process of bringing together the component sub-systems into one system (an aggregation of subsystems cooperating so that the system is able to deliver the overarching functionality) and ensuring that the subsystems function together as a system. In information technology, systems integration[2] is the process of linking together different computing systems and software applications physically or functionally,[3] to act as a coordinated whole.

World wide web

  • Designed for human-application interactions
  • No support for application-application interactions

Web services

  • Enables applications to expose their services "programmatically", i.e. the services can be invoked by programs
  • Enables software running on other computers (could be a desktop, mobile phone, etc.) to invoke operations exposed by Web applications
  • Built on top of underlying protocols and mechanisms for web (e.g., HTTP)

Scenarios for web services

Allowing programmatic access to applications accessed over the Internet

  • B2B integration – allowing applications from different organizations to communicate across the Internet
  • A2A integration – allowing applications within an organization to communicate across an intranet

Web Services Technology

Two competing approaches REST-style vs SOAP-based.

SOAP

It uses XML Information Set for its message format, and relies on application layer protocols, most often Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission.

SOAP specification can be broadly defined to be consisting of the following 3 conceptual components: Protocol concepts, encapsulation concepts and Network concepts.

  • XML: Describing information sent over the network (Envelope, [Header], Body, [Fault])
  • WSDL: Defining Web service capability (Web Services Description Language)
  • SOAP: Accessing Web services (Simple Object Access Protocol)
  • UDDI: Finding web services

REST

Representational state transfer (REST) or RESTful Web services are one way of providing interoperability between computer systems on the Internet. REST-compliant Web services allow requesting systems to access and manipulate textual representations of Web resources using a uniform and predefined set of stateless operations. In a RESTful Web service, requests made to a resource's URI will elicit a response that may be in XML, HTML, JSON or some other defined format.

Design philosophy

  • Everything on the web is a resource with a URI
  • HTTP is not just a transport protocol
  • It provides an API (POST, GET, PUT, DELETE) for Create, Read, Update, and Delete operations on a resource
  • Approach isolates application complexity at the end points (client and server) and keeps it out of the transport

Demo

Consuming a SOAP web service

Console client

  • Add Service Reference parses the WSDL of the service to import the service contract, and potentially any referenced domain types, into the client's representation (in this case, C#). It generates a proxy which exposes a C# interface that represents the service contract. The proxy is a namespace and set of classes with methods to call each service method for the particular endpoint.

      In short it takes service contract metadata and reifies it to C#.
      
      You can also manually generate the proxy with 'svcutil.exe'
    
      svcutil http://server.com/FooService/FooService.svc /out:FooProxy.cs
      Or to include generation of the app.config as well
    
      svcutil http://server.com/FooService /out:FooProxy.cs /config:App.config
    
  • Customize endpoint

Soap UI

Key-value store library

Simple in-memory key value store Library, for educational purpose only :)

Possible improvements:

  • Tests
  • Nuget

Creating a simple WCF Service

Windows Communication Foundation (WCF) is Microsoft’s unified programming model for building service-oriented applications.

New project

Visual Studio 2015: File / Add / New Project... / WCF Service Application

  • Bindings (basicHttpBinding / webHttpBinding)
  • Endpoints
  • Data contract

WCF can be hosted in IIS or self-hosted in any managed .NET application.

Web service example

Creating a simple WebApi service

ASP.NET Web API is a framework for building web APIs on top of the .NET Framework. Basically, a Web API controller is an MVC controller, which uses HttpMessageResponse as the base type of its response, instead of ActionResponse. UPDATE: For ASP.NET Core, Web API has been integrated into the MVC 6 project type and the ApiController class is consolidated into the Controller class.

  • Response: JSON / XML
  • Swagger
  • Postman

Tools

Resources