This documentation applies to older versions of WSO2 ESB connectors. To find the documentation relevant to the version you are using, select the connector from the WSO2 Connector Store and click Documentation.

All docs This doc
Skip to end of metadata
Go to start of metadata

Though it is easy to use connectors in the ESB, building such connectors take a reasonable amount of time and effort. The object of this project is to reduce that by introducing an automated tool for generating connectors for ESB. The  Connector Auto Generator is capable of generating connectors for Soap web services by using valid WSDL specifications.


 WSDL Specification 

WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME. More...

Example WSDL definition
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Web Services API : ConnectorAutomation
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/ConnectorAutomation" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://soap.sforce.com/schemas/class/ConnectorAutomation">
 <types>
  <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/ConnectorAutomation">
   <xsd:element name="AllowFieldTruncationHeader">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="CallOptions">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="client" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="DebuggingHeader">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="categories" minOccurs="0" maxOccurs="unbounded" type="tns:LogInfo"/>
      <xsd:element name="debugLevel" type="tns:LogType"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:complexType name="LogInfo">
    <xsd:sequence>
     <xsd:element name="category" type="tns:LogCategory"/>
     <xsd:element name="level" type="tns:LogCategoryLevel"/>
    </xsd:sequence>
   </xsd:complexType>
   <xsd:simpleType name="LogCategory">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="Db"/>
     <xsd:enumeration value="Workflow"/>
     <xsd:enumeration value="Validation"/>
     <xsd:enumeration value="Callout"/>
     <xsd:enumeration value="Apex_code"/>
     <xsd:enumeration value="Apex_profiling"/>
     <xsd:enumeration value="Visualforce"/>
     <xsd:enumeration value="System"/>
     <xsd:enumeration value="All"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="LogCategoryLevel">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="None"/>
     <xsd:enumeration value="Finest"/>
     <xsd:enumeration value="Finer"/>
     <xsd:enumeration value="Fine"/>
     <xsd:enumeration value="Debug"/>
     <xsd:enumeration value="Info"/>
     <xsd:enumeration value="Warn"/>
     <xsd:enumeration value="Error"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="LogType">
    <xsd:restriction base="xsd:string">
     <xsd:enumeration value="None"/>
     <xsd:enumeration value="Debugonly"/>
     <xsd:enumeration value="Db"/>
     <xsd:enumeration value="Profiling"/>
     <xsd:enumeration value="Callout"/>
     <xsd:enumeration value="Detail"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:element name="DebuggingInfo">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="debugLog" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="SessionHeader">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="sessionId" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:simpleType name="ID">
    <xsd:restriction base="xsd:string">
     <xsd:length value="18"/>
     <xsd:pattern value="[a-zA-Z0-9]{18}"/>
    </xsd:restriction>
   </xsd:simpleType>
   <xsd:complexType name="ResponseClass">
    <xsd:sequence>
     <xsd:element name="responseResultID" minOccurs="0" type="xsd:string" nillable="true"/>
     <xsd:element name="responseResultName" minOccurs="0" type="xsd:string" nillable="true"/>
     <xsd:element name="responseResultRecordType" minOccurs="0" type="xsd:string" nillable="true"/>
    </xsd:sequence>
   </xsd:complexType>
   <xsd:complexType name="address">
    <xsd:complexContent>
     <xsd:extension base="tns:location">
      <xsd:sequence>
       <xsd:element name="city" type="xsd:string"/>
       <xsd:element name="country" type="xsd:string"/>
       <xsd:element name="countryCode" type="xsd:string"/>
       <xsd:element name="geocodeAccuracy" type="xsd:string"/>
       <xsd:element name="postalCode" type="xsd:string"/>
       <xsd:element name="state" type="xsd:string"/>
       <xsd:element name="stateCode" type="xsd:string"/>
       <xsd:element name="street" type="xsd:string"/>
      </xsd:sequence>
     </xsd:extension>
    </xsd:complexContent>
   </xsd:complexType>
   <xsd:complexType name="location">
    <xsd:sequence>
     <xsd:element name="latitude" type="xsd:double"/>
     <xsd:element name="longitude" type="xsd:double"/>
    </xsd:sequence>
   </xsd:complexType>
   <xsd:element name="addAccount">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="value1" type="xsd:string" nillable="true"/>
      <xsd:element name="value2" type="xsd:string" nillable="true"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="addAccountResponse">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element name="result" type="tns:ResponseClass" nillable="true"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
  </xsd:schema>
 </types>
 <!-- Message for the header parts -->
 <message name="Header">
  <part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader"/>
  <part name="CallOptions" element="tns:CallOptions"/>
  <part name="DebuggingHeader" element="tns:DebuggingHeader"/>
  <part name="DebuggingInfo" element="tns:DebuggingInfo"/>
  <part name="SessionHeader" element="tns:SessionHeader"/>
 </message>
 <!-- Operation Messages -->
 <message name="addAccountRequest">
  <part element="tns:addAccount" name="parameters"/>
 </message>
 <message name="addAccountResponse">
  <part element="tns:addAccountResponse" name="parameters"/>
 </message>
 <portType name="ConnectorAutomationPortType">
  <operation name="addAccount">
   <input message="tns:addAccountRequest"/>
   <output message="tns:addAccountResponse"/>
  </operation>
 </portType>
 <binding name="ConnectorAutomationBinding" type="tns:ConnectorAutomationPortType">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="addAccount">
   <soap:operation soapAction=""/>
   <input>
    <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
    <soap:header use="literal" part="CallOptions" message="tns:Header"/>
    <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
    <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
    <soap:body use="literal" parts="parameters"/>
   </input>
   <output>
    <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
    <soap:body use="literal"/>
   </output>
  </operation>
 </binding>
 <service name="ConnectorAutomationService">
  <documentation/>
  <port binding="tns:ConnectorAutomationBinding" name="ConnectorAutomation">
   <soap:address location="https://ap2.salesforce.com/services/Soap/class/ConnectorAutomation"/>
  </port>
 </service>
</definitions>

Pre-Setup for Automation tool

To run the tool you need to have the Automation_tool.zip file and Maven. you can get Automation_tool.zip from here.

Please verify you have tool jar the archetype resource in the Automation tool directory

Folder structure
|-archetype-resources
|-org.wso2.carbon.extension.esb.connector.automation-1.0.0.jar


Use Connector Generator

  • Navigate to the Automation tool directory through the console which is you extracted from the Automation_tool.zip file
  • To run the automation tool excute the tool jar file from the same directory through the terminal.
                     java -jar org.wso2.carbon.extension.esb.connector.automation-1.0.0.jar
  • Select your input source eg:- WSDL or Swagger (Currently it will only support with custom WSDL )
                  eg:- 1
  • Enter the path of the WSDL file
                    eg:- /../../Automation_tool/ConnectorAutomation.wsdl
  • Next select the authentication method if you need additional authentication method(Current development only support with salesforce authentication which means the tool will generate the synapse template for authentication) or select No authentication to generate the connector without the additional authentication method.
                    eg:-1

Now you have completed the connector development 


Test the connector

After generating the connector we will get the source code of the connector. Source code will contain the resource for the test case but you can ignore the test case if you don't want.

Build the connector then upload the connector to ESB and use the operations

 

14
15
16
60
62
63
66
67
70
71
666
669
701
708
800
832
835
173
180
36
41
40
  • No labels