zoukankan      html  css  js  c++  java
  • Axis2实践


    以前开发webservice使用IBM工具比较简单,最近重新感觉一下使用AXIS2。
    基本步骤:
    1 eclipse
    2 axis2文件
    3 tomcat容器/jetty

    创建javaBean,反向为wsdl,同时使用wsdl制作client。


    TestCal

    Hi there, this is an AXIS service!

    Perhaps there will be a form for invoking the service here...


    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://rx.com" xmlns:intf="http://rx.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://rx.com">
    <!--
    WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)
    -->
    <wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://rx.com">
    <element name="s" type="xsd:string"/>
    <element name="sayReturn" type="xsd:string"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="sayResponse">
    <wsdl:part element="impl:sayReturn" name="sayReturn"></wsdl:part>
    </wsdl:message>
    <wsdl:message name="sayRequest">
    <wsdl:part element="impl:s" name="s"></wsdl:part>
    </wsdl:message>
    <wsdl:portType name="TestCal">
    <wsdl:operation name="say" parameterOrder="s">
    <wsdl:input message="impl:sayRequest" name="sayRequest"></wsdl:input>
    <wsdl:output message="impl:sayResponse" name="sayResponse"></wsdl:output>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="TestCalSoapBinding" type="impl:TestCal">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="say">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="sayRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="sayResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="TestCalService">
    <wsdl:port binding="impl:TestCalSoapBinding" name="TestCal">
    <wsdlsoap:address location="http://localhost/a/services/TestCal"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>



    package com.rx;


    import java.rmi.RemoteException;


    public class MyTest {


    /**
    * @param args
    * @throws RemoteException 
    */
    public static void main(String[] args) throws RemoteException {
    TestCal testCal = new TestCalProxy();
    System.out.println(testCal.say("bdfdfa"));
    }
    }

    war部署到容器中。
    客户端测试代码
    在tomcat和jetty(D:\jetty-6.1.6>java -jar start.jar)下都测试通过。

    下面的推荐我没仔细看,瞄了一眼, 感觉还比较全。

    推荐:http://sumdwang.blog.163.com/blog/static/7929695020113281127488/

  • 相关阅读:
    正则表达式match方法和search方法
    正则表达式(基础篇1)
    动画
    重绘和重排(回流)
    数组常用的10个方法
    css3只需一招,将网站变成灰色的
    Python-类的几种调用方法
    Codeforces Global Round 8 C. Even Picture(构造)
    Codeforces Global Round 8 D. AND, OR and square sum(位运算)
    Codeforces Round #650 (Div. 3) C. Social Distance
  • 原文地址:https://www.cnblogs.com/hehehaha/p/6332484.html
Copyright © 2011-2022 走看看