Search Here

SERVER-SIDE DEVELOPMENT SOAP 1

Home / SERVER-SIDE DEVELOPMENT SOAP 1

SERVER-SIDE DEVELOPMENT SOAP 1 SERVER-SIDE DEVELOPMENT SOAP 1 SERVER-SIDE DEVELOPMENT SOAP 1

SERVER-SIDE DEVELOPMENT SOAP 1

Spread the love

As my previous articles, this also separated in to four parts.

1. Introduction to the web services

2. WSDL

3. SOAP

4. Implement SOAP services

Web services are server-side application components, which provides a set of services. The services of the web service are exposed via an API

-modular, well-defined, encapsulated interfaces are used for loosely coupled integration between applications or systems. Loosely coupled architecture, and interacts with client-side components via the API. Multiple types of clients can communicate with the web-service via the API.

                  Web Applications             Web Services
• User-to-program interaction  • Program-to-program interaction  
• Static integration of components  • Dynamic integration of components  
• Monolithic service  • Service aggregation (micro-services)  
• Ad hoc or proprietary protocol• Interoperability (RPC/SOAP/REST)

What is WSDL? WDSL stand for “WEB SERVICE DESCRIPTION LANGUAGE”. WSDL is an XML vocabulary for describing Web services allowing developers to describe Web Services and their capabilities, in a standard manner.

There are three main fundamental properties in WSDL,

• What a service does – operations (methods) provided by the service

• How a service is accessed – data format and protocol details

• Where a service is located – Address (URL) details

The document written in WSDL is also simple called a WSDL (or WSDL document). WSDL is a contract between the XML (SOAP) Web service and the client who wishes to use this service. The service provides the WSDL document and the Web service client uses the WSDL document to create the stub (or to dynamically decode messages).

In this diagram shows that elements of WSDL document.

Definitions – Include the definitions of one or more services.

Types   – Giving the details of any complex data types used in the WSDL document. When       using simple types, then no need type section in the document.

Message          – It means like abstract definition of the data that you communicating.

Operation – It’s like abstract description of the action that helps to the service. .

PortType – An abstract set of operations supported by one or more endpoints. I’s means define web service functionality at abstract level grouping sets of message exchanges into operations contain a set of operations that incorporates input, output and fault messages and parameter order. WSDL supports at least a single input and output message, but permits the declaration of an arbitrary number of faults. PortType element may have one or more operation elements, each of which defines an RPC- or document-style Web service method

Java equivalence:

• PortType -> java interface

• Operation -> method name

Binding     – It’s defines how the operation is running by through concrete protocol and data                 format specifications for the operations and messages. Map a PortType to a specific protocol, typically SOAP over http, using a specific data encoding style one portType can be bound to several different protocols by using more than one port. Bindings refer back to portTypes by name, just as operations point to messages. Binding styles may be either “RPC” or “Document”(SOAP) and also specify SOAP encoding.

Port – Defines a single endpoint as an address for the binding, thus defining a single communication endpoint.

Service – Describes the port addresses of the binding. The service is a set of network endpoints or ports. It binds the Web service to a specific network-addressable location, it takes the bindings declared previously and ties them to a port, which is a physical network endpoint to which clients bind over the specified protocol. Contain one or more port elements, each of which represents a different Web service and the port element assigns the URL to a specific binding. Reference a particular binding, and along with addressing information is wrapped together into a service element to form the final physical, network addressable Web service,

• Access point for each port

– Port type – The operations performed by the web service.

– Message – The messages used by the web service.

– Types – The data types used by the web service.

– Binding – The communication protocols used by the web service.

What is SOAP? Its stand for “SIMPLE OBJECT ACCESS PROTOCOL”. SOAP supports both functional oriented and message oriented communication. And SOAP combines the data capabilities of XML with the transport capability of HTTP.

Then let’s move on to the messaging modes in SOAP.

RPC enables SOAP messages to model calls to procedures or method calls with parameters and return values. In document mode, the document is placed directly as a child of the Body element.

SOAP messages – consistent envelope – header and body

    – consistent data encoding – based on XML Schema type system

    – protocol binding framework

Envelope – wraps entire message and contains header and body defines an overall framework for expressing what is in a message; who should deal with it, and whether it is optional or mandatory

Header – optional element with additional info such as security or routing

Body – application specific message content being communicated as arbitrary XML payloads in the request and response messages. Fault element provides information about errors that occurred while processing the message.

And there are some elements in SOAP message oriented communication.

ENVELOPE – Envelope is a root (or top-level) XML element that acts as a container for the header and body elements and is associated with the namespace,

HEADER – headers are really just extension points where elements from other namespaces can be included, headers can contain arbitrary XML. This is optional but, if present, it must be the immediate child of the Envelope element, and precede the Body element. And header adds meta-data about the content of a SOAP message and extends it with extra information, such as routing, security, transactions, etc. to support the transfer of the application content.

ATTACHMENTPART – SOAP messages may have one or more attachments each AttachmentPart object has a MIME header to indicate the type of data it contains. It may also have additional MIME headers to identify it or to give its location, which can be useful when there are multiple attachments. When a SOAP message has one or more AttachmentPart objects, its SOAP Part object may or may not contain message content.

There are so many frameworks used for SOAP web service developing.

  • Apache Axis – JAVA/C++
  • Apache Axis2 – JAVA
  • Apache CXF – JAVA
  • Symfony2 – PHP
  • Zend Framework – PHP
  • Windows Communication Foundation – .NET

Let’s move on to the annotations in JAX-WS, few of them are

            •@WebService

•@WebMethod

•@OneWay

•@WebParam

•@WebResult

Then let’s see how a web service can be tested using different approaches. There are four main approaches.

  1. WSDL-Based Test Case Generation Approaches
  2. Mutation-Based Test Case Generation Approaches
  3. Test Modeling Approaches
  4.  XML-Based Approaches

WSDL-Based Test Case Generation – Test data are generated from WSDL message definition based on XML schema data types. There are four main data types, simple data type, complex data type, aggregated data type and user-derived data type. Test cases are operate based on analysis of its associated parameters (messages). From dependency analysis, operation flows can be generated to test a sequence of operations. There are three main dependencies, input dependency, output dependency and input/output dependency.

                Test specification generation is to finally encode the test cases in XML files. With the levels, multiple test cases can be operate to test the service including individual operations. And composite operations from both positive and negative perspectives as well.

Mutation-Based Test Case Generation Approaches – Mutation testing is taken as a very powerful tool dependent testing technique but it is too costly. It is a pleasant way of using large number of test requirements for ensuring quality. On the other hand it also need of heavy automation. It is considered costly because of the high number of requirements it creates compared to other testing techniques and it is tool dependent for the same reason.

So I hope u got a good knowledge about the related topics. Will meet in the next article SERVER-SIDE DEVELOPMENT SOAP  part 2.

REFERENCES

https://en.wikipedia.org/wiki/Web_Services_Description_Language
https://en.wikipedia.org/wiki/List_of_web_service_frameworks

Leave A Comment