OPAALS TOOLS

April 8th, 2009

We have deveoped OPAALS TOOLS, a set of tools developed in the OPAALs NeO project in order to validate the research done in the Applied methodologies for dynamic service composition task.

XLS2XML The tool has been created for the generation of XML documents and contract-in a more friendly. Does not exist in the market for a publisher of e-contract. This tool will also generate these documents, also validates its syntactic structure. In addition, documentation generated by the semantics of e-contract, and finally creates a base document that serves the Finder tool to generate the search forms.

The tool handles Finder search within each of the utilities, the contracts of providers of services, companies that come closest to our needs. The end user is, who sought in each of the services offered which include a charge of their own to the results of the search. The results shown from the parameters entered by the user are presented with a success rate. This ratio shows the coincidence with the data entered into the contracts offered by the companies served.

The project

OPAALS (Open Philosophies for Associative Autopoietic Digital Ecosystems) is a multi-disciplinary network of research excellence for developing the science and technology behind Digital Ecosystems.

Digital Ecosystems represent the next generation of Internet usage. Applicable to many fields, they will perhaps have the greatest effect in enabling Small and Medium-sized Enterprises (SMEs) to compete on the global stage. Based on open and low-cost peer-to-peer architectures, Digital Ecosystems represent the future of technical, social, and economic aspects of the connected world.Our Task

The Aragón Institute of Technology (ITA) is specialised in consultancy studies and product development (i.e. software engineering) for SMEs and companies in the Aragón region. The Advanced Laboratory for Legal and Business Applications in the Information Society from the University of Zaragoza (UniZar) represents the second main partner in this task. The task aims at describing contracts at a semantic level for dynamic service composition in the field of business negotiation and contractual automatisation processes in the DEs. Additionally, the task includes studies regarding negotiation processes between companies in a specific sector, the contractual relationships that the companies agree on, and the modes how they resolve their disputes. These conflicts may be solved through contractual mechanisms or through “not written” mechanisms, which are normally used in that specific sector. From an academic point of view, this research raises an interesting question, namely, to review the “custom” concept as a source of law in a background such as the DEs. Another interesting question is related to the business processes and the agreements reached by the companies in a specific sector, which is the need for a new culture of “collaborative competition” and its proper legal treatment. This issue is related to the interoperability concept, since any kind of cooperation between companies in the development of an activity, which is essential in our framework, has an impact on market competition, but has not yet a correct treatment by Law.

Reference: http://opaalstools.sourceforge.net/

Como desarrollar un adaptador que consume un web-service en el servENT v0.3.15

November 11th, 2008

Este tutorial muestra paso a paso cómo desarrollar un servicio que consume un web-service y desplegarlo en el servENT v0.3.15.

Desde el ITA queremos agradecer la colaboración ofrecida por Techideas en la elaboración de este ejemplo

Aspectos preliminares:

  • Debes tener Java 1.5
  • Debes tener el servent 0.3.15 ya instalado (puedes leer el tutorial asociado)
  • No puedes usar el DBEStudio
  • Puedes descargar todo el código fuente asociado desde nuestro CVS aquí
  • No puedes usar versiones recientes de AXIS ni otras librerías externas que no sean compatibles con las librerías que ya incluye el propio servENT en la carpeta common. Por este motivo, usaremos AXIS 1.2 para generar el adaptador
  • Debes tener el Web-service disponible mediante su descriptor WSDL

Generar el cliente con AXIS:

  • En primer lugar debemos tener acceso al WDSL del servicio. En nuestro caso, vamos a utilizar como ejemplo el servicio globalweather.  Copiaremos el fichero wdsl a nuestra carpeta
  • Seguidamente usaremos axis1.2 para generar el cliente, mediante el WSDL2JAVA, como sigue

java -classpath c://dbe_0_3_15//servent//common//axis-1.2.1.jar;:c://dbe_0_3_15//servent//common//log4j.jar;c://dbe_0_3_15//servent//common//commons-logging-1.0.3.jar;c://dbe_0_3_15//servent//common//commons-discovery-0.2.jar;c://dbe_0_3_15//servent//common//axis-jaxrpc-1.2.jar;c://dbe_0_3_15//servent//common//axis-wsdl4j-1.2-RC2.jar;c://dbe_0_3_15//servent//common//axis-saaj-1.2.1.jar org.apache.axis.wsdl.WSDL2Java globalweather.wsdl

  • Nos creará una carpeta NET con las clases, que moveremos a la carpeta src como código fuente del servicio
  • Seguidamente debemos crear la interfaz que nuestro servicio va a ofrecer, que en nuestro caso es un proxy del servicio de globalweather

public interface IITAGlobalWeather {

    public String getWeather(String city, String country)
            throws java.rmi.RemoteException;

}

  • A continuación debemos desarrollar el propio servicio:

public class ITAGlobalWeatherAdapter implements IITAGlobalWeather, Adapter {

private ServiceContext serviceContext;

private static final QName SERVICE_NAME = new QName(
“http://www.webserviceX.NET”, “GlobalWeather”);

public void destroy() {
System.out
.println(new Date() + ” :: ITAGlobalWeatherAdapter.destroy()”);
}

public void init(ServiceContext arg0) {
System.out.println(new Date() + ” :: ITAGlobalWeatherAdapter.init()”);
this.serviceContext = arg0;
}

public String getWeather(String city, String country)
throws RemoteException {
try {
System.out.println(new Date()
+ ” :: ITAGlobalWeatherAdapter.getWeather city ” + city
+ ” country ” + country);
String wsdlfilename = “globalweather.wsdl”;

URL wsdlURL = new File(serviceContext.getHome(), wsdlfilename)
.toURL();

ServiceFactory serviceFactory = null;
serviceFactory = (ServiceFactory) ServiceFactory.newInstance();
Service afs = (Service) serviceFactory.createService(wsdlURL,
SERVICE_NAME);
GlobalWeatherSoap port = (GlobalWeatherSoap) afs
.getPort(GlobalWeatherSoap.class);

System.out
.println(new Date()
+ ” :: ITAGlobalWeatherAdapter.getWeather Invoking getWeather…”);
String weather = port.getWeather(city, country);
System.out.println(new Date()
+ ” :: ITAGlobalWeatherAdapter.getWeather result ”
+ weather);
return weather;
} catch (Exception ex) {
ex.printStackTrace();
return (ex.getMessage());
} catch (Throwable t) {
if (t instanceof Error) {
Error err = (Error) t;
} else if (t instanceof Exception) {
Exception ex = (Exception) t;
}
System.out.println(t);
throw new RemoteException(t.getCause().toString(), t);
}

}
}

  • Seguidamente debemos generar el fichero para desplegar el servicio dentro del servENT:



 
    ITAGlobalWeather
    ITAGlobalWeatherSMID
    Global Weather by ITA
    org.dbe.ita.demos.globalweather.ITAGlobalWeatherAdapter
 

  • Por último, generaremos la estructura de carpetas necesaria y copiaremos la misma dentro de la carpeta deploy del servENT y lo iniciaremos:
  • itaglobalweather
    • classes
      • NET
      • org
    • globalweather.wdsl
    • deployment.xml
  • Ya sólo resta generar el cliente que lo consuma:

public class ITAGlobalWeatherClient {

    public void testGetWeather(IITAGlobalWeather myService) {
        try {
            System.out.println(”\tInvoking getWeather…”);
            String city = “Madrid”;
            String country = “Spain”;
            String weather = myService.getWeather(city, country);
            System.out.println(”\tInvoked OK!”);
            System.out.println(”\tReturn ” + weather);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void test(String machine, String smid) {
        try {
            System.out.println(”\tTesting on machine ” + machine);
            System.out.println(”\tCreating ClientHelper…”);
            ClientHelper helper = new ClientHelper(new URL(”http://” + machine
                    + “:2728″));
            System.out.println(”\tGetting services with smid ” + smid + ” …”);
            String[] clase = new String[] { smid };
            Object proxies = helper.getProxies(IITAGlobalWeather.class, clase,
                    10000L, 13);

            if (proxies instanceof ArrayList) {
                ArrayList myList = (ArrayList) proxies;
                System.out.println(”\tWe have found ” + myList.size()
                        + ” services…”);
                for (int i = 0; i < myList.size(); i++) {
                    IITAGlobalWeather myService = (IITAGlobalWeather) myList
                            .get(i);
                    testGetWeather(myService);
                }
            } else {
                System.out.println(”\tNo services were found”);
            }
        } catch (Exception ex) {
            System.out.println(”\tERROR -> ” + ex.getMessage());
            ex.printStackTrace();
        }
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
        try {
            // Proxy Settings
            // System.setProperty(”http.proxySet”, “true”);
            // System.setProperty(”http.proxyHost”, “XXXX”);
            // System.setProperty(”http.proxyPort”, “8080″);

            String serventHost = “localhost”;
            // String SMID = “SM-8f41c086245468400ee359bdc7e117525f01f2ac-1″;
            String SMID = “ITAGlobalWeatherSMID”;

            ITAGlobalWeatherClient myClient = new ITAGlobalWeatherClient();
            myClient.test(serventHost, SMID);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

}

  • Y tendremos la traza correcta:

    Testing on machine localhost
    Creating ClientHelper…
    Getting services with smid ITAGlobalWeatherSMID …
log4j:WARN No appenders could be found for logger (org.sun.dbe.ClientHelper).
log4j:WARN Please initialize the log4j system properly.
    We have found 1 services…
    Invoking getWeather…
    Invoked OK!
    Return

  Madrid / Cuatro Vientos, Spain (LEVS) 40-23N 003-47W 687M
  Nov 11, 2008 - 02:30 AM EST / 2008.11.11 0730 UTC
  Calm:0
  3 mile(s):0
  42 F (6 C)
  42 F (6 C)
  100%
  30.21 in. Hg (1023 hPa)
  Success

Material Code-Camp

November 10th, 2008

Se ha celebrado un code-camp para analizar los siguientes pasos a realizar para desplegar los web-services en el servENT. El material suministrado es:

  • Presentación realizada
  • Tutoriales disponibles en nuestro blog
    • Cómo instalar el servENT v0.3.15 en Windows
    • Cómo crear y desplegar un HelloWorld Service en el servent v0.3.15
    • Cómo consumir un servicio desplegado en el servENT v0.3.15
    • Desplegar un servicio web en Mule
  • Ejemplos y código fuente de los mismos, disponible en nuestro CVS

Cómo consumir un servicio desplegado en el servENT v0.3.15

November 10th, 2008

Este tutorial muestra paso a paso cómo desarrollar un cliente que consuma un servicio que ha sido desplegado en el servENT v0.3.15

Aspectos preliminares:

  • Debes tener Java 1.5
  • Debes tener el servent 0.3.15 ya instalado (puedes leer el tutorial asociado)
  • No puedes usar el DBEStudio
  • Puedes descargar todo el código fuente asociado desde nuestro CVS aquí

Desarrollo del cliente:

  • Debes copiar en el proyecto la interfaz que cumple el servicio que quieres consumir:

package org.dbe.demos.itahelloworld0315;

import javax.xml.rpc.holders.StringHolder;

public interface IITAHelloWorld {

public String sayHello(String message) throws java.rmi.RemoteException;

public StringHolder sayHelloHolder(StringHolder message) throws java.rmi.RemoteException;

}

  • El código del cliente que consume el servicio es el siguiente:

package org.dbe.demos.itahelloworld0315;

import java.net.URL;
import java.util.ArrayList;
import java.util.Date;

import javax.xml.rpc.holders.StringHolder;
import org.sun.dbe.ClientHelper;

public class ITAHelloWorldClient {

public void testSayHello(IITAHelloWorld myService) {
try {
System.out.println(”\tInvoking sayHello…”);
String inMessage = new String(”Incoming Message - ” + new Date());
String outMessage = myService.sayHello(inMessage);
System.out.println(”\tInvoked OK!”);
System.out.println(”\tReturn ” + outMessage);
} catch (Exception ex) {
ex.printStackTrace();
}
}

public void testSayHelloHolder(IITAHelloWorld myService) {
try {
System.out.println(”\tInvoking sayHelloHolder…”);
StringHolder inMessage = new StringHolder();
inMessage.value = “Incoming MessageHolder - ” + new Date();
StringHolder outMessage = myService.sayHelloHolder(inMessage);
System.out.println(”\tInvoked OK!”);
System.out.println(”\tReturn ” + outMessage.value);
} catch (Exception ex) {
ex.printStackTrace();
}
}

public void test(String machine, String smid) {
try {
System.out.println(”\tTesting on machine ” + machine);
System.out.println(”\tCreating ClientHelper…”);
ClientHelper helper = new ClientHelper(new URL(”http://” + machine
+ “:2728″));
System.out.println(”\tGetting services with smid ” + smid + ” …”);
String[] clase = new String[] { smid };
Object proxies = helper.getProxies(IITAHelloWorld.class, clase,
10000L, 13);

if (proxies instanceof ArrayList) {
ArrayList myList = (ArrayList) proxies;
System.out.println(”\tWe have found ” + myList.size()
+ ” services…”);
for (int i = 0; i < myList.size(); i++) {
IITAHelloWorld myService = (IITAHelloWorld) myList.get(i);
testSayHello(myService);
// testSayHelloHolder(myService);
}
} else {
System.out.println("\tNo services were found");
}
} catch (Exception ex) {
System.out.println("\tERROR -> ” + ex.getMessage());
ex.printStackTrace();
}
}

/**
* @param args
*/
public static void main(String[] args) {
try {
// Proxy Settings
// System.setProperty(”http.proxySet”, “true”);
// System.setProperty(”http.proxyHost”, “XXXX”);
// System.setProperty(”http.proxyPort”, “8080″);

String serventHost = “localhost”;
String SMID = “ITAHelloWorldSMID”;

ITAHelloWorldClient myClient = new ITAHelloWorldClient();
myClient.test(serventHost, SMID);
} catch (Exception ex) {
ex.printStackTrace();
}
}

}

  • Incluimos las librerías necesarias
    • Todas las de servent\common
    • Y las de servent\client
  • Lanzamos el cliente y comprobamos que vaya bien
    • Es posible que debas cambiar los datos de conexión o incluso configurar los proxies

Cómo crear y desplegar un HelloWorld Service en el servent v0.3.15

November 10th, 2008

Este tutorial muestra paso a paso cómo desarrollar y desplegar un servicio utilizando el servENT v0.3.15

Aspectos preliminares:

  • Debes tener Java 1.5
  • Debes tener el servent 0.3.15 ya instalado (puedes leer el tutorial asociado)
  • No puedes usar el DBEStudio
  • Puedes descargar todo el código fuente asociado desde nuestro CVS aquí

Desarrollo del servicio:

  • Creamos la interfaz

package org.dbe.demos.itahelloworld0315;

import javax.xml.rpc.holders.StringHolder;

public interface IITAHelloWorld {

public String sayHello(String message) throws java.rmi.RemoteException;

public StringHolder sayHelloHolder(StringHolder message) throws java.rmi.RemoteException;
}

  • Desarrollamos el código del adaptador:

package org.dbe.demos.itahelloworld0315;

import java.rmi.RemoteException;
import java.util.Date;

import javax.xml.rpc.holders.StringHolder;

import org.dbe.servent.Adapter;
import org.dbe.servent.ServiceContext;

public class ITAHelloWorldAdapter implements IITAHelloWorld, Adapter {

public String sayHello(String message) throws java.rmi.RemoteException {
System.out.println(new Date()
+ ” :: ITAHelloWorldAdapter.sayHello(message): ” + message);
String dev = new String(”Hello “);
dev += message;
return dev;
}

public void destroy() {
System.out.println(new Date() + ” :: ITAHelloWorldAdapter.destroy()”);
}

public void init(ServiceContext arg0) {
System.out.println(new Date() + ” :: ITAHelloWorldAdapter.init()”);
}

public StringHolder sayHelloHolder(StringHolder message)
throws RemoteException {
System.out.println(new Date()
+ ” :: ITAHelloWorldAdapter.sayHelloHolder(message): ”
+ message.value);
StringHolder dev = new StringHolder();
dev.value = “Hello ” + message.value;
return dev;
}

}

  • Rellenamos el deployment.xml

HolaMundo
ITAHelloWorldSMID
Hello World by ITA
org.dbe.demos.itahelloworld0315.ITAHelloWorldAdapter

  • Insertamos las librerías necesarias, todas los ficheros .jar de c:\dbe_0_3_15\servent\common

Despliege del servicio en el servENT:

  • Crear una carpeta itahelloworld
  • Copiar el fichero deployment.xml
  • Dentro crear una carpeta classes y copiar todas las clases
  • Se puede crear una carpeta lib y meter las librerias (no necesaria en este ejemplo)
  • Copiar toda la carpeta itahelloworld dentro de la carpeta deploy del servent
  • Iniciar el servent (run.bat)
  • Ver las trazas para asegurarse que ha sido iniciado OK (o bien lanzar el visor de FADA http://localhost:2002/services y verificar que ha sido lanzado el servicio ITAHelloWorldSMID)

Desplegar un servicio web en Mule

November 10th, 2008

 REQUISITOS

INSTALAR MULE

CONFIGURAR ECLIPSE PARA MULE

  • Descargar e instalar Eclipse 3.4 (Ganymede) IDE for Java EE Developers http://www.eclipse.org/downloads/packages/

  • Ir a Window > Preferences, expandir Java en el árbol de navegación, seleccionar Compiler y cambiar la opción compiler compliance level a 1.5.

  • Seleccionar Installed JREs, si el JRE no es la versión 1.5, seleccionar Edit, seleccionar Directory, navegar hasta la carpeta del JDK1.5 y cambiar el JRE a jre1.5. Seleccionar Finish y OK.

DESPLEGAR UN SERVICIO WEB EN MULE

  • Crear un nuevo proyecto de Java en Eclipse.

  • Hacer click izquierdo en el Project Explorer y seleccionar Build Path > Configure Build.

  • Seleccionar la pestaña Libraries en el diálogo Properties, y seleccionar Add Library.

  • Seleccionar User Libraries, después Next, después User Libraries, y en el diálogo Preferences seleccionar New.

  • En el diálogo New User Library, introducir MULE_LIB y selecionar OK.

  • Seleccionar Add JARs, navegar a la carpeta \lib\mule en la carpeta de instalación de Mule, seleccionar todos los archivos JAR, y seleccionar Open. Hacer lo mismo todos los JARs de las carpetas \lib\boot, \lib\endorsed, \lib\opt y \lib\user después OK y después Finish.

  • Crear una carpeta para almacenar los ficheros de configuración, se sugiere nombrarla conf. En esta carpeta, crear un fichero xml de configuración, por ejemplo conf.xml, con la siguiente estructura:

xml version=“1.0″ encoding=“UTF-8″?>

<mule xmlns=“http://www.mulesource.org/schema/mule/core/2.1″

xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”

xmlns:spring=“http://www.springframework.org/schema/beans”

xmlns:soap=“http://www.mulesource.org/schema/mule/soap/2.1″

xmlns:axis=“http://www.mulesource.org/schema/mule/axis/2.1″

xmlns:vm=“http://www.mulesource.org/schema/mule/vm/2.1″

xsi:schemaLocation=

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

http://www.mulesource.org/schema/mule/core/2.1 http://www.mulesource.org/ schema/mule/core/2.1/mule.xsd

http://www.mulesource.org/schema/mule/soap/2.1 http://www.mulesource.org/ schema/mule/soap/2.1/mule-soap.xsd

http://www.mulesource.org/schema/mule/axis/2.1 http://www.mulesource.org/ schema/mule/axis/2.1/mule-axis.xsd

http://www.mulesource.org/schema/mule/vm/2.1

http://www.mulesource.org/schema/mule/vm/2.1/mule-vm.xsd”>

<description>

Echo web service

To invoke the EchoUMO hit the following URL -

http://localhost:65081/services/EchoUMO?method=echo&param=Is

there an echo?

(remember to replace the ‘&‘ with an ampersand)

To view the WSDL for the EchoUMO service go to -

http://localhost:65081/services/EchoUMO?wsdl

description> <model name=“echoSample”><service name=“Echo”><inbound><axis:inbound-endpoint

address=“http://localhost:65081/services”>

<soap:http-to-soap-request-transformer/>axis:inbound-endpoint><axis:inbound-endpoint

address=“http://localhost:65082/services”/>

<vm:inbound-endpoint path=“echo” />inbound><component class=“org.ita.mule.example.echo.echoImpl”/>service>model> mule>

  • En la carpeta src, crear una interfaz java para la clase que implementará el servicio web, similar a la siguiente:

package org.ita.mule.example.echo;

import javax.jws.WebParam;

import javax.jws.WebResult;

import javax.jws.WebService;

@WebService

public interface echoInterface

{

@WebResult(name=“text”)public String echo(@WebParam(name=“text”) String string);

}

 

  • En la carpeta src, crear una clase java que implemente el servicio web, similar a la siguiente:

package org.ita.mule.example.echo;

public class echoImpl implements echoInterface{

public String echo(String string) {// TODO Auto-generated method stubreturn string;

}

}

  • Seleccionar Run > Run Configurations.

  • En la ventana izquierda, hacer doble click en Java Application, crear una nueva configuración, ponerle un nombre y especificar org.mule.MuleServer como main class.

  • Seleccionar la pestaña Arguments e introducir -config conf\config.xml en Program Arguments.

  • Seleccionar aplicar, y Run.

  • Para posteriores ejecuciones, seleccionar Run > Run.

 

 

 

Cómo instalar el servENT v0.3.15 en Windows

November 10th, 2008

Los pasos para instalar el serVENT v0.3.15 en Windows son:

  1. Bajar la release all in one desde aquí
  2. Instalar Java 1.5.X (no funciona con Java 1.6!). Puedes encontrar un mirror aquí
  3. Descomprimir el fichero servent0.3.15-allinone-Windows-byITA.zip dentro de C:\dbe_0_3_15
  4. Editar las preferencias del servENT en C:\dbe_0_3_15\servent\servent.props
    1. En particular ajustar la parte de “Proxy configuration”
  5. Editar el fichero lanzador en C:\dbe_0_3_15\servent\bin\run.bat
    1. En particular el comando Java para ajustarlo al path en el que se tenga configurado Java1.5 (si sólo se tiene instalada una versión de Java, es suficiente con poner java)
  6. Lanzar el run.bat
  7. Verificar que se han lanzado bien los servicios entrando en http://localhost:2002/services
    1. Nótese que la versión 0.3.15 no despliega bien la KB, SR, … por lo que no hace falta lanzar el XDB-Server y la imagen de servicios desplegados será la siguiente (sólo lanza bien DBEMeter, PortalService e itahelloworld)
Screenshot

Convocatoria para participar en el proyecto

January 22nd, 2008

Actualmente se encuentra publicada una convocatoria para poder participar en el proyecto, en base a la ORDEN de 5 de octubre de 2007, del Departamento de Ciencia, Tecnología y Universidad, por la que se convocan subvenciones para la implantación y difusión de la sociedad de la información y de la sociedad del conocimiento, dirigidas a PYMEs y microempresas aragonesas del sector de las tecnologías de la información y las comunicaciones para el año 2008.

Puede encontrar más información sobre la convocatoria aquí.

A simple example using ontologies

August 10th, 2007

One common FAQ is related to the creation of services based on ontologies.

You can donwload a simple example from here 

Notice there is an error in the UI generated

ITA - Examples

August 10th, 2007

We have developed a set of test services using DBEStudio v1.0.2 and ExE v0.3.14

You can download all of them (even services included in the DBEStudio examples) at http://dbe.ita.es/viewcvs/dbe/dev/itademos/exe_0_3_14/