Hi All,

I have done some testings on this area for that I created an apex class[1]
to create an account in salesforce and tested with simple java client using
WSDL file and it works fine and can able to extract the common information
from WSDL (attached).

Our next step will create the connector based on the information extracted
from WSDL. But we can only create the synapse template configuration which
is general. Another challenge is the authentication part so we plan to
create the init as the separate module  because it will not same to all
connectors.

[1]

global class ConnectorAutomation{
    global class RequestClass{
        webService String accountName;
    }
    global class ResponseClass{
        webService String responseResultID;
        webService String responseResultName;
        webService String responseResultRecordType;
    }
    webService static ResponseClass addAccount(String name){
        Account acct = new Account();
        acct.Name = name;
        insert acct;
        ResponseClass resClass = new ResponseClass();
        resClass.responseResultID = acct.Id;
        resClass.responseResultName = acct.Name;
        resClass.responseResultRecordType = acct.AccountNumber;
        return resClass;
    }
}



On Wed, Sep 21, 2016 at 10:41 AM, Malaka Silva <mal...@wso2.com> wrote:

> Yes Kasun this is what our end goal is. We are starting this with soap
> based services. Also great if you can share any work done to speed up our
> r&d.
>
> @Ajanthan
> ​ - Yes we are currently planning to have this a command line tool,
> however this is not yet finalized.​
>
> On Wed, Sep 21, 2016 at 2:09 AM, Kasun Indrasiri <ka...@wso2.com> wrote:
>
>> Hi Malaka,
>>
>> We did a PoC project on generating a connector based on a given Swagger
>> definition. Is this a similar requirement?
>>
>> On Tue, Sep 20, 2016 at 10:51 AM, Ajanthan Balachandran <
>> ajant...@wso2.com> wrote:
>>
>>> What do you mean by a tool? Is it command line tool  or maven plugin or
>>> eclipse plugin?
>>>
>>> On Fri, Sep 9, 2016 at 2:07 AM, Rajjaz Mohammed <raj...@wso2.com> wrote:
>>>
>>>>
>>>> Hi,
>>>>>
>>>>> ​We have currently 150+ connectors in store
>>>>> <https://store.wso2.com/store/>. Using those we can easily build
>>>>> integration use cases with WSO2 ESB.
>>>>>
>>>>> However there are some apis that resides on premises and specific to
>>>>> some users. If we need to integrate such services, we either need to
>>>>> manually do the integration with ESB or develop a connector and use it.
>>>>>
>>>>> The idea of this project is to automate the development of connectors
>>>>> that makes the integration tasks more productive.
>>>>>
>>>>> So we are planning to start this with soap based connectors and move
>>>>> to rest based support later.
>>>>>
>>>>> For soap based connector generation we basically need to parse the
>>>>> wsdl and generate a connector operation per soap operation.
>>>>>
>>>>> For that we can use WSDL4J. Using this we can get the required
>>>>> operations and request/response messages required. Using this information
>>>>> we can build the connector operations.(Sequence Templates)
>>>>>
>>>>> eg:
>>>>> String wsdlPath = "/home/wso2/Desktop/ConnectorTest.wsdl";
>>>>> WSDLReader reader = javax.wsdl.factory.WSDLFactory
>>>>> .newInstance().newWSDLReader();
>>>>> javax.wsdl.Definition defn = reader.readWSDL(wsdlPath);
>>>>>
>>>>> Map <javax.xml.namespace.QName , ServiceImpl>tmp =
>>>>> defn.getAllServices();
>>>>>
>>>>> for(javax.xml.namespace.QName  key:tmp.keySet()){
>>>>> ServiceImpl serviceImpl = tmp.get(key);
>>>>> Map <String,PortImpl> mPorts = serviceImpl.getPorts();
>>>>> for(String k1:mPorts.keySet()){
>>>>> PortImpl portImpl = mPorts.get(k1);
>>>>> List<BindingOperationImpl> bindingOperations =
>>>>> portImpl.getBinding().getBindingOperations();
>>>>> for(BindingOperationImpl bindingOperation:bindingOperations){
>>>>> System.out.println("operation:" + bindingOperation.getName());
>>>>> BindingInput bindingInput = bindingOperation.getBindingInput();
>>>>> }
>>>>> }
>>>>> }
>>>>> Map messages = defn.getMessages();
>>>>> Iterator msgIterator = messages.values().iterator();
>>>>> while (msgIterator.hasNext()){
>>>>> Message msg = (Message)msgIterator.next();
>>>>> if (!msg.isUndefined()) {
>>>>>      System.out.println(msg.getQName());
>>>>> }
>>>>> }
>>>>> Thoughts?
>>>>>
>>>>>
>>>> Hi All,
>>>>
>>>> I have the plan to implement ESB connector auto-generation tool. Plase
>>>> add if anything more to above explanation about the tool.
>>>>
>>>> Best Regards,
>>>>>
>>>>> Malaka Silva
>>>>> Senior Technical Lead
>>>>> M: +94 777 219 791
>>>>> Tel : 94 11 214 5345
>>>>> Fax :94 11 2145300
>>>>> Skype : malaka.sampath.silva
>>>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>>>> Blog : http://mrmalakasilva.blogspot.com/
>>>>>
>>>>> WSO2, Inc.
>>>>> lean . enterprise . middleware
>>>>> https://wso2.com/signature
>>>>> http://www.wso2.com/about/team/malaka-silva/
>>>>> <http://wso2.com/about/team/malaka-silva/>
>>>>> https://store.wso2.com/store/
>>>>>
>>>>> Don't make Trees rare, we should keep them with care
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thank you
>>>> Best Regards
>>>>
>>>> *Rajjaz HM*
>>>> Associate Software Engineer
>>>> Platform Extension Team
>>>> WSO2 Inc. <http://wso2.com/>
>>>> lean | enterprise | middleware
>>>> Mobile | +94752833834|+94777226874
>>>> Email   | raj...@wso2.com
>>>> LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
>>>> <http://rajjazhm.blogspot.com/> | WSO2 Profile
>>>> <http://wso2.com/about/team/mohammer-rajjaz/>
>>>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> Architecture@wso2.org
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Ajanthan
>>> Software Engineer;
>>> WSO2, Inc.;  http://wso2.com/
>>>
>>> email: ajanthan <http://goog_595075977>@wso2.com; cell: +1 425 919 8630
>>> blog: http://bkayts.blogspot.com/
>>>
>>> Lean . Enterprise . Middleware
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Kasun Indrasiri
>> Director, Integration Technologies
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> cell: +1 650 450 2293
>> Blog : http://kasunpanorama.blogspot.com/
>>
>> _______________________________________________
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Technical Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> https://wso2.com/signature
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
> https://store.wso2.com/store/
>
> Don't make Trees rare, we should keep them with care
>
> _______________________________________________
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
Thank you
Best Regards

*Rajjaz HM*
Associate Software Engineer
Platform Extension Team
WSO2 Inc. <http://wso2.com/>
lean | enterprise | middleware
Mobile | +94752833834|+94777226874
Email   | raj...@wso2.com
LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger
<http://rajjazhm.blogspot.com/> | WSO2 Profile
<http://wso2.com/about/team/mohammer-rajjaz/>
[image: https://wso2.com/signature] <https://wso2.com/signature>
<?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="name" 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>
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to