WSDL

As the name suggests, Web Service Description Language (WSDL) describes web services; in particular, it describes data types used (schemas), input and output messages, operations (methods), and binding and service endpoints:

Figure 9.6: WSDL structure

Although you don't necessarily need to understand the details of WSDL when creating web services in Java, it is good to know the basic structure of WSDL. WSDLs are typically meant to be produced and processed by programs, and developers are not expected to hand-code them. Here are some of the elements in WSDL:

  • definitions: This is the root element of WSDL.
  • Import: This element allows you to import elements from an external file. This way, you can make the WSDL file modular.
  • Types: This element defines the schema for different data types used in the WSDL.
  • Messages: This element defines the format of input and output messages exchanged between the web service and the client.
  • PortType: This defines methods or operations supported by the web service. Each operation in PortType can declare request and response messages. Operations in PortType refer to messages defined in a message element.

Although in Figure 9.6the binding element looks the same as PortType, it actually specifies the transport protocol bound to operations and message type (remote procedure call or document type) and encoding (encoded or literal) for messages of each operation declared in PortType. The typical transport protocol is HTTP, but it could be other protocols such as JMS and SMTP. The difference between the RPC and document types is that the RPC message type contains the name of the remote method in the message, whereas the document type does not contain the method name. The name of the method to process the payload in a document type message is either derived from the endpoint URL or from information in the header. However, there is another type called document wrapped, which does contain the name of the method as the enclosing element for the actual message payload.

The Service element contains the actual location of each web service endpoint.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.75.221