Difference between revisions of "Echo ws bottom-up method"

From GreenVulcano Wiki
Jump to: navigation, search
(Example 1)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<showhide>
+
We start from a {{GVESB}} service "echo" that simply returns the user input as well as is.
Click to view the source __HIDER__
+
 
<hide>Ciao PEPPE</hide>
+
Once launched [[bottom-up development method]] wizard and inserted all parameters, {{L_VULCON}} creates the [http://en.wikipedia.org/wiki/Web_service Web Service] WSDL file describing our service.
</showhide>
+
 
 +
This is the "echo_ws.wsdl" generated, assuming that we have chosen the SOAP transport protocol:
 +
 
 +
<syntaxhighlight lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
 
 +
<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.greenvulcano.it/greenvulcano"
 +
                  xmlns:gv="http://www.greenvulcano.it/greenvulcano"
 +
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
 +
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
 +
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
 +
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 +
                  xmlns:soapjms="http://www.w3.org/2010/soapjms/"
 +
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 +
    <wsdl:types>
 +
        <xsd:schema elementFormDefault="qualified"
 +
                    targetNamespace="http://www.greenvulcano.it/greenvulcano"/>
 +
    </wsdl:types>
 +
    <wsdl:message name="echoResponse">
 +
        <wsdl:part element="gv:echoResponse" name="parameters"></wsdl:part>
 +
    </wsdl:message>
 +
    <wsdl:message name="echoRequest">
 +
        <wsdl:part element="gv:echo" name="parameters"></wsdl:part>
 +
    </wsdl:message>
 +
    <wsdl:portType name="echo_wsPortType">
 +
        <wsdl:operation name="echo">
 +
            <wsdl:input message="gv:echoRequest" name="echoRequest"></wsdl:input>
 +
            <wsdl:output message="gv:echoResponse" name="echoResponse"></wsdl:output>
 +
        </wsdl:operation>
 +
    </wsdl:portType>
 +
    <wsdl:binding name="echo_ws_Soap" type="gv:echo_wsPortType">
 +
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
 +
        <wsdl:operation name="echo">
 +
            <soap:operation soapAction="echo_ws/echo" style="document"/>
 +
            <wsdl:input name="echoRequest">
 +
                <soap:body use="literal"/>
 +
            </wsdl:input>
 +
            <wsdl:output name="echoResponse">
 +
                <soap:body use="literal"/>
 +
            </wsdl:output>
 +
        </wsdl:operation>
 +
    </wsdl:binding>
 +
    <wsdl:service name="echo_ws">
 +
        <wsdl:port binding="gv:echo_ws_Soap" name="echo_ws_Soap">
 +
            <soap:address location="http://localhost:8080/gvaxis2/services/echo_ws"/>
 +
        </wsdl:port>
 +
    </wsdl:service>
 +
</wsdl:definitions>
 +
</syntaxhighlight>
 +
 
 +
VulCon creates also the "echo_ws.aar" that contains the "echo_ws.wsdl" and the "services.xml". This AAR will be used by {{GVESB}} for deploying our new Web Service.
 +
 
 +
Now we must only insert our generated elements in {{GVESB}} installation directory:
 +
* Copy the "echo_ws.wsdl" in folder "//GV_HOME/xmlconfig/wsdl".
 +
* Copy the "echo_ws.aar" in folder "//GV_HOME/webservices/services".
 +
 
 +
Opening the {{GVCONSOLE}} in the section "Web Service"->"WSDL", we can see in the top area the Web Service description that is present in the "GVAdapter.xml" file.
 +
In the bottom area we can see our "echo_ws.wsdl" that is ready to be deployed, just check it and click the "Deploy" button.
 +
 
 +
Finally we can see our new Web Service in [http://axis.apache.org/axis2/java/core/docs/webadminguide.html#Intro  Axis2 console].

Latest revision as of 22:42, 9 February 2012

We start from a GreenVulcano® ESB service "echo" that simply returns the user input as well as is.

Once launched bottom-up development method wizard and inserted all parameters, VulCon® creates the Web Service WSDL file describing our service.

This is the "echo_ws.wsdl" generated, assuming that we have chosen the SOAP transport protocol:

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.greenvulcano.it/greenvulcano"
                  xmlns:gv="http://www.greenvulcano.it/greenvulcano"
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:soapjms="http://www.w3.org/2010/soapjms/"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <wsdl:types>
        <xsd:schema elementFormDefault="qualified"
                    targetNamespace="http://www.greenvulcano.it/greenvulcano"/>
    </wsdl:types>
    <wsdl:message name="echoResponse">
        <wsdl:part element="gv:echoResponse" name="parameters"></wsdl:part>
    </wsdl:message>
    <wsdl:message name="echoRequest">
        <wsdl:part element="gv:echo" name="parameters"></wsdl:part>
    </wsdl:message>
    <wsdl:portType name="echo_wsPortType">
        <wsdl:operation name="echo">
            <wsdl:input message="gv:echoRequest" name="echoRequest"></wsdl:input>
            <wsdl:output message="gv:echoResponse" name="echoResponse"></wsdl:output>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="echo_ws_Soap" type="gv:echo_wsPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="echo">
            <soap:operation soapAction="echo_ws/echo" style="document"/>
            <wsdl:input name="echoRequest">
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output name="echoResponse">
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="echo_ws">
        <wsdl:port binding="gv:echo_ws_Soap" name="echo_ws_Soap">
            <soap:address location="http://localhost:8080/gvaxis2/services/echo_ws"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

VulCon creates also the "echo_ws.aar" that contains the "echo_ws.wsdl" and the "services.xml". This AAR will be used by GreenVulcano® ESB for deploying our new Web Service.

Now we must only insert our generated elements in GreenVulcano® ESB installation directory:

  • Copy the "echo_ws.wsdl" in folder "//GV_HOME/xmlconfig/wsdl".
  • Copy the "echo_ws.aar" in folder "//GV_HOME/webservices/services".

Opening the GV Console in the section "Web Service"->"WSDL", we can see in the top area the Web Service description that is present in the "GVAdapter.xml" file. In the bottom area we can see our "echo_ws.wsdl" that is ready to be deployed, just check it and click the "Deploy" button.

Finally we can see our new Web Service in Axis2 console.