Tutorials > Web services > Define a User Registration Web Service

< Previous | Next >


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.


Procedure

  1. 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.

  2. Right-click the MyCompany folder and select New > Other.

  3. In the Select a wizard dialog box, select Web Services > WSDL and click Next.

  4. 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.

  5. In the Options dialog box, specify http://www.mycompany.com/ as Target namespace and myco as Prefix.

  6. Do not change the rest of the default values. Click Finish to create the WSDL file.

  7. To complete the Web service definition:

    1. In the WSDL Editor, delete the default schema in the Types section by right-clicking the schema and selecting Delete.

    2. In the Services section, do the following:

      1. Expand the MyCompany-CustomerServices service to view the binding information.

      2. Rename the port from MyCompany-CustomerServicesSOAP to CustomerServices.

      3. Expand the port to reveal the soap:address information.

      4. 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.

    3. In the Bindings section, do the following:

      1. In the editor window, expand the CustomerServices binding.

      2. Rename the NewOperation operation to SyncCustomer.

      3. Expand SyncCustomer.

      4. Select input in the editor window. In the Name field, type SyncCustomer.

      5. Select output in the editor window. In the Name field, type ConfirmBOD.

    4. In the Port Types section, do the following:

      1. Rename the MyCompany-CusomterServices port type to MyCompany-CustomerServicesPortType.

      2. Expand MyCompany-CustomerServicesPortType.

      3. Rename the NewOperation operation to SyncCustomer. This should link the operation found in the CustomerServices binding with this operation.

      4. Expand SyncCustomer.

      5. Select input in the editor window and do the following in the Properties window:

        1. In the Name field, type SyncCustomer.

        2. Click ... to the right of the Message field.

        3. 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.

      6. Select output in the editor window and do the following in the Properties window:

        1. In the Name field, type ConfirmBOD.

        2. Click ... to the right of the Message field.

        3. 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.

    5. In the Bindings section, select CustomerServices and change the port type to myco:MyCompany-CustomerServicesPortType.

    6. In the Messages section, delete SyncCustomerResponse and SyncCustomerRequest by right-clicking and selecting Delete.

    7. In the Messages section, expand ConfirmBOD messages and click the Properies tab.

      1. Select the ConfirmBOD part.

      2. Ensure that Element is selected in the Reference kind field.

      3. Click ... to the right of the Element field.

      4. Select Import Element from a file and click Browse.

      5. Select WebContent > xsd > OAGIS > 9.0 > BODs > Developer > ConfirmBOD.xsd and click OK.

      6. Select ConfirmBOD from the list and click Finish.

    8. In the Messages section, expand SyncCustomer messages and click the Properies tab.

      1. Select the SyncCustomer part.

      2. Ensure that Element is selected in the Reference kind field.

      3. Click ... to the right of the Element field.

      4. Select Import Element from a file and click Browse.

      5. Select WebContent > xsd > OAGIS > 9.0 > Overlays > MyCompany > BODs > SyncCustomerType.xsd and click OK.

      6. Select SyncCustomer from the list and click Finish.

    9. Save the work and close the WSDL Editor.

    After the preceding 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 the WSDL document is correct by comparing the source code of the WSDL document with the source code of MyCompany-CustomerServices.wsdl in the sample zip file.

< Previous | Next >


+

Search Tips   |   Advanced Search