How to build SOAP services based on an XML Schema Definition
SOAP services can be constructed many different ways. One way is to build a service based on your own schema, rather than on Process Commander definitions. Building a SOAP service this way enables the generated WSDL file to reference the original XML schema document (XSD).
The XML parse and stream rules that are generated upon the importing of an XSD document contain references to that XSD file, which will then be referenced by the WSDL generated for your service.
Building a SOAP Service from a third-party schema is a multi-step process. First, import the schema into Process Commander. Next, write a SOAP service based on the rules generated by the schema import.
Importing the third-party schema
To import a third-party schema:
- Import the XSD file. In the toolbar, navigate to Application > Import > XML Schema. The Connector Configuration Wizard displays.
Select a Ruleset Name, Ruleset Version, and the class in which to save rules related to the import of the schema. Click Next > >.
- Provide the URL of the XSD you want to import. Click Next > >.
- Select the elements you want to generate rules for. Click Next > >.
- Click the Select All button to generate all five rule types. Click Next > >.
- Click Finish to generate all the rules.
Create the SOAP service
In the class generated by the XSD import, create a new SOAP Service. To create a new SOAP service, complete the following steps which are described below:
- Create a new Service Package
- Create a new SOAP Service based on the Service Package
- Edit the previously created Service Package
To create a new Service Package:
- Navigate to Integration-Resources > Service Package. In the New Instance of a Rule dialog, enter a name for the service package and click Create. In this example, the name of the Service Package is Globex.
- On the Context tab, select the Access Group you would like to associate with this Service Package. Save the Service Package.
Create a new SOAP Service using the Service Package you just created.
- Navigate to Integration-Services > Service SOAP. Complete the New Instance of a Rule dialog.
- Complete the Service tab of the SOAP Service. Complete the Page Class and Activity Name fields.
- On the Request tab, make the following changes to the Request Parameters section:
- Select the XML Literal Data type.
- Select the XML ParseRule Map To value.
- Select the XML ParseRule created during the XSD import process. You will need to supply both the second and third key parts.
- Navigate to the Response tab of the SOAP Service. In the Response Parameters section, make the following changes:
- Select the XML Literal Data type.
- Select the XML Stream Map To value.
- Select the Map To Key to the XML Stream rule generated during the XSD import process.
Save the SOAP Service.
- Navigate to the Service Package you created earlier. On the Methods tab, select the Rule-Service-SOAP Service Type and click Show Service Methods.
- On the Deployment tab, select the WSDL Deployment Type and the class that your Service rule is saved in as the Service Class. Click the Generate Deployment Files button. A WSDL file for your SOAP service has been generated. Click the link to view the WSDL file.
The WSDL was generated using a third-party schema. Notice the namespace and schemaLocation attributes in the <xsd:import> elements. Message components within the WSDL have also been changed to refer to the element declarations defined in the imported XSD file.
<xsd:import namespace ="http://www.w3schools.com"