1. A client application requests a URI (universal resource identifier) using a SOAP-encoded message.
2. The Web server realizes the requested URI is a Web service and passes the request to your application (normally through an application server directly for .Net).
3. Your application services the request and passes it back to the Web server.
4. The Web server sends a response to the requester with the results of your Web service encoded in SOAP format in the body.
|
The WSDL specification offers a system-independent way for your application to say, "If you want to talk to me, here's how you have to do it." System independence comes from writing the definition in an XML-formatted file. The SOAP (Simple Object Access Protocol) specification, on the other hand, lets your application communicate with client applications. WSDL says, "When you call me, you should have X, Y and Z." SOAP is how X, Y and Z get to the application, and how it returns its response.
Most SOAP exchanges take place over HTTP, and most Web services define HTTP as their "transport mechanism," but this is by no means required. WSDL can set any of several transport mechanisms as the way to call your application and how your applications can respond. For example, you may have a Web services client that says, "Close out the books for the year," and sends the request over HTTP. A year-end close-out is no trivial task, and obviously you're not going to wait with your Web browser for the task to end. Therefore the application may say in WSDL, "If we're closing out the books, the response mechanism will be SMTP; I'll send an e-mail to the boss letting him know when we're done."
Server stubs are the small pieces of code that tell the application server about your application and let the server communicate with your app. Client stubs tell the client application about your interfaces in a system-dependent manner--they are generated from WSDL, which is system-independent, so think of them as the clients' translation of your interfaces into their programming language.
You can create a WSDL file for Web services by using one of many free applications. "Java2wsdl" (from Apache.org) for Java Web services and "WSDL.exe" for .Net Web services are the two most popular generators and will take a written application and generate the WSDL file for it. From this WSDL file you can then generate server and client stubs to use with projects to deploy and access your Web services.
Web services consist of a calling specification, an interface specification, a response specification and the program that does the work.