To create a soapRequest, you need to perform the following major steps:
Add a WSDL file to the Nexaweb application project
Create the soapRequest
Create a serviceRequest that uses the soapRequest
To add a Web Services Description Language (WSDL) file to a Nexaweb application project, copy a WSDL file for the web service to which you want to connect a Nexaweb application into the application's WebContent directory. You can access the project's WebContent directory through the Navigator view available from the Nexaweb Visual Java/Ajax Editing perspective.
To start creating a soapRequest from the WSDL file, follow these steps:
1. Right click on the file and select Open With > WSDL Editor.
The WSDL Editor displays a graphical view of the file.
2. In the Outline view, click + beside Port Type folder to expand it.
3. Click + beside a Port Type to view its methods.
4. Right click on a method and select Nexaweb > Create SOAP Request.
The Create New Web Service Request wizard starts.
To complete the soapRequest, see the following section on Creating a soapRequest.
To create a soapRequest, follow these steps:
1. Start the Create New Web Service Request wizard, either:
|
Method |
Description |
|
From WSDL file |
In the Nexaweb perspective, drag the WSDL file from the Navigator view onto the UI file. This launches the Create New Web Service Request wizard with some of the WSDL file settings completed. |
|
- Right click in the UI file and select Data > Create Service Request, or - Click New beside DataRequestID. - Select soapRequest and click Next. |
|
From nexaweb- |
- In the Navigator view, double click on the nexaweb-webservices.xml file (in WebContent/WEB-INF/dataservice) to open it. - Select the Definitions tab. - Click Add. - Specify an ID for this soapServiceDefinition. - Specify the location of the WSDL file to use with this soapServiceDefinition or click Browse to search for it. - Select the Requests tab and click Add. - Select soapRequest and click Finish. Note: The Web Service Requests Configuration tab contains the same fields as the New Web Service Request wizard. |
|
|
|
2. Complete the Create New Web Service Request dialog as follows:
Note: If you started from the nexaweb-webservices.xml file, you see the Web Services Request Configuration tab.
|
|
ID: Nexaweb Studio automatically assigns each soapRequest an ID of soapRequest, with a suffix incremented by one for each additional request of this type created. (Except on The Web Services Request Configuration tab.) Keep the assigned ID or specify your own. Nexaweb Studio uses this ID to identify this soapRequest in the nexaweb-webservices.xml file, and to identify the dataRequestDefinition in the nexaweb-data.xml file that references this soapRequest. GetNameSpaceFromWsdl: Specifies whether Nexaweb Studio adds namespace information to body elements when creating the soapRequest. True by default if you do not make a selection. Click the arrow to select true or false. Select false if you know the WSDL service does not require namespace information. GetTypesFromWsdl: Specifies whether Nexaweb Studio adds type information to body elements when creating the soapRequest. True by default if you do not make a selection. Click the arrow to select true or false. Select false if you know the WSDL service does not require type information. WebServiceID: Select an existing soapServiceDefinition to use for this request or click New. New: Creates a soapServiceDefinition for this SOAP service, by which you can reference it in a serviceRequest. WSDL Services: Click the arrow to select the service provided by this WSDL file to use for this soapRequest. (Nexaweb Studio automatically populates this field.) WSDL Bindings: Click the arrow to select the binding associated with the Port Type to use for this soapRequest. The binding specifies the protocol and data format specifications for the port type.(Nexaweb Studio automatically populates this field on the Web Services Request Configuration tab based on the Port Type operation selected.) WSDL Operations: Click the arrow to select the operation associated with the selected binding to use for this soapRequest. (Nexaweb Studio automatically populates this field on the Web Services Request Configuration tab based on the Port Type operation selected.) |
Click Next.
The Create Sub Elements for Web Service Request dialog appears.
3. Complete the Create Sub Elements for Web Service Request dialog as follows.
|
|
Form: Displays the possible message parts of the selected operation for which you can supply values. Nexaweb Studio populates the fields available on the Form tab from the selected WSDL file. EndPointAddress: Specifies the URL location of the web service to handle this request. Header: Click the arrow to display a text box in which you can specify the elements that make up the header portion of the SOAP request, if any. (Typically added to the request during pre-processing.) SoapActionsUri: Specifies the Uri of the operation this request executes. (Nexaweb Studio automatically populates this field based on the Port Type/WSDL operation selected.) |
4. Click Finish.
This creates a soapRequest in the nexaweb-webservices.xml file and a dataRequestDefinition in the nexaweb-data.xml file that references this soapRequest as a serviceResourceReference.
If you specified this soapRequest from the Create New Web Service Request wizard, the ID of the soapRequest that you created appears in the DataRequestID field in the Create serviceRequest dialog. Go to Step 4 to finish creating a serviceRequest that uses this soapRequest.
If you specified this soapRequest from the Web Service Requests Configuration tab, click Save.
If you specified this soapRequest from the Web Service Requests Configuration tab or from the WSDL file, to get to the Create ServiceRequest dialog:
- Right click in the UI file and select Data > Create Service Request. This launches the Create Service Request wizard.
- Select serviceRequest and click Next.
The Create serviceRequest dialog appears.
5. Complete Create ServiceRequest dialog as follows:
|
|
DataRequestID: Click the arrow to select the ID of an existing dataRequestDefinition ID or soapRequest. ID: Specifies an ID for this serviceRequest. Nexaweb Studio automatically creates an ID of serviceRequest with a suffix incremented by one for each additional serviceRequest that you create, or you can specify your own. onFailure\onSuccess: Optionally, specify an MCO or Macro to run when the request fails or succeeds. Click Advanced to create one. For more information on creating an event, see Connecting Business Logic to the User Interface. Target: Specify an existing document data source through which you can bind this data to the UI, or click New to create one. Nexaweb Studio copies the data from the data base to the document data source for use in the UI. For more information on creating a document data source, see Creating a Data Source. Optional Arguments: Click Add to specify a parameter for this serviceRequest. Specify the parameter name in the Name field and a value for this parameter in the Value field. |
6. Click Finish.
Nexaweb Studio adds the serviceRequest to the UI file and displays the name of this serviceRequest under the Service Requests folder in the Data view.