Search code examples
web-serviceswsdl

WSDL elements relationships


I am reading through the web to understand clearly the WSDL and the elements composing WSDL. Is there a pictorial representation of how the WSDL elements namely definitions, types, portTypes, port, message, operation, binding and services are related?

For example I understand that if I want to describe a service say calculator; it can do several operations say add, substract, divide and multiply.

So I define portType (calculator) abstract entity that identifies the operations it can perform (add, substract, divide and multiply). I can then have a binding element that describes how this interface is implemented over different concrete protocols (HTTP, SMTP etc.)

1> So can I have 2 bindings that specify same "calculator" portTypes one using HTTP and another using SMTP? Can a single WSDL define multiple services (say calculator, unit converter etc)?

2> Is there a pictorial/descriptive representation of co-relationship between the WSDL elements (definitions, types, portTypes, port, message, operation, binding and services)?

3> If my portType describes the operations involved in a service; how is it different then the service element?

Here are the web links I am trying to formulate my ideas from. These are very helpful but I am trying to get a clear picture of how the WSDL components are related.

References:

http://www.w3.org/TR/wsdl.html
http://msdn.microsoft.com/en-us/library/ms996486.aspx
http://khanna111.com/wordPressBlog/2013/11/21/248/
http://www.w3schools.com/webservices/ws_wsdl_documents.asp

Solution

  • 1> So can I have 2 bindings that specify same "calculator" portTypes one using HTTP and another using SMTP?
    

    Yes.

    Can a single WSDL define multiple services (say calculator, unit converter etc)?
    

    Yes you can. But both services will be published on different URL, so what will be the point?

    2> Is there a pictorial/descriptive representation of co-relationship between the WSDL elements (definitions, types, portTypes, port, message, operation, binding and services)?
    3> If my portType describes the operations involved in a service; how is it different then the service element?
    

    I have described these in this post, you can refer WSDL Details