Reviews
Java SOA TrainingDeploy the Web Service
Deploy the Web Service
As a first step, if you haven't done it before, edit examples.PROPERTIES (provided along with the code download for this chapter), and change the paths there to match your development environment. The code download for this chapter also includes a README.txt file, which gives detailed steps to build and run the samples.
We have a simple web service in the codebase present in the folder
ch10\ServiceMixHttpBinding\01_ws. To deploy the web service, first change
directory to the ch10\ServiceMixHttpBinding folder and execute the ant command
as follows:
cd ch10\ServiceMixHttpBinding
ant
In fact, the build.xml file will call the build in the subprojects to build the web service as well as the ServiceMix subproject.
The web service is built completely and the war file can be found in the
folder
ch10\ServiceMixHttpBinding\01_ws\dist\AxisEndToEnd.war. To deploy the web
service, drop this war file into your favorite web server's webapps folder and
restart the web server, if necessary.
Now to make sure that your web service deployment works fine, we have provided a web service test client. To invoke the test client, execute the following commands:
cd ch10\ServiceMixHttpBinding\01_ws
ant run
We can also check the web service deployment by accessing the WSDL from the URL:
http://localhost:8080/AxisEndToEnd/services/HelloWebService?WSDL
Let us list out the WSDL here, since we want to compare it with the WSDL accessed from the ServiceMix binding later to cross check the similarities. This is provided in
ch10\ServiceMixHttpBinding\HelloWebService-axis.wsdl
- <?xml version="1.0" encoding="UTF-8"?>
- <wsdl:definitions targetNamespace="http://AxisEndToEnd.axis.
- apache.binildas.com"
- xmlns:apachesoap="http://xml.apache.org/xml-soap"
- xmlns:impl="http://AxisEndToEnd.axis.apache.
- binildas.com"
- xmlns:intf="http://AxisEndToEnd.axis.apache.
- binildas.com"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/
- soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" target="_blank" rel="nofollow">
- <wsdl:types>
- <schema elementFormDefault="qualified"
- targetNamespace="http://AxisEndToEnd.axis.apache.
- binildas.com"
- xmlns="http://www.w3.org/2001/XMLSchema" target="_blank" rel="nofollow">
- <element name="hello">
- <complexType>
- <sequence>
- <element name="in0" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- <element name="helloResponse">
- <complexType>
- <sequence>
- <element name="helloReturn" type="xsd:string"/>
- </sequence>
- </complexType>
- </element>
- </schema>
- </wsdl:types>
- <wsdl:message name="helloRequest">
- <wsdl:part element="impl:hello" name="parameters"/>
- </wsdl:message>
- <wsdl:message name="helloResponse">
- <wsdl:part element="impl:helloResponse" name="parameters"/>
- </wsdl:message>
- <wsdl:portType name="IHelloWeb">
- <wsdl:operation name="hello">
- <wsdl:input message="impl:helloRequest"
- name="helloRequest"/>
- <wsdl:output message="impl:helloResponse"
- name="helloResponse"/>
- </wsdl:operation>
- </wsdl:portType>
- <wsdl:binding name="HelloWebServiceSoapBinding"
- type="impl:IHelloWeb">
- <wsdlsoap:binding style="document" transport="http://schemas.
- xmlsoap.org/soap/http"/>
- <wsdl:operation name="hello">
- <wsdlsoap:operation soapAction=""/>
- <wsdl:input name="helloRequest">
- <wsdlsoap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="helloResponse">
- <wsdlsoap:body use="literal"/>
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:service name="IHelloWebService">
- <wsdl:port binding="impl:HelloWebServiceSoapBinding"
- name="HelloWebService">
- <wsdlsoap:address location="http://localhost:8080/
- AxisEndToEnd/services/HelloWebService"/>
- </wsdl:port>
- </wsdl:service>
- </wsdl:definitions>
Java SOA Training







