User:Lindenb/Notebook/UMR915/20101018: Difference between revisions
From OpenWetWare
(→axis2) |
No edit summary |
||
Line 17: | Line 17: | ||
public class HelloAxis | public class HelloAxis | ||
{ | { | ||
public int | public int getTwice(int value) | ||
{ | { | ||
return value*2; | return value*2; | ||
Line 28: | Line 28: | ||
<?xml version="1.0" encoding="UTF-8"?> | |||
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns: | <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://ws.apache.org/axis2"> | ||
<wsdl:types/> | <wsdl:types> | ||
<wsdl:portType name="HelloAxisPortType"/> | <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2"> | ||
<wsdl:binding name="HelloAxisSoap11Binding" type=" | <xs:element name="getTwice"> | ||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" name="value" type="xs:int"/> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
<xs:element name="getTwiceResponse"> | |||
<xs:complexType> | |||
<xs:sequence> | |||
<xs:element minOccurs="0" name="return" type="xs:int"/> | |||
</xs:sequence> | |||
</xs:complexType> | |||
</xs:element> | |||
</xs:schema> | |||
</wsdl:types> | |||
<wsdl:message name="getTwiceRequest"> | |||
<wsdl:part name="parameters" element="ns:getTwice"/> | |||
</wsdl:message> | |||
<wsdl:message name="getTwiceResponse"> | |||
<wsdl:part name="parameters" element="ns:getTwiceResponse"/> | |||
</wsdl:message> | |||
<wsdl:portType name="HelloAxisPortType"> | |||
<wsdl:operation name="getTwice"> | |||
<wsdl:input message="ns:getTwiceRequest" wsaw:Action="urn:getTwice"/> | |||
<wsdl:output message="ns:getTwiceResponse" wsaw:Action="urn:getTwiceResponse"/> | |||
</wsdl:operation> | |||
</wsdl:portType> | |||
<wsdl:binding name="HelloAxisSoap11Binding" type="ns:HelloAxisPortType"> | |||
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | ||
<wsdl:operation name="getTwice"> | |||
<soap:operation soapAction="urn:getTwice" style="document"/> | |||
<wsdl:input> | |||
<soap:body use="literal"/> | |||
</wsdl:input> | |||
<wsdl:output> | |||
<soap:body use="literal"/> | |||
</wsdl:output> | |||
</wsdl:operation> | |||
</wsdl:binding> | </wsdl:binding> | ||
<wsdl:binding name="HelloAxisSoap12Binding" type=" | <wsdl:binding name="HelloAxisSoap12Binding" type="ns:HelloAxisPortType"> | ||
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> | ||
<wsdl:operation name="getTwice"> | |||
<soap12:operation soapAction="urn:getTwice" style="document"/> | |||
<wsdl:input> | |||
<soap12:body use="literal"/> | |||
</wsdl:input> | |||
<wsdl:output> | |||
<soap12:body use="literal"/> | |||
</wsdl:output> | |||
</wsdl:operation> | |||
</wsdl:binding> | </wsdl:binding> | ||
<wsdl:binding name="HelloAxisHttpBinding" type=" | <wsdl:binding name="HelloAxisHttpBinding" type="ns:HelloAxisPortType"> | ||
<http:binding verb="POST"/> | <http:binding verb="POST"/> | ||
<wsdl:operation name="getTwice"> | |||
<http:operation location="HelloAxis/getTwice"/> | |||
<wsdl:input> | |||
<mime:content type="text/xml" part="getTwice"/> | |||
</wsdl:input> | |||
<wsdl:output> | |||
<mime:content type="text/xml" part="getTwice"/> | |||
</wsdl:output> | |||
</wsdl:operation> | |||
</wsdl:binding> | </wsdl:binding> | ||
<wsdl:service name="HelloAxis"> | <wsdl:service name="HelloAxis"> | ||
<wsdl:port name="HelloAxisHttpSoap11Endpoint" binding=" | <wsdl:port name="HelloAxisHttpSoap11Endpoint" binding="ns:HelloAxisSoap11Binding"> | ||
<soap:address location="http://localhost:8080/axis2/services/HelloAxis"/> | <soap:address location="http://localhost:8080/axis2/services/HelloAxis"/> | ||
</wsdl:port> | </wsdl:port> | ||
<wsdl:port name="HelloAxisHttpSoap12Endpoint" binding=" | <wsdl:port name="HelloAxisHttpSoap12Endpoint" binding="ns:HelloAxisSoap12Binding"> | ||
<soap12:address location="http://localhost:8080/axis2/services/HelloAxis"/> | <soap12:address location="http://localhost:8080/axis2/services/HelloAxis"/> | ||
</wsdl:port> | </wsdl:port> | ||
<wsdl:port name="HelloAxisHttpEndpoint" binding=" | <wsdl:port name="HelloAxisHttpEndpoint" binding="ns:HelloAxisHttpBinding"> | ||
<http:address location="http://localhost:8080/axis2/services/HelloAxis"/> | <http:address location="http://localhost:8080/axis2/services/HelloAxis"/> | ||
</wsdl:port> | </wsdl:port> | ||
</wsdl:service> | </wsdl:service> | ||
</wsdl:definitions> | </wsdl:definitions> |
Revision as of 01:54, 18 October 2010
axis2
download from http://apache.crihan.fr/dist//ws/axis2/1_5_1/axis2-1.5.1-bin.zip
cd axis2-1.5.1/webapp ant mv axis2-1.5.1/dist/axis2.war /srv/apache-tomcat-6.0.26/webapps/
- check: http://localhost:8080/axis2/ : OK
export AXIS2_HOME=${HOME}/package/axis2-1.5.1
generating wsdl
the source:
public class HelloAxis { public int getTwice(int value) { return value*2; } }
command:
axis2-1.5.1/bin/java2wsdl.sh -cp ~/workspace/SANDBOX/bin -cn HelloAxis -of helloAxis.wsdl
<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://ws.apache.org/axis2"> <wsdl:types> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.apache.org/axis2"> <xs:element name="getTwice"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="value" type="xs:int"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="getTwiceResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" type="xs:int"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </wsdl:types> <wsdl:message name="getTwiceRequest"> <wsdl:part name="parameters" element="ns:getTwice"/> </wsdl:message> <wsdl:message name="getTwiceResponse"> <wsdl:part name="parameters" element="ns:getTwiceResponse"/> </wsdl:message> <wsdl:portType name="HelloAxisPortType"> <wsdl:operation name="getTwice"> <wsdl:input message="ns:getTwiceRequest" wsaw:Action="urn:getTwice"/> <wsdl:output message="ns:getTwiceResponse" wsaw:Action="urn:getTwiceResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="HelloAxisSoap11Binding" type="ns:HelloAxisPortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="getTwice"> <soap:operation soapAction="urn:getTwice" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="HelloAxisSoap12Binding" type="ns:HelloAxisPortType"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="getTwice"> <soap12:operation soapAction="urn:getTwice" style="document"/> <wsdl:input> <soap12:body use="literal"/> </wsdl:input> <wsdl:output> <soap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="HelloAxisHttpBinding" type="ns:HelloAxisPortType"> <http:binding verb="POST"/> <wsdl:operation name="getTwice"> <http:operation location="HelloAxis/getTwice"/> <wsdl:input> <mime:content type="text/xml" part="getTwice"/> </wsdl:input> <wsdl:output> <mime:content type="text/xml" part="getTwice"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="HelloAxis"> <wsdl:port name="HelloAxisHttpSoap11Endpoint" binding="ns:HelloAxisSoap11Binding"> <soap:address location="http://localhost:8080/axis2/services/HelloAxis"/> </wsdl:port> <wsdl:port name="HelloAxisHttpSoap12Endpoint" binding="ns:HelloAxisSoap12Binding"> <soap12:address location="http://localhost:8080/axis2/services/HelloAxis"/> </wsdl:port> <wsdl:port name="HelloAxisHttpEndpoint" binding="ns:HelloAxisHttpBinding"> <http:address location="http://localhost:8080/axis2/services/HelloAxis"/> </wsdl:port> </wsdl:service> </wsdl:definitions>