This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
In a wsdl we define the operation name, input and output in the portType element; later on in binding we define operation, input and output again. What is the rationale behind this? why define them twice? I understand in binding we define the encodingStyle and other attributes, so what is the need of portType?
A port type is an abstract definition of a set of interactions between two logical services. A binding is a concrete definition of how the messages used to implement the logical services will be instantiated in the physical world. Each binding is then associated with a set of network details that finish the definition of one endpoint that exposes the logical service defined by the port type.
Oracle certified JPA Developer (1Z0-898),Oracle certified Java 8 Programmer I (1Z0-808), Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I, CIW Certified Ecommerce specialist
Port type help you to define operations that a web service performs. These operations are unaware of transport protocol that we are going to use at runtime. So these operations are transport protocol agnostic.
Binding help you to define how these operation's request and response data is transported over the wire according to which SOAP version.
For example -
You have a web service which perform book query and return book name.
You have a set of Clients of your Web Service who want to call and consume web service operations through JMS protocol.
You can another set of Clients of your Web service who want to call and consumer Web service operations through HTTP protocol.
So for such requirement, it will be tedious ( and non - manageable) if we have to define and deploy two set of Web service to cater to these two different set of Client (JMS based client and HTTP based Client).
Therefore, Binding declaration help us in defining two ways to access web service operations - through JMS and through HTTP. So we have to deploy single Web Service but we expose two end point address of same web service - one end point address can be used by JMS based client and another end point address can be used by HTTP based client.