OpenLexicon and Web Services (Part 1) PDF Print E-mail

Before we start using the OpenLexicon web services, we need to make certain the server is properly installed and running. These first steps will test the server. In the subsequent steps we will explain the power of the LexiconConnectorService. As a side note: if you are not familiar with web services this tutorial is simple and explains many concepts of web services. You found a good place to start!

OpenLexicon and Web Services

 

Step 1: Test for presence of the OpenLexicon web service

 The Lexicon connector is only available on the full install of the OL server. If you need to install the server somewhere else please contact us.

 First create a directory for the torque.properties file.

Before you start the server you will need to create several environments for open Lexicon: TORQUE_PATH (for now, just create the environment variable) and LEXICON_USE_FAKE=Y. If you are using XP, create the environment variable in your advanced system information in the XP control panel.

 

Start the OL server and navigate to the Axis 2 page. It should be at http://localhost:8888/axis2/ or you might need to substitute the ‘localhost’ with the IP address of your OL server. You should see the Axis2 page for the server. Next click on the validate link (http://localhost:8888/axis2/axis2-web/HappyAxis.jsp). If it is properly operating you will see the words ‘Hello I am Axis2 version service …’ in the second line below the section titled ‘Examining Version Service’. 

Next, press the back arrow to the Axis2 home page and click on services. You should see a LexiconConnectorService at the top of the list. If you click on the LexiconConnectorService link you will see the WSDL associated with the service. If the WSDL looks proper, then proceed to the next step. Please note that you can download the WSDL at this point by viewing the page source (most browsers have a view->source) and copying the text into a file with a .WSDL extension. 

Step 2: Test for proper functioning

In this step you will test to determine that the LexiconConnectorService is running properly. You can reuse this test in any environment. The ‘fake’ mode is useful for debugging complex situations where you might have many wed services running. You will need a soap tester to complete this test. Any SOAP tester should be fine; however there is a good, open source WSDL tester at http://www.soapui.org/. From now on, the instructions will assume you are using this tool; however, you can follow along with any tool such as SoapScope or XML spy. 

Open your soap testing tool and load the WSDL. In SoapUI you will create a new project, save the project XML. Next load the WSDL from the URL. If you have installed the OpenLexicon server in the default port (8888) and you have a ‘localhost’ in your ETC.HOSTS file then the URL should be: http://localhost:8888/axis2/services/LexiconConnectorService?wsdl
In SoapUI, accept the default messages.

Next introspect the messages under ‘LexOperation’. You should see a message called Request 1. It looks like this:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lex="http://www.openlexicon.org/LexiconConnector">
  
<soapenv:Header/>

    <soapenv:Body>

      <lex:LexiconInterface>

         <lex:POJOType>?</lex:POJOType>

         <!--Optional:-->

         <lex:ErrorType>?</lex:ErrorType>

         <lex:ActionType>?</lex:ActionType>

         <lex:BusinessObjectType>?</lex:BusinessObjectType>

         <!--Optional:-->

         <lex:RuleSetName>?</lex:RuleSetName>

      </lex:LexiconInterface>

   </soapenv:Body>

</soapenv:Envelope>

 

Replace the <lex:ActionType>?</lex:ActionType> With <lex:ActionType>VALIDATE</lex:ActionType>

Submit the soap request. You should see the string ‘FAKE SUCCESS’ in the return message. Is should look like this: 

soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

   <soapenv:Header/>

   <soapenv:Body>

      <lex:LexiconInterface xmlns:lex="http://www.openlexicon.org/LexiconConnector">

         <lex:POJOType>?</lex:POJOType>

         <!--Optional:-->

         <lex:ErrorType>FAKE MODE SUCESS</lex:ErrorType>

         <lex:ActionType>VALIDATE</lex:ActionType>

         <lex:BusinessObjectType>?</lex:BusinessObjectType>

         <!--Optional:-->

         <lex:RuleSetName>?</lex:RuleSetName>

      </lex:LexiconInterface>

   </soapenv:Body>

</soapenv:Envelope>

Test a real business case!

If you have sucessfully completed these steps you are ready to run business rule as web services. The best way to learn more about the OpenLexicon WSDL is to take the OpenLexicon/Intalio tutorial.

 This simple introduction to BPM/SOA is published int the download/tutorials section.

 

 


OpenLexicon.org | Home arrow Documentation arrow Tutorials and Doc arrow OpenLexicon and Web Services (Part 1)
Home
News
FAQ
Downloads
Installation
Getting Started
Documentation
Forums
Training
Links
Licences
Customers & Partners
Contact Us
Login
Username

Password

Remember me
Lost Password?
No account yet? Register