Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rationale behind portType, binding in wsdl

 
John Hyde
Greenhorn
Posts: 10
Java Oracle Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just found this excellent diagram which show structure of WSDL file. Thought of sharing it here so that future aspirant can understand WSDL structure in better way.
http://download.oracle.com/otn_hosted_doc/jdeveloper/1012/web_services/ws_wsdlstructure.html

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic