Java Reference
In-Depth Information
In the types section, the data types composing the messages to be exchanged are defined.
These are defined using an XML schema. The message part defines the messages that the
service supports. A message is made up of one or more parts, which can serve as either in-
put or output. The port type defines a group of operations (think interface). Each operation
must have a unique name and contain a combination of input and output elements and ref-
erence the message elements. The binding section connects the port types (interfaces) with
an actual protocol such as SOAP. The service section exposes the bindings as services and
defines the endpoints.
Don't worry if this doesn't make sense initially. There are multiple levels of abstraction.
After writing a couple of WSDL documents, it'll make much more sense.
Web service strategies
When implementing a new web service, you must write two artifacts: a WSDL file defining
the service and a Java class implementing the service. If complex data is being exchanged,
a schema file defining the data constructs must also be created and referenced from the
WSDL. With the WSDL and schema file, a client for the web service can be auto-generated
by tools. For example, Java's wsimport can generate the Java code necessary to invoke
a web service given a WSDL from Java. Similar tools exist for other languages and plat-
forms—creating a SOAP client is a fairly standard task.
Focusing on the two main artifacts—WSDL and the Java implementation—you can take
several different approaches. The approach taken can be made for each web service inde-
pendently—it's not a binary decision for an entire project. The approaches are illustrated in
figure 8.4 .
Search WWH ::




Custom Search