Creating a soapRequest to use in an embeddedServiceRequest

To create a soapRequest, you need to perform the following major steps:

Adding a WSDL File

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.

Creating a soapRequest as an embeddedServiceRequest

To create an embeddedServiceRequest with a soapRequest, follow these steps:

1. Either:

Right click in the UI file and select
Data > Create Embedded Service Request.

Select Tools > Create Embedded Service Request.

 The Create EmbeddedServiceRequest dialog appears.

2. Complete the Create EmbeddedServiceRequest dialog as follows:

image\img00293.gif

ID: Nexaweb Studio automatically assigns each embeddedServiceRequest an ID of embeddedServiceRequest with a suffix incremented by one for each additional embeddedServiceRequest created. Use the provided ID or enter 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.

Create Data Request/Specify Data Request:

  • Select Create Data Request to define a soapRequest using a wizard that prompts you for necessary components. Continue to the next steps in this procedure.

  • Select Specify Data Request to create a free form soapRequest. A text box becomes active at the bottom of the dialog. Enter a soapRequest and click Finish. This completes this procedure.
    Nexaweb Studio adds the embeddedServiceRequest to the UI file and displays its ID under the Embedded Service Requests folder in the Data view

 Click Next.
A dialog listing the request types appears.

image\img00294.gif

3. Select soapRequest and click Next.
The
Create New Web Service Request dialog appears.

4. Complete the Create New Web Service Request dialog as follows:

image\img00295.gif

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 request in the client UI file.

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.
ID: Specify an ID for this soapServiceDefinition..
WsdlLocation: Specify the location of the WSDL file to use for this soapRequest or click Browse to search for it. (Nexaweb Studio automatically populates this field on the Web Services Request Configuration tab.) Nexaweb Studio automatically populates the WSDL Location, Services, and Bindings fields under the WSDL Settings section of this dialog with information from the WSDL file you specify here.

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

WSDL Operations: Click the arrow to select the operation associated with the selected binding to use for this soapRequest.

 Click Next.
The
Create Sub Elements for Web Service Request dialog appears.

5. Complete the Create Sub Elements for Web Service Request dialog as follows.

image\img00296.gif

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

6. Click Finish.
Nexaweb Studio adds the embeddedServiceRequest to the UI file and displays the name of this embeddedServiceRequest under the Embedded Service Requests folder in the Data view.