Categories: TutorialWSDL

WSDL Binding Element

<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;" trbidi&equals;"on">&NewLine;<ul>&NewLine;<li>The <b>&lt&semi;binding&gt&semi;<&sol;b> element provides specific details on how a <i><b>portType <&sol;b><&sol;i>operation will actually be transmitted over the wire&period;<&sol;li>&NewLine;<li>The bindings can be made available via multiple transports&comma; including <i><b>HTTP GET&comma; HTTP POST&comma; or SOAP&period;<&sol;b><&sol;i><&sol;li>&NewLine;<li>The bindings provide concrete information on what protocol is being used to transfer <b><i>portType<&sol;i><&sol;b> operations&period;<br &sol;>&NewLine;The bindings provide information where the service is located&period;<&sol;li>&NewLine;<li>For <b><i>SOAP <&sol;i><&sol;b>protocol&comma; the binding is <b>&lt&semi;soap&colon;binding&gt&semi;<&sol;b>&comma; and the transport is <i><b>SOAP <&sol;b><&sol;i>messages on top of <i><b>HTTP <&sol;b><&sol;i>protocol&period;<&sol;li>&NewLine;<li>You can specify multiple bindings for a single <b><i>portType<&sol;i><&sol;b>&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<p>The binding element has two attributes &&num;8211&semi; the name attribute and the type attribute&period;<&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;binding name&equals;"HelloWorld&lowbar;Binding" type&equals;"tns&colon;HelloWorld&lowbar;PortType"&gt&semi;&NewLine;<&sol;pre>&NewLine;<p>&NewLine;The name attribute defines the name of the binding&comma; and the type attribute points to the port for the binding&comma; in this case the &&num;8220&semi;<i><b>tns&colon;HelloWorld&lowbar;PortType<&sol;b><&sol;i>&&num;8221&semi; port&period;<br &sol;>&NewLine;<b>SOAP Binding<&sol;b><&sol;p>&NewLine;<p><b>WSDL 1&period;1<&sol;b> includes built-in extensions for <b>SOAP 1&period;1<&sol;b>&period; This enables you to specify <b>SOAP <&sol;b>specific details&comma; including <b>SOAP <&sol;b>headers&comma; <b>SOAP <&sol;b>encoding styles&comma; and the <b>SOAPAction HTTP <&sol;b>header&period; The <b>SOAP<&sol;b> extension elements include&colon;<&sol;p>&NewLine;<p><b>soap&colon;binding<&sol;b><br &sol;>&NewLine;This element indicates that the binding will be made available via <b>SOAP<&sol;b>&period; The style attribute indicates the overall style of the <b>SOAP <&sol;b>message format&period; A style value of rpc specifies an <b>RPC <&sol;b>format&period;<&sol;p>&NewLine;<p>The transport attribute indicates the transport of the <b>SOAP <&sol;b>messages&period; The value <b><i>http&colon;&sol;&sol;schemas&period;xmlsoap&period;org&sol;soap&sol;http<&sol;i><&sol;b> indicates the <b>SOAP HTTP<&sol;b> transport&comma; whereas <i><b>http&colon;&sol;&sol;schemas&period;xmlsoap&period;org&sol;soap&sol;smtp<&sol;b><&sol;i> indicates the <b>SOAP SMTP<&sol;b> transport&period;<&sol;p>&NewLine;<p><b>soap&colon;operation<&sol;b><br &sol;>&NewLine;This element indicates the binding of a specific operation to a specific <b>SOAP <&sol;b>implementation&period; The <i><b>soapAction <&sol;b><&sol;i>attribute specifies that the <b>SOAPAction HTTP<&sol;b> header be used for identifying the service&period;<&sol;p>&NewLine;<div align&equals;'center' id&equals;"ads-id"><&sol;div>&NewLine;<p><b>soap&colon;body<&sol;b><br &sol;>&NewLine;This element enables you to specify the details of the input and output messages&period; In the case of <b>HelloWorld<&sol;b>&comma; the body element specifies the <b>SOAP <&sol;b>encoding style and the namespace <b>URN <&sol;b>associated with the specified service&period;<&sol;p>&NewLine;<p><b>Here is the piece of code from Example section<&sol;b>&colon;<&sol;p>&NewLine;<pre class&equals;"highlight" name&equals;"code">&lt&semi;binding name&equals;"HelloWorld&lowbar;Binding" type&equals;"tns&colon;HelloWorld&lowbar;PortType"&gt&semi;&NewLine; &lt&semi;soap&colon;binding style&equals;"rpc"&NewLine; transport&equals;"http&colon;&sol;&sol;schemas&period;xmlsoap&period;org&sol;soap&sol;http"&sol;&gt&semi;&NewLine; &lt&semi;operation name&equals;"sayHelloWorld"&gt&semi;&NewLine; &lt&semi;soap&colon;operation soapAction&equals;"sayHelloWorld"&sol;&gt&semi;&NewLine; &lt&semi;input&gt&semi;&NewLine; &lt&semi;soap&colon;body&NewLine; encodingStyle&equals;"http&colon;&sol;&sol;schemas&period;xmlsoap&period;org&sol;soap&sol;encoding&sol;"&NewLine; namespace&equals;"urn&colon;examples&colon;helloworldservice"&NewLine; use&equals;"encoded"&sol;&gt&semi;&NewLine; &lt&semi;&sol;input&gt&semi;&NewLine; &lt&semi;output&gt&semi;&NewLine; &lt&semi;soap&colon;body&NewLine; encodingStyle&equals;"http&colon;&sol;&sol;schemas&period;xmlsoap&period;org&sol;soap&sol;encoding&sol;"&NewLine; namespace&equals;"urn&colon;dineshonjava&colon;helloworldservice"&NewLine; use&equals;"encoded"&sol;&gt&semi;&NewLine; &lt&semi;&sol;output&gt&semi;&NewLine; &lt&semi;&sol;operation&gt&semi;&NewLine; &lt&semi;&sol;binding&gt&semi;&NewLine;<&sol;pre>&NewLine;<p><i><b>References<&sol;b><&sol;i><br &sol;>&NewLine;<i><b><a href&equals;"http&colon;&sol;&sol;en&period;wikipedia&period;org&sol;wiki&sol;Web&lowbar;Services&lowbar;Description&lowbar;Language" target&equals;"&lowbar;blank">Wikipedia for WSDL<&sol;a><&sol;b><&sol;i><&sol;p>&NewLine;<p>&nbsp&semi; <&sol;p>&NewLine;<div style&equals;"background-color&colon; pink&semi; border-width&colon; thin&semi; text-align&colon; center&semi;"><b>&lt&semi;&lt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;2013&sol;05&sol;wsdl-porttype-element&period;html">Previous<&sol;a> &lt&semi;&lt&semi;&nbsp&semi;&nbsp&semi; &vert;&vert; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;2013&sol;01&sol;core-java-baby-step-to-be-best-java-ian&period;html">Index <&sol;a>&vert;&vert; &nbsp&semi; &gt&semi;&gt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;2013&sol;05&sol;wsdl-ports-element&period;html">Next<&sol;a> &gt&semi;&gt&semi;<&sol;b><&sol;div>&NewLine;<&sol;div>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wsdl-porttype-element&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wsdl-ports-element&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '453'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design PatternsĀ using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago