es.upv.dsic.gti_ia.organization
Class ServiceTools

java.lang.Object
  extended by es.upv.dsic.gti_ia.organization.ServiceTools

public class ServiceTools
extends Object

This class provides tools in order to facilitate the execution of the services.


Nested Class Summary
 class ServiceTools.OntologicalTypesConstants
          Constants defining the ontological types of XMLSchema
 
Constructor Summary
ServiceTools()
           
 
Method Summary
 String buildServiceContent(String serviceName, HashMap<String,String> inputs)
          Builds a new string with a XML format.
 HashMap<String,Object> executeWebService(String serviceWSDLURL, HashMap<String,String> inputs)
          Executes the Web Service of the given WSDL URL with the provided inputs.
 HashMap<String,Object> executeWebService(String serviceWSDLURL, String xmlInputs)
          Executes the Web Service of the given WSDL URL with the provided inputs.
 String extractServiceContent(String xml, HashMap<String,String> inOutputs)
          Parses a XML in order to extract the service name and fill the HashMap with the service inputs or outputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceTools

public ServiceTools()
Method Detail

buildServiceContent

public String buildServiceContent(String serviceName,
                                  HashMap<String,String> inputs)
Builds a new string with a XML format. This XML is formed by service name and list of the inputs

Parameters:
serviceName - The name of the service
inputs - is a HashMap formed by keys and values
Returns:
string with a XML format.

extractServiceContent

public String extractServiceContent(String xml,
                                    HashMap<String,String> inOutputs)
Parses a XML in order to extract the service name and fill the HashMap with the service inputs or outputs

Parameters:
string - with a XML format, in this XML will be contained the service name and service input or outputs
inOutputs - is a new HashMap. In this HashMap the service inputs or outputs are added
Returns:
service name

executeWebService

public HashMap<String,Object> executeWebService(String serviceWSDLURL,
                                                String xmlInputs)
Executes the Web Service of the given WSDL URL with the provided inputs. Returns the results of the service execution

Parameters:
serviceWSDLURL - to execute
xmlInputs - inputs in a XML structure with name of the input and its value ex. valueX
Returns:
HashMap with the output results with name of the output and its value

executeWebService

public HashMap<String,Object> executeWebService(String serviceWSDLURL,
                                                HashMap<String,String> inputs)
Executes the Web Service of the given WSDL URL with the provided inputs. Returns the results of the service execution

Parameters:
serviceWSDLURL - to execute
inputs - HashMap with name of the input and its value
Returns:
HashMap with the output results with name of the output and its value


Copyright © 2012 GTI-IA. All Rights Reserved.