Design > Designing Service Connectors > Option 2: Generating a Service Connector by Importing a File
  

Option 2: Generating a Service Connector by Importing a File

You can import a Web Service Definition Language (WSDL) file, a Swagger 2.0 JSON file, or an OpenAPI 3.0 JSON or YAML file to create an Application Integration service connector.

Creating a Service Connector from a WSDL File

You can import a WSDL file to easily create a service connector with multiple operations. Use the New Service Connector from WSDL wizard to import a WSDL file and create a service connector. After you specify the WSDL file, Application Integration parses the file and loads the operations.
If an error occurs during import, the wizard displays the error under Error/Warnings on the Progress tab. You can take corrective actions and import the WSDL file again.
    1In Application Integration, click New on the left navigation bar.
    The New Asset dialog box appears.
    The following image shows the New Asset dialog box:
    The image shows the New Asset dialog box.
    2Click Service Connectors > Service Connector from WSDL, and then click Create.
    The New Service Connector from WSDL dialog box appears with the WSDL Source tab open as shown in the following image:
    The image shows the WSDL Source tab in the New Service Connector from WSDL dialog box.
    3Specify a name, location, and description for the service connector.
    4In the WSDL File section, use one of the following options to specify the WSDL file that you want to import:
    5Click Next.
    The Services and Operations tab appears.
    The following image shows the Services and Operations tab:
    The image shows the Services and Operations tab.
    6From the Service Name list, select the service that you want to use from the imported WSDL file.
    The Service URL field displays the URL to which the service connector sends requests. You cannot edit this URL.
    7From the Service Port list, select the port that you want the service connector to use.
    8In the Operations section, select the operations that you want the service connector to provide.
    The operations that you select will be available as actions when you create a process and use the service connector.
    9Click Next.
    The Summary tab appears.
    The following image shows the Summary tab:
    The image shows the Summary tab.
    10Review the service connector configuration.
    11Click Start Import.
    Application Integration starts importing the WSDL file and displays the status on the Progress tab. The Progress tab indicates whether the import completed successfully, failed, or completed with warnings.
    The following image shows the Progress tab:
    The image shows the Progress tab.
    Note: If you close the dialog box or cancel the import, the import process stops and the service connector is not created.
    If the import fails or completes with warnings, click the Error/Warnings tab to understand why the import did not complete successfully. You can fix the issues and import the WSDL file again.
    The following image shows a successful import:
    The image shows a successful import.
    12Click Finish to review and save the service connector.

WSDL Files with Qualified Elements

If you have a WSDL file with user defined data types, you can add namespace prefixes and type names to create a WSDL file with qualified elements. You can use this WSDL file to create a service connector.
You can create a service connector from a WSDL file that contains user defined data types. Add namespace prefixes and type names to the user defined data to create a WSDL file with qualified elements. You can use this WSDL file to generate a service connector. The namespace prefix does not appear in the process object and you see a correct payload.
For example, consider a WSDL file that has the user defined elements RecordId and AddressComplete.
First, define a schema with the type name 'Address'. The following is a sample schema with a complexType name Address:
xs:complexType name="Address">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="RecordId" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="AddressComplete" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element minOccurs="0" maxOccurs="1" name="Address" type="tns:Address" />
Next, in the WSDL file, add the namespace prefix 'tns', as in the following sample:
<wsdl:message name="InputRequest">
<wsdl:part name="parameters" element="tns:Address" />
</wsdl:message>
<wsdl:portType name="AddressValidationSoap">
<wsdl:operation name="Process">
<wsdl:input message="tns:InputRequest" />
...
</wsdl:operation>
</wsdl:portType>
You can use this WSDL file to create a service connector. You will get an Address process object with two fields, RecordId and AddressComplete.

WSDL Files with Repeating Elements

You can create a service connector from a WSDL file with nested and repeating elements.
For example, consider the following WSDL and WSDL schema files with the nested, repeating elements 'shelf' and 'book':
This is an image of a WSDL schema file. It defines the book, shelf, and library elements.
You can use this WSDL and WSDL schema file to create a service connector using the WSDL to Service Connector tool. When you import the service connector, you see three process objects: Library, Shelf, and Book. When you select a parent object, you also see the nested object in the right side of the bottom panel.

elementFormDefault

You can use WSDL files that contain the elementFormDefault attribute in the WSDL schema.
The WSDL file can contain elementFormDefault="qualified" or elementFormDefault="unqualified".

Choice Elements

You can use choice schema elements to create a payload in a WSDL file.
Use the If element to show what should appear in the request.
The WSDL to Service Connector considers top level choice elements. This means that if a WSDL schema file has nested choice elements, the WSDL to Service Connector takes the first choice element.

Creating a Service Connector from a Swagger JSON File

You can import a Swagger 2.0 JSON file to easily create a service connector with multiple operations. Use the New Service Connector from Swagger wizard to import a Swagger JSON file and create a service connector. After you specify the Swagger JSON file, Application Integration parses the file and loads the operations.
If an error occurs during import, the wizard displays the error under Error/Warnings on the Progress tab. You can take corrective actions and import the Swagger JSON file again.
    1In Application Integration, click New on the left navigation bar.
    The New Asset dialog box appears.
    The following image shows the New Asset dialog box:
    The image shows the New Asset dialog box.
    2Click Service Connectors > Service Connector from Swagger, and then click Create.
    The New Service Connector from Swagger dialog box appears with the Swagger Source tab open as shown in the following image:
    The image shows the Swagger Source tab in the New Service Connector from Swagger dialog box.
    3Specify a name, location, and description for the service connector.
    4In the Swagger File section, use one of the following options to specify the Swagger JSON file that you want to import:
    5Click Next.
    The Services and Operations tab appears.
    The following image shows the Services and Operations tab:
    The image shows the Services and Operations tab.
    6In the Operations section, select the operations that you want the service connector to provide.
    The operations that you select will be available as actions when you create a process and use the service connector.
    7Click Next.
    The Summary tab appears.
    The following image shows the Summary tab:
    The image shows the Summary tab.
    8Review the service connector configuration.
    9Click Start Import.
    Application Integration starts importing the Swagger JSON file and displays the status on the Progress tab. The Progress tab indicates whether the import completed successfully, failed, or completed with warnings.
    The following image shows the Progress tab:
    The image shows the Progress tab.
    Note: If you close the dialog box or cancel the import, the import process stops and the service connector is not created.
    If the import fails or completes with warnings, click the Error/Warnings tab to understand why the import did not complete successfully. You can fix the issues and import the Swagger JSON file again.
    The following image shows a successful import:
    The image shows a successful import.
    10Click Finish to review and save the service connector.

Rules and guidelines for Swagger files

Consider the following rules and guidelines when you import a Swagger file to create a service connector:

Creating a Service Connector from a OpenAPI 3.0 File

You can import an OpenAPI 3.0 JSON or YAML file to easily create a service connector with multiple operations. Use the New Service Connector from OpenAPI 3.0 wizard to import a OpenAPI 3.0 file and create a service connector. After you specify the OpenAPI 3.0 file, Application Integration parses the file and loads the operations.
If an error occurs during import, the wizard displays the error under Error/Warnings on the Progress tab. You can take corrective actions and import the OpenAPI 3.0 file again.
    1In Application Integration, click New on the left navigation bar.
    The New Asset dialog box appears.
    The following image shows the New Asset dialog box:
    The image shows the New Asset dialog box.
    2Click Service Connectors > Service Connector from OpenAPI 3.0, and then click Create.
    The New Service Connector from OpenAPI 3.0 dialog box appears with the OpenAPI 3.0 Source tab open as shown in the following image:
    The image shows the OpenAPI 3.0 Source tab in the New Service Connector from OpenAPI 3.0 dialog box.
    3Specify a name, location, and description for the service connector.
    4In the OpenAPI 3.0 File section, use one of the following options to specify the OpenAPI 3.0 file that you want to import:
    5Click Next.
    The Service and Operations tab appears.
    The following image shows the Service and Operations tab:
    The image shows the Service and Operations tab.
    6From the Service URL list, select the endpoint that you want to use from the imported OpenAPI 3.0 file to create a service connector.
    7In the Operations section, select the operations that you want the service connector to provide.
    The operations that you select will be available as actions when you create a process and use the service connector.
    8Click Next.
    The Summary tab appears.
    The following image shows the Summary tab:
    The image shows the Summary tab.
    9Review the service connector configuration.
    10Click Start Import.
    Application Integration starts importing the OpenAPI 3.0 file and displays the status on the Progress tab. The Progress tab indicates whether the import completed successfully, failed, or completed with warnings.
    The following image shows the Progress tab:
    The image shows the Progress tab.
    Note: If you close the dialog box or cancel the import, the import process stops and the service connector is not created.
    If the import fails or completes with warnings, click the Error/Warnings tab to understand why the import did not complete successfully. You can fix the issues and import the OpenAPI 3.0 file again.
    11Click Finish to save the service connector.

HTTP Operations

You can import a Swagger file that contains the DELETE, PUT, POST, PATCH, and GET HTTP operations.
The service connector that you generate has actions corresponding to the HTTP operation is the Swagger file. If the Swagger file has multiple HTTP operations, the service connector will have multiple actions.
For example, if you use a Swagger file with a POST HTTP operation, you get a service connector with a POST action.
The following image shows a single POST HTTP operation within a Swagger file:
A Swagger file containing the HTTP operation. "Add Pet" is the operation ID.
The following image shows the action in service connector that you get when you use the preceding Swagger file:
You see that the Add Pet action corresponds to the verb POST.

JSON Payload

You can import a Swagger file with different types of JSON payloads. The Service Connector you generate reflects the JSON payload of the Swagger file.
The following table shows the JSON payload features that you can use, a sample Swagger excerpt, and the Input field of the corresponding service connector:
JSON Payload Feature
Sample Swagger Content
Service Connector Input Field
Lists of Objects
References
Single Select Enums
Simple types
Attachments
Lists of simple types
Multi Select Enums
Objects with References to Other Object Lists

Required and nullable elements

You can define process object fields as required and nullable in the WSDL, Swagger JSON, and OpenAPI 3.0 JSON or YAML files before you import the files to generate a service connector.
In a WSDL file, to define a field as nullable, set the nillable attribute to "true" in the field element. If you do not specify the nillable attribute, the field is set to not nullable by default. If you do not want to set a field as required, set the minOccurs attribute to "0" in the field element. If you do not specify the minOccurs attribute, the field is considered as required by default.
For example, consider a WSDL file that has a schema named ProcessObjectReq. The schema is of a complex type and contains two elements called as Name and ID. To set the ID field as nullable and not required, set the nillable attribute to "true" and the minOccurs attribute to "0" as shown in the following sample:
<xsd:complexType name=”ProcessObjectReq”>
<xsd:sequence>
<xsd:element name=”Name” nillable=”false” type=”xsd:string”/>
<xsd:element name=”ID” minOccurs=”0” nillable=”true” type=”xsd:integer”/>
</xsd:sequence>
</xsd:complexType>
When you import the WSDL file, the nullable and required field elements defined in the WSDL file are propagated to the process object as shown in the following image:
The image shows the required and nullable fields selection from the imported WSDL file.
Similarly, you can set the required and nullable field elements in the Swagger JSON file and create a service connector as shown in the following sample:
"definitions" : {
"Process1-3Request" : {
"type" : "object",
"required" : [ "Test" ],
"properties" : {
"Test" : {
"$ref" : "#/definitions"/ProcessObjectReq"
}
}
},
"ProcessObjectReq" : {
"type" : "object",
"properties" : {
"Name" : {
"type" : "string"
},
"ID" : {
"type" : "integer",
"format" : "int32"
}
},
"required": [
"Name"
],
"x-nullable":["ID"]
}
}
You can also set the required and nullable field elements in the OpenAPI 3.0 file and create a process object as shown in the following sample:
"ApiResponse": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32",
"required": true,
"nullable": false
},
},
...
If you use a process object with nullable fields in a process, and generate the Swagger JSON file for the process, the generated Swagger JSON file might not contain the x-nullable field defined in the process object. The field is set to not nullable by default. Therefore, Informatica recommends that you use a WSDL file or OpenAPI 3.0 file to preserve the nullable field values.
The following image shows the required and nullable fields selection from the imported Swagger JSON file:
The image shows the required and nullable fields selection from the imported Swagger JSON file.
When you use this process object in a process, the fields marked as required and nullable use the same restrictions in the generated WSDL file, Swagger file, and OpenAPI 3.0 file.