我使用的是lomboz-wtp-emf-gef-jem-3.1.2的Eclipse插件,开源的项目。 一、Importing a WSDL file - Select your project in the J2EE Navigator pane, and from the File menu, select Import.
- Select File System and click Next.
- Click the Browse button on the next page of the wizard to select the directories from which you would like to add the WSDL.
- In the import selection panes, use the following methods to select exactly the resources you want to add:
- Expand the hierarchies in the left pane and select or clear the checkboxes that represent the folders in the selected directory. Then in the right pane, select or clear checkboxes for individual files.
- Click Filter Types to filter the current selection for files of a specific type.
- Click Select All to select all resources in the directory, then go through and deselect the ones that you do not want to add.
- Click Deselect All to deselect all resources in the directory, then go through and choose individual resources to add.
- Specify the Workbench project or folder that will be the import destination.
- When you have finished specifying your import options, click Finish.
二、Creating a new WSDL file - Create a project to contain the WSDL document. It does not matter what kind of project you create.
- In the workbench, click File > New > Other > Web Services > WSDL. Click Next.
- Select the project or folder that will contain the WSDL file. In the File name field, type the name of the WSDL file, for example MyWSDLFile.wsdl. The name of your XML file must end in .wsdl
- Click Next.
- Enter the following information:
- Target namespace is the namespace for the WSDL file or accept the default (http://www.example.org/MyWSDLFile/). The target namespace is used for the names of messages and the port type, binding and service defined in the WSDL file. The value must take the form of a valid URI (for example, http://www.mycompany.com/myservice/)
- The Prefix is the prefix associated with the target namespace.
- Select Create WSDL Skeleton if you want the wizard to create the skeleton of the WSDL file. This will generate the WSDL elements required for your service, including bindings, ports and messages. You can then modify these to meet the requirements of your Web service.
- If you have chosen to create a WSDL skeleton, select the binding options you want to use in the WSDL document. The options are SOAP and HTTP. If you select SOAP you can then select the encoding style you want to use. If you select HTTP you can select whether to create an HTTP getter or setter.
- Click Finish. The WSDL file opens in the WSDL editor.
services, which are used to aggregate a set of related ports. These are the root elements of all WSDL files.
ports, which specify an address for a binding, thus defining a single communication endpoint.
bindings, which specify concrete protocol and data format specifications for the operations and messages defined by a particular port type.
port types, which are a set of abstract operations. Each operation refers to an input message and output messages.
operations, which refer to input and output messages
messages, which represent an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system.
parts, which are a flexible mechanism for describing the logical abstract content of a message
types, which describe all the data types used between the client and server. WSDL is not tied exclusively to a specific typing system, but it uses the W3C XML Schema specification as its default choice.
import statements, which are used to associate a namespace with a document location
|