An RPC system consists of the following pieces
RPC requirement | SOAP |
---|---|
defined data types | defined by SOAP |
wire format for data | defined by SOAP using XML |
wire format for messages | defined by SOAP over HTTP |
an IDL | defined by WSDL |
generation of client stubs | vendor specific |
generation of server stubs | vendor specific |
linking implementation | vendor specific |
Address of service | URL |
Locating service | UDDI |
Converter service:
float inchToMM(float)
float mmToInch(float)
The WSDL specification looks like
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:Converter" targetNamespace="urn:Converter" name="ConverterService">
<message name="inchToMMRequest">
<part name="param1" type="xsd:float"/>
</message>
<message name="inchToMMResponse">
<part name="return" type="xsd:float"/>
</message>
<message name="mmToInchRequest">
<part name="param1" type="xsd:float"/>
</message>
<message name="mmToInchResponse">
<part name="return" type="xsd:float"/>
</message>
<message name="java_rmi_RemoteException">
<part type="xsd:string" name="java_rmi_RemoteException"/>
</message>
<message name="com_iona_xmlbus_webservices_ejbserver_ConversionException">
<part type="xsd:string" name="com_iona_xmlbus_webservices_ejbserver_ConversionException"/>
</message>
<portType name="ConverterPortType">
<operation name="inchToMM">
<input message="tns:inchToMMRequest" name="inchToMM"/>
<output message="tns:inchToMMResponse" name="inchToMMResponse"/>
<fault message="tns:java_rmi_RemoteException" name="java_rmi_RemoteException"/>
</operation>
<operation name="mmToInch">
<input message="tns:mmToInchRequest" name="mmToInch"/>
<output message="tns:mmToInchResponse" name="mmToInchResponse"/>
<fault message="tns:java_rmi_RemoteException" name="java_rmi_RemoteException"/>
<fault
message="tns:com_iona_xmlbus_webservices_ejbserver_ConversionException" name="com_iona_xmlbus_webservices_ejbserver_ConversionException"/>
</operation>
</portType>
<binding name="ConverterBinding" type="tns:ConverterPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http/" style="rpc"/>
<operation name="inchToMM">
<soap:operation soapAction="" style="rpc"/>
<input name="inchToMM">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="inchToMMResponse">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault name="java_rmi_RemoteException">
<soap:fault name="java_rmi_RemoteException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
<operation name="mmToInch">
<soap:operation soapAction="" style="rpc"/>
<input name="mmToInch">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="mmToInchResponse">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault name="java_rmi_RemoteException">
<soap:fault name="java_rmi_RemoteException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
<fault name="com_iona_xmlbus_webservices_ejbserver_ConversionException">
<soap:fault
name="com_iona_xmlbus_webservices_ejbserver_ConversionException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
</binding>
<service name="Converter">
<port name="ConverterPort" binding="tns:ConverterBinding">
<soap:address location="http://www.xmlbus.com:9010/ionasoap/servlet/Converter"/>
</port>
</service>
</definitions>
inchToMMRequest
inchToMMResponse
java_rmi_RemoteException
inchToMM(inchToMMRequest, inchToMMResponse,
java_rmi_RemoteException)
ConverterBinding
operation: inchToMM/rpc
"inchToMM"
"inchToMMResponse"
"java_rmi_RemoteException"
name: Converter
address: http://...
...
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="urn:Converter" targetNamespace="urn:Converter" name="ConverterService">
<message name="inchToMMRequest">
<part name="param1" type="xsd:float"/>
</message>
<message name="inchToMMResponse">
<part name="return" type="xsd:float"/>
</message>
<message name="mmToInchRequest">
<part name="param1" type="xsd:float"/>
</message>
<message name="mmToInchResponse">
<part name="return" type="xsd:float"/>
</message>
<message name="java_rmi_RemoteException">
<part type="xsd:string" name="java_rmi_RemoteException"/>
</message>
<message name="com_iona_xmlbus_webservices_ejbserver_ConversionException">
<part type="xsd:string" name="com_iona_xmlbus_webservices_ejbserver_ConversionException"/>
</message>
<portType name="ConverterPortType">
<operation name="inchToMM">
<input message="tns:inchToMMRequest" name="inchToMM"/>
<output message="tns:inchToMMResponse" name="inchToMMResponse"/>
<fault message="tns:java_rmi_RemoteException" name="java_rmi_RemoteException"/>
</operation>
<operation name="mmToInch">
<input message="tns:mmToInchRequest" name="mmToInch"/>
<output message="tns:mmToInchResponse" name="mmToInchResponse"/>
<fault message="tns:java_rmi_RemoteException" name="java_rmi_RemoteException"/>
<fault
message="tns:com_iona_xmlbus_webservices_ejbserver_ConversionException" name="com_iona_xmlbus_webservices_ejbserver_ConversionException"/>
</operation>
</portType>
<binding name="ConverterBinding" type="tns:ConverterPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http/" style="rpc"/>
<operation name="inchToMM">
<soap:operation soapAction="" style="rpc"/>
<input name="inchToMM">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="inchToMMResponse">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault name="java_rmi_RemoteException">
<soap:fault name="java_rmi_RemoteException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
<operation name="mmToInch">
<soap:operation soapAction="" style="rpc"/>
<input name="mmToInch">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output name="mmToInchResponse">
<soap:body use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
<fault name="java_rmi_RemoteException">
<soap:fault name="java_rmi_RemoteException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
<fault name="com_iona_xmlbus_webservices_ejbserver_ConversionException">
<soap:fault
name="com_iona_xmlbus_webservices_ejbserver_ConversionException"
use="encoded" namespace="urn:Converter" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</fault>
</operation>
</binding>
<service name="Converter">
<port name="ConverterPort" binding="tns:ConverterBinding">
<soap:address location="http://www.xmlbus.com:9010/ionasoap/servlet/Converter"/>
</port>
</service>
</definitions>
interface ConverterInterface {
float inchToMM(float value);
float mmToInch(float value);
};
AXIS_LIB=/usr/local/axis-1_1/lib # change this for your lib dir
for i in $AXIS_LIB/*.jar
do
CP=$CP:$i
done
java -cp "$CP" org.apache.axis.wsdl.Java2WSDL \
-o ConverterInterface.apache.wsdl \
-l http://localhost/wstk/services/ConverterInterface \
ConverterInterface
java -cp $WSTK_CP org.apache.axis.wsdl.WSDL2Java \
ConverterInterface.ibm.wsdl
interface ConverterInterface {
float inchToMM(float value);
float mmToInch(float value);
};
package DefaultNamespace;
public interface Converter extends java.rmi.Remote {
public float inchToMM(float in0) throws java.rmi.RemoteException;
public float mmToInch(float in0) throws java.rmi.RemoteException;
}
SOAP messages are either
A SOAP request consists of
A SOAP response is just like a request, except the body contains the result.
<?xml version="1.0" ?> <env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope"> <env:Header> <p:oneBlock xmlns:p="http://example.com" env:actor="http://example.com/Log"> :::: </p:oneBlock> <q:anotherBlock xmlns:q="http://example.com" env:actor="http://www.w3.org/2001/12/soap-envelope/actor/next"> :::: </q:anotherBlock> <r:aThirdBlock xmlns:r="http://example.com"> :::: </r:aThirdBlock> </env:Header> <env:Body > :::: </env:Body> </env:Envelope>
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope" >
<env:Body>
<m:reserveAndCharge
env:encodingStyle="http://www.w3.org/2001/12/soap-encoding"
xmlns:m="http://travelcompany.example.org/" >
<n:name xmlns:n="http://mycompany.example.com/employees">
John Q. Public
</n:name>
<o:creditCard xmlns:o="http://mycompany.example.com/financial">
<o:number>123456789099999</o:number>
<o:expiration>2005-02</o:expiration>
</o:creditCard>
</m:reserveAndCharge>
</env:Body>
</env:Envelope>
<Request>Response
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope" >
<env:Body>
<m:reserveAndChargeResponse
env:encodingStyle="http://www.w3.org/2001/12/soap-encoding"
xmlns:m="http://travelcompany.example.org/" >
<m:confirmation>
<reference>FT35ZBQ</reference>
<viewAt>
http://travelcompany.example.org/reservations?code=FT35ZBQ
</viewAt>
</m:confirmation>
</m:reserveAndChargeResponse>
</env:Body>
</env:Envelope>
application/soap
POST /Charging HTTP/1.1
Host: travelcompany.example.org
Content-Type: application/soap; charset="utf-8"
Content-Length: nnnn
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope" >
<env:Body>
<m:reserveAndCharge>
::::::
</m:reserveAndCharge>
</env:Body>
</env:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap; charset="utf-8"
Content-Length: nnnn
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope" >
<env:Body>
<m:reserveAndChargeResponse>
::::::
</m:reserveAndCharge>
</env:Body>
</env:Envelope>
.../jakarta-tomcat/webapps/axis
jws
extension to
the toplevel of the Axis directory e.g.
.../jakarta-tomcat/webapps/axis/Converter.jws
http://localhost:8088/axis/Converter.jws
Service
and Call
Call.invoke()
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestClient {
public static void main(String [] args) {
try {
String endpoint =
"http://nagoya.apache.org:5049/axis/services/echo";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soapinterop.org/", "echoString"));
String ret = (String) call.invoke( new Object[] { "Hello!" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
public class SimpleConverter {
public double inchToMM(double value) {
return value * 25.4;
}
public double mmToInch(double value) {
return value / 25.4;
}
};
package client;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestSimpleConverter {
public static void main(String [] args) {
try {
String endpoint =
"http://localhost:8090/axis/SimpleConverter.jws";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soapinterop.org/", "inchToMM"));
Double ret = (Double) call.invoke( new Object[] { new Double(2.0) } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
WSDL2Java
generates client-side stubs
ConverterInterface
service, it generates
ConverterInterface.java
- the Java interface you use
ConverterInterfaceServiceLocator.java
- finds the
service and returns a ConverterInterfaceService.java
ConverterInterfaceService.java
- has a method
to get the client HOPP
ConverterInterfaceSoapBindingStub.java
-
an implementation
of the interface which is the client part of the HOPP
public class Tester
{
public static void main(String [] args) throws Exception {
// Make a service
ConverterInterfaceService service = new ConverterInterfaceServiceLocator();
// Now use the service to get a stub which implements the SDI.
ConverterInterface port = service.getConverterInterface();
// Make the actual call
float mm = port.inchToMM(1.0);
}
}
fault
messages should have a language tag and maybe be offered in several
versions
Date
rather than gMonth
public class Measure {
public int value;
public String type;
}
public class Inch extends Measure {
public Inch() {
type = "inch";
}
}
public class Mm extends Measure {
public Mm() {
type = "mm";
}
}
public class Converter {
public Mm inchToMM(Inch in) {...}
public Inch mmToInch(Mm mm) {...}
}
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPHeaderElement;
import javax.xml.namespace.QName;
public class TestHelloI18n {
public static void main(String [] args) {
try {
String language = "en";
String endpoint =
"http://localhost:8090/axis/HelloI18n.jws";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soapinterop.org/", "sayHello"));
// set the xml:lang header
call.addHeader(new SOAPHeaderElement("xml", "lang",
language));
String ret = (String) call.invoke( new Object[] { "Hello!" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
import org.apache.axis.MessageContext;
import org.apache.axis.Message;
import org.apache.axis.message.SOAPEnvelope;
import org.apache.axis.message.MessageElement;
import org.apache.axis.message.SOAPHeaderElement;
import java.util.Vector;
public class HelloI18n {
public String sayHello(String s) throws Exception {
MessageContext context = MessageContext.getCurrentContext();
Message request = context.getRequestMessage();
SOAPEnvelope env = request.getSOAPEnvelope();
// get the xml:lang header
SOAPHeaderElement header = env.getHeaderByName("xml", "lang");
String language = header.getValue();
return "Language " + language + ": " + s;
}
}
import measure.Inch;
import measure.Mm;
public class MeasureConverter {
public Mm inchToMM(Inch in) {
Mm mm = new Mm();
mm.setValue(in.getValue() * 25.4);
return mm;
}
public Inch mmToInch(Mm mm) {
Inch in = new Inch();
in.setValue(mm.getValue() / 25.4);
return in;
}
}
This can be copied to AXIS/MeasureConverter.jws
getSerializer
and
getDeserializer
is included in the datatype
Measure
to
package measure;
public class Measure implements java.io.Serializable {
private double value;
private String type;
public Measure() {
}
public Measure(double v, String t) {
value = v;
type = t;
}
public void setValue(double v) {
value = v;
}
public double getValue() {
return value;
}
public void setType(String t) {
type = t;
}
public String getType() {
return type;
}
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Measure.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://measure", "Measure"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new javax.xml.namespace.QName("", "value"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("type");
elemField.setXmlName(new javax.xml.namespace.QName("", "type"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
Inch
to
package measure;
public class Inch extends Measure {
public Inch() {
setType("inch");
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Inch.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://measure", "Inch"));
}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
inchToMM
is okay to take Inch
as a
datatype that inherits from Measure
inchToMM
returns Measure
as a
datatype rather than Mm
Mm
must not inherit from
Measure
:
package measure;
public class Mm {
private double value;
private String type = "mm";
public Mm() {
}
public Mm(double v, String t) {
value = v;
type = t;
}
public void setValue(double v) {
value = v;
}
public double getValue() {
return value;
}
public void setType(String t) {
type = t;
}
public String getType() {
return type;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(Mm.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://measure", "Mm"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new javax.xml.namespace.QName("", "value"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "double"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("type");
elemField.setXmlName(new javax.xml.namespace.QName("", "type"));
elemField.setXmlType(new javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/", "string"));
elemField.setNillable(true);
typeDesc.addFieldDesc(elemField);
}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
mmToInch
jar
file and
copied to AXIS/WEB-INF/lib/
import DefaultNamespace.*;
import measure.*;
public class TestWSDLConverter {
public static void main(String [] args) throws Exception {
// Make a service
MeasureConverterService service =
new MeasureConverterServiceLocator();
// Now use the service to get a stub which implements the SDI.
MeasureConverter port = service.getMeasureConverter();
// Make the actual call
Inch in = new Inch();
in.setValue(2.0);
Mm mm = (Mm) port.inchToMM(in);
System.out.println("Answer is " + mm.getValue());
}
}
<project name="UPnP demos" default="usage" basedir=".">
<!-- CONFIGURABLE STUFF HERE -->
<property name="axis_lib_dir" value="/usr/local/src/axis-1_2/lib"/>
<property name="axis_deploy_dir" value="/usr/local/jakarta-tomcat-5.5.9/webapps/axis"/>
<!-- END CONFIGURABLE STUFF -->
<property name="axis_libs" value="${axis_lib_dir}/axis.jar:${axis_lib_dir}/jaxrpc.jar:${axis_lib_dir}/commons-logging-1.0.4.jar:${axis_lib_dir}/commons-discovery-0.2.jar:${axis_lib_dir}/saaj.jar:${axis_lib_dir}/wsdl4j-1.5.1.jar"/>
<!-- Directories -->
<!-- Show the usage options to the user -->
<target name="usage" >
<echo message="available targets are:"/>
<echo message=""/>
<echo message=" compile"/>
<echo message=" deploy"/>
<echo message=" runsimple"/>
<echo message=" clean"/>
<echo message=" usage"/>
</target>
<target name="all" depends="init,compile"/>
<!-- CLEAN -->
<target name="clean">
<!-- Delete our the ${build}, and ${deploy} directory trees -->
<delete dir="classes"/>
<!-- Delete our the ${build}, and ${deploy} directory trees -->
<delete dir="wsdl-classes"/>
<!-- delete all ~ backup files -->
<delete>
<fileset dir="." defaultexcludes="false" includes="**/*~"/>
</delete>
<!-- delete all .bak backup files -->
<delete>
<fileset dir="." defaultexcludes="false" includes="**/*.bak"/>
</delete>
</target>
<target name="init">
<!-- Create the build directory structure used by compile N deploy -->
</target>
<!-- compile the services -->
<target name="compile">
<mkdir dir="classes"/>
<javac destdir="classes" srcdir="src"
classpath="${axis_libs}"
target="1.5"/>
</target>
<target name="wsdl" depends="compile">
<exec executable="java" dir="classes">
<env key="CLASSPATH"
path="${axis_libs}:classes"/>
<arg value="org.apache.axis.wsdl.Java2WSDL"/>
<arg value="-o"/>
<arg value="MeasureConverter.apache.wsdl"/>
<arg value="-l"/>
<arg value="http://localhost:8090/axis/MeasureConverter.jws"/>
<arg value="MeasureConverter"/>
</exec>
<mkdir dir="wsdl-src"/>
<exec executable="java" dir="wsdl-src">
<env key="CLASSPATH"
path="${axis_libs}:classes"/>
<arg value="org.apache.axis.wsdl.WSDL2Java"/>
<arg value="../classes/MeasureConverter.apache.wsdl"/>
</exec>
<mkdir dir="wsdl-classes"/>
<javac destdir="wsdl-classes" srcdir="wsdl-src"
classpath="${axis_libs}"
target="1.5"/>
</target>
<!-- deploy the services -->
<target name="deploy">
<copy file="src/SimpleConverter.java"
tofile="${axis_deploy_dir}/SimpleConverter.jws"
/>
<copy file="src/MeasureConverter.java"
tofile="${axis_deploy_dir}/MeasureConverter.jws"
/>
<jar destfile="classes/measure.jar"
basedir="classes"
includes="measure/*"
/>
<copy file="classes/measure.jar"
tofile="${axis_deploy_dir}/WEB-INF/lib/measure.jar"
/>
</target>
<!-- run a client for the simple service -->
<target name="runsimple" depends="compile">
<exec executable="java">
<env key="CLASSPATH"
path="${axis_libs}:classes/measure.jar:classes"/>
<arg line="client.TestSimpleConverter"/>
</exec>
</target>
<target name="runmeasure" depends="compile">
<exec executable="java">
<env key="CLASSPATH"
path="${axis_libs}:classes"/>
<arg line="client.TestMeasureConverter"/>
</exec>
</target>
<target name="runwsdl" depends="compile">
<exec executable="java">
<env key="CLASSPATH"
path="${axis_libs}:wsdl-classes"/>
<arg line="TestWSDLConverter"/>
</exec>
</target>
<target name="runmonitor">
<exec executable="java">
<env key="CLASSPATH"
path="${axis_libs}:wsdl-classes"/>
<arg line="org.apache.axis.utils.tcpmon"/>
</exec>
</target>
</project>