Home   Documentation   Demonstrations   Download

AMICO: Documentation / AMICO Modules / SOAP Interface

 

An Simple Object Access Protocol (SOAP) interface to AMICO. In enables definition of SOAP adapters, that map variables from the communicator to invocation of SOAP services. We are also working on enabling AMICO to run as a SOAP service.

How To Run

     java -jar %AMICO_HOME%/bin/amico-soap.jar [<conf-url>]

 

 

Configuration Files

 

A main configuration file:
 

This is a minimal configuration file that uses default parameters for missing attributes.
Use this file if you want to use default settings.

---------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<soap>
    <soap-adapter url="file:conf/soap/google-adapter.xml"/>
</soap>

This is a full configuration file that overrides default parameters.

---------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<soap>
    <communicator host="localhost" port="3320">
        <!-- Basic parameter for establishing connection with communicator. Module uses TCP connection.
             <command> element define a list of commands that will be sent to communicator
             each time a module establish a connection (see AMICO TCP protocol for details on commands)
        -->

        <command>UPDATE last-loaded-module SOAP</command>
        <command>ONUNLOAD DELETE last-loaded-module</command>
    </communicator>


    <soap-adapter url="file:conf/soap/google-adapter.xml"/>
</soap>

 

 A configuration file for AMICO SOAP adapter for Google SOAP Search API (Beta) (linked from a main configuration file):
 

<?xml version="1.0" encoding="UTF-8"?>
<soap-adapter endpoint-url="api.google.com" endpoint-service-name="/search/beta2">

    <common>

        <namespace prefix="xsi">http://www.w3.org/1999/XMLSchema-instance</namespace>

        <namespace prefix="xsd">http://www.w3.org/1999/XMLSchema</namespace>

        <attribute name="soapenv:encodingStyle" namespace="null">http://schemas.xmlsoap.org/soap/encoding/</attribute>

        <parameter name="key" namespace="null" type="xsd:string" type-qualifier="xsi:type"> your Google API key </parameter>

    </common>

    <method name="doSpellingSuggestion" namespace="urn:GoogleSearch" trigger="spelling">

        <parameter name="phrase" namespace="null" type="xsd:string" type-qualifier="xsi:type">&lt;%=spelling%&gt;</parameter>

        <result update-variable="spelling-suggestion"/>

    </method>

    <method name="doGoogleSearch" namespace="urn:GoogleSearch" trigger="query">

        <namespace prefix="soapenv">http://schemas.xmlsoap.org/soap/envelope/</namespace>

        <namespace prefix="SOAP-ENC">http://schemas.xmlsoap.org/soap/encoding/</namespace>

        <parameter name="q" namespace="" type="xsd:string" type-qualifier="xsi:type">&lt;%=query%&gt;</parameter>

        <parameter name="start" namespace="" type="xsd:int" type-qualifier="xsi:type">0</parameter>

        <parameter name="maxResults" namespace="" type="xsd:int" type-qualifier="xsi:type">10</parameter>

        <parameter name="filter" namespace="" type="xsd:boolean" type-qualifier="xsi:type">true</parameter>

        <parameter name="restrict" namespace="" type="xsd:string" type-qualifier="xsi:type"></parameter>

        <parameter name="safeSearch" namespace="" type="xsd:boolean" type-qualifier="xsi:type">false</parameter>

        <parameter name="lr" namespace="" type="xsd:string" type-qualifier="xsi:type"></parameter>

        <parameter name="ie" namespace="" type="xsd:string" type-qualifier="xsi:type">utf-8</parameter>

        <parameter name="oe" namespace="" type="xsd:string" type-qualifier="xsi:type">utf-8</parameter>

        <result update-variable="search" xpath="/return/estimatedTotalResultsCount"/>

        <result update-variable="link1" xpath="/return/resultElements/item[position()=1]/URL"/>

        <result update-variable="link2" xpath="/return/resultElements/item[position()=2]/URL"/>

        <result update-variable="link3" xpath="/return/resultElements/item[position()=3]/URL"/>

        <result update-variable="snippet1" xpath="/return/resultElements/item[position()=1]/snippet"/>

        <result update-variable="snippet2" xpath="/return/resultElements/item[position()=2]/snippet"/>

        <result update-variable="snippet3" xpath="/return/resultElements/item[position()=3]/snippet"/>

    </method>
</soap-adapter>

 

 

Validation Logos