Saturday, August 28, 2010

BPEL Designer for Apache ODE on Eclipse Helios

Last couple of years there has been very less interest in the BPEL Designer plugin for Eclipse IDE and hence the last it has been tested for is Eclipse Ganymede (3.4.x). Since then two more versions of Eclipse Galileo (3.5.x) and Helios (3.6.x) have been released. Some of the dependencies and packages have evolved with time. This has made it increasingly difficult to use BPEL Designer with the latest version of Eclipse.
Bob Brodt trying to breathe some life back into this project and hopefully build a usable editor and deployment toolset. Have a look at this. I still had to make Apache ODE work with BPEL and use the BPEL Designer plugin. So instead of waiting for M5 release here are some steps I took to make it work. Sadly, I do not have a test machine and I do not know which is the magic step :-( I just did a bunch of things in the same direction.

  1. Use Eclipse IDE for Java EE Developers Version: 3.6.x Helios release
  2. Use Apache ODE 2.0 beta 2 or higher
  3. Get BPEL plugin from the update site : http://download.eclipse.org/technology/bpel/update-site/ When I used it in Aug 2010 it was built and tested for Eclipse Ganymede (3.4.x) and was around version 0.4-0.5 stages
    1. Click Help –> Install New Software                                                                                                image       
    2. Add the following update site. Download the latest BPEL plugin, install and restart Eclipse                                                                                                    image
    3. Checked out all plugins from CVS for BPEL. Many companies block CVS ports. For me both 2401 was blocked while 443 and 80 were monitored for CVS traffic. I had to try this from home                                                        image
  4. Get all dependencies like
    • EMF Compare
    • Latest version of JSDT and WST
    • Changed file C:\Projects\org.eclipse.bpel\plugins\org.eclipse.bpel.examples.extensionPoints\META-INF\MANIFEST.MF to update dependencies :-
      • org.eclipse.wst.jsdt.core;bundle-version="1.1.0",
      • org.eclipse.wst.jsdt.ui;bundle-version="1.1.0"
    • I also removed a couple of WST dependencies to make it work since my WST was up to date.
  5. Install latest Tomcat version 6.0 or later (exe or zip) and drop the latest ODE file (>2.0 beta 2) ode.war into the webapps directory of Apache Tomcat
  6. To configure a launch configuration refer to the same manual section 2.2.2 You might have to increase the MaxPermSize in your eclipse settings. My settings in eclipse.ini were
    1. -Dosgi.requiredJavaVersion=1.5
      -Xms40m
      -Xmx512m

      --launcher.XXMaxPermSize
      512M

    1. Set up the Eclipse BPEL Designer with ODE using section 2.3
    2. Create a sample project using section 3
    3. Finally you can copy the modified bpel/plugins to eclipse/plugins and overwrite the files. This will eliminate the need to deploy an eclipse application to get to the BPEL Designer.
    Here are some screenshots. I will
    image
    image
    image
    image

    Thursday, August 19, 2010

    Transfer Contacts from one Cell Phone to another

    Amit has an article that shows how we can transfer contacts from one cell phone to another

    in reference to:

    "Transfer Contacts from one Cell Phone to another"
    - How to Transfer Contacts from one Cell Phone to another Phonebook (view on Google Sidewiki)

    Stop Adobe PDF security popup

    With the latest version of Adobe Reader you get a security popup for a PDF that is set to Auto-print. We have some iText generated PDFs that auto-print but recently started receiving the following pop-up:-

    To stop this popup you can add the hostname as a secure

    Spring:form bug creates invalid “id”

    Spring 3.0.1 inadvertently broke the indexed properties which are set by the form tag when “path” is used.

    eg.

    <c:forEach items="${continent.countries}" var="entry">
    <div>
    <form:input path="countries[${entry.key}]" />
    </div>
    </c:forEach>

     

    Spring 3.0.1 generates

    <div>
    <input type=”text” name="countries0" id=”countries0” value=”Belgium”></input>
    </div>

    Instead it should generate:-

    <div>
    <input type=”text” name="countries0" id=”countries[0]” value=”Belgium”></input>
    </div>

    Notice the brackets [ ] in the id. This results in failure in binding the values to the form. A JIRA issue has been raised for this: https://jira.springframework.org/browse/SPR-6871?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel#issue-tabs. The bug was fixed and released in Spring 3.0.4

    Wednesday, August 11, 2010

    Apache ODE : Headers as Abstract Message Parts

    The Apache ODE web site does not do a good job at explaining the “Headers as Abstrct Message Parts” method of handling the headers. I have explained here how you can define soap headers in the wsdl so the BPEL process expects them in the header and how you can parse these headers to get information.

    Basically if you follow the normal development pattern what you will end up with is http://www.mail-archive.com/axis-user@ws.apache.org/msg42282.html and you will end up with the error message :

    More than one part for message HelloWorldRequestMessage


    Referring to the base engine which is Axis 2 : http://wso2.org/library/2935 I modified my code to make the wsdl:input say:-



                <input>
    <soap:body parts="payload" use="literal" />
    <soap:header message="tns:HelloWorldRequestMessage" part="helloElement" use="literal"/>
    </input>



    The wsdl:operation was defined as:-



            <operation name="process">
    <input message="tns:HelloWorldRequestMessage" />
    <output message="tns:HelloWorldResponseMessage"/>
    </operation>



    And the wsdl:message was defined as:-



        <message name="HelloWorldRequestMessage">
    <part name="payload" element="tns:HelloWorldRequest"/>
    <part name="helloElement" element="tns:HelloElement"/>
    </message>



    The element was defined in the normal fashion:-



                <element name="HelloElement">
    <complexType>
    <sequence>
    <element name="username" type="string"/>
    <element name="role" type="string"/>
    </sequence>
    </complexType>
    </element>



     



    In the BPEL you retrieve the header from the input message which is mapped to HelloWorldRequestMessage



                <bpel:copy>
    <bpel:from variable="input" part="helloElement" />
    <bpel:to variable="output" part="payload"/>
    </bpel:copy>



    Input



      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://helloWorld"> 
      2:    <soapenv:Header> 
      3:     <hel:HelloElement> 
      4:         <hel:username>Admin</hel:username> 
      5:         <hel:role>SuperUserAccess</hel:role> 
      6:     </hel:HelloElement> 
      7:    </soapenv:Header> 
      8:    <soapenv:Body> 
      9:       <hel:HelloWorldRequest> 
     10:          <hel:input>?</hel:input> 
     11:       </hel:HelloWorldRequest> 
     12:    </soapenv:Body> 
     13: </soapenv:Envelope>


    Output



      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      2:     <soapenv:Body>
      3:          <HelloWorldResponse xmlns="http://helloWorld">
      4:                <username>Admin</username>
      5:                <role>SuperUserAccess</role>
      6:          </HelloWorldResponse>
      7:     </soapenv:Body>
      8: </soapenv:Envelope>
      9: 




    Code

    Saturday, August 07, 2010

    Apache ODE: Dynamic Headers (SOAP Headers)

    SOAP headers that are not declaed in WSDL bindings can be used in ODE. If messages are present in the SOAP header they will be used but there is no validation as in other case (Headers as Abstract Message Parts)
    I have attached the 2 test processes that I developed. They don’t have any fault handling at present but in production we need to handle faults since there can be no/different headers. Search for the part of code that says :-
                                                    <bpel:copy>
                                                                   <bpel:from>$input.payload//tns:input</bpel:from>
                                                                   <bpel:to variable="output" header="ConversationId"></bpel:to>
                                                    </bpel:copy>



    In this case it is copying the input variable and adding header to the SOAP output. Similarly in the other case it is parsing the required field from the header.


    Add header:-


    Input


      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://helloWorld">
      2:    <soapenv:Header/>
      3:    <soapenv:Body>
      4:       <hel:HelloWorldRequest>
      5:          <hel:input>Test</hel:input>
      6:       </hel:HelloWorldRequest>
      7:    </soapenv:Body>
      8: </soapenv:Envelope>
      9: 


    Output


      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      2:    <soapenv:Header>
      3:       <input xmlns="http://helloWorld">Test</input>
      4:    </soapenv:Header>
      5:    <soapenv:Body>
      6:       <HelloWorldResponse xmlns="http://helloWorld">
      7:          <tns:result xmlns:tns="http://helloWorld"/>
      8:       </HelloWorldResponse>
      9:    </soapenv:Body>
     10: </soapenv:Envelope>
     11: 


    Parse Header:-


    Input


      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hel="http://helloWorld">
      2:    <soapenv:Header>
      3:                 <hel:ConversationId>This header will be parsed to get this message</hel:ConversationId>
      4:    </soapenv:Header>
      5:    <soapenv:Body>
      6:       <hel:HelloWorldRequest>
      7:          <hel:input>?</hel:input>
      8:       </hel:HelloWorldRequest>
      9:    </soapenv:Body>
     10: </soapenv:Envelope>
     11: 





    Output


      1: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      2:    <soapenv:Body>
      3:       <HelloWorldResponse xmlns="http://helloWorld"> This header will be parsed to get this message </HelloWorldResponse>
      4:    </soapenv:Body>
      5: </soapenv:Envelope>
      6: 





    Code

    Free Developer tools

    • KDiff : KDiff3 is a graphical text difference analyzer for up to 3 input files, provides character-by-character analysis and a text merge tool with integrated editor. It can also compare and merge directories. Platform-independant.
    • Notepad++
    • soapUI
    • Badboy testing : http://www.badboy.com.au/
    • Hudson
    • 7Zip
    • Eclipse
    • TeamViewer
    • TightVNC
    • TortoiseSVN
    • grepWin
    • StExBar
    • skTimeStamps
    • Fiddler Web Debugger : http://www.fiddler2.com/Fiddler2/version.asp
    • tcpmon
    • TCPView
    • Dependency Walker
    • Debug View