Wednesday, August 24, 2016

Web Service

  • Communication platform between different or same platform applications that allow to use the web method.
  • Standardized XML messaging system. (Send and Response using XML)
  • Not tied to any OS and programming language. (Java can talk to C#, Windows can talk to Linux)
  • Visual studio using information of WSDL to create Proxy class to help (steps) :
    1. Serialize the parameters 
    2. Prepare SOAP request message 
    3. Send to Web Service.
    4. Web Service execute the method and return SOAP response message to proxy.
    5. Proxy deserialize soap message and hands in the application.
Component of Web Services
  • SOAP (Simple Object Access Protocol)
    • is a communication protocol between applications
    • is independent language and platform.
    • is an XML based messaging protocol for exchange information
  • UDDI (Universal Description, Discovery and Integration)
    • Is a specification for a distributed registry of web services.
    • create a standard platform enable company or application easy to find the web service.
    • Use WSDL to descrive the interfaces to web services.
  • WSDL (Web Services Description Language).
    • Standard format for describing web service
    • Describe all methods, parameters and return type.
    • A client program connecting to a web service can read WSDL to determine what functions available.
    • E.g. Operations, Type (Data Type), Binding, 
How Web Service Work
  • XML to tag the data
  • SOAP to transfer a message.
  • WSDL to describe the availability of service.
Windows Communication Foundation (WCF)
  • .NET 3.0
  • Use for distributed application ( Web Server + Web Service Server)
  • 1 Web service and configure many endpoint as support all client needs. (HTTP/TCP) (XML,Binary)
  • Serialization : Process of convert an object into XML
    • [Serializable] put in class , all property will be serialize. You cannot control only 1 property need to serialize.
    • [DataContract]  you can control which property need to include/exclude in serialization, and each of the property add [DataMember] - (you can define name, order, required
  • DataControl very limit control the SOAP message, MessageContract give full control.
  • MessageContract 
    • Use to tweak the structure of the soap XML Message.
    • include custom information in the SOAP header E.g. User Credential, license key, session keys and etc.
    • Change name of the wrapper element in SOAP Message.
    • Encrypt message and paramater. Use ProtectionLevel named parameter.

No comments:

Post a Comment