Tutorial: Defining a User Registration Web Service >
Define the WSDL
This section describes how to expose the SyncCustomer schema as a Web service. The Web service defined in this tutorial is a customer service which is represented by the SyncCustomer message. Furthermore, this Web service will respond with an OAGIS ConfirmBOD that contains an acknowledgement that a customer was created.
To create the blank WSDL document:
- Under the WebContent/wsdl folder of the WebServicesRouter project, create a folder to contain the WSDL document. Right-click the wsdl folder and select New > Folder. In the Folder name field, type MyCompany, Click Finish.
- Right-click the MyCompany folder and select New > Other.
- In the Select a wizard dialog box, select Web Services > WSDL and click Next.
- In the New WSDL File dialog box, ensure that the MyCompany folder is highlighted. In the File name field, type MyCompany-CustomerServices.wsdl and click Next.
- In the Options dialog box, specify http://www.mycompany.com/ as Target namespace and myco as Prefix.
- Do not change the rest of the default values. Click Finish to create the WSDL file.
To complete the Web service definition:
- In the WSDL Editor, delete the default schema in the Types section by right-clicking the schema and selecting Delete.
- In the Services section...
- Expand the MyCompany-CustomerServices service to view the binding information.
- Rename the port from MyCompany-CustomerServicesSOAP to CustomerServices.
- Expand the port to reveal the soap:address information.
- Select soap:address in the editor window and, in the Properties window, change the value of the location property to http://localhost/webapp/wcs/services/CustomerServices. This URL is used to access the services defined by this WSDL document. The name of the binding in step 2b defines this URL which connects to the Web service.
- In the Bindings section...
- In the editor window, expand the CustomerServices binding.
- Rename the NewOperation operation to SyncCustomer.
- Expand SyncCustomer.
- Select input in the editor window. In the Name field, type SyncCustomer.
- Select output in the editor window. In the the Name field, type ConfirmBOD.
- In the Port Types section...
- Rename the MyCompany-CusomterServices port type to MyCompany-CustomerServicesPortType.
- Expand MyCompany-CustomerServicesPortType.
- Rename the NewOperation operation to SyncCustomer. This should link the operation found in the CustomerServices binding with this operation.
- Expand SyncCustomer.
- Select input in the editor window and do the following in the Properties window:
- In the Name field, type SyncCustomer.
- Click ... to the right of the Message field.
- In the Specify Message dialog that opens, ensure Create a new message is selected, type SyncCustomer in the Name of message field, and click Finish.
- Select output in the editor window and do the following in the Properties window:
- In the Name field, type ConfirmBOD.
- Click ... to the right of the Message field.
- In the Specify Message dialog that opens, ensure Create a new message is selected, type ConfirmBOD in the Name of message field, and click Finish.
- In the Bindings section, select CustomerServices and change the port type to myco:MyCompany-CustomerServicesPortType.
- In the Messages section, delete SyncCustomerResponse and SyncCustomerRequest by right-clicking and selecting Delete.
- In the Messages section, expand ConfirmBOD messages and click the Properies tab.
- Select the ConfirmBOD part.
- Ensure that Element is selected in the Reference kind field.
- Click ... to the right of the Element field.
- Select Import Element from a file and click Browse.
- Select WebContent > xsd > OAGIS > 9.0 > BODs > Developer > ConfirmBOD.xsd and click OK.
- Select ConfirmBOD from the list and click Finish.
- In the Messages section, expand SyncCustomer messages and click the Properies tab.
- Select the SyncCustomer part.
- Ensure that Element is selected in the Reference kind field.
- Click ... to the right of the Element field.
- Select Import Element from a file and click Browse.
- Select WebContent > xsd > OAGIS > 9.0 > Overlays > MyCompany > BODs > SyncCustomerType.xsd and click OK.
- Select SyncCustomer from the list and click Finish.
- Save your work and close the WSDL Editor.
After the above steps are complete, the WSDL Editor should show a Web Service definition similar to the one found below. Note the arrows which indicate how the differ parts of the Web Service definition are associated. You can verify that your WSDL document is correct by comparing the source code of your WSDL document with the source code of MyCompany-CustomerServices.wsdl in the sample zip file.