<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    athrunwang

    紀元
    數(shù)據(jù)加載中……
    簡單的基于xfire框架發(fā)布webserivce服務(wù)
    前段時間在弄各種框架下的webservice,要弄demo,網(wǎng)上搜羅了許多,都講得很好,但感覺就是說得很多很復(fù)雜,我就想弄個服務(wù)出來供我用一下, 要像網(wǎng)上那么做覺著太麻煩,后來參考各路神仙大佬們后,把代碼極度縮小,寫了個小實例供自個跑著玩,順便代碼貼上,供大伙口水
    支持包:xfire框架lib下核心包,自己官網(wǎng)上下去,在這里就不貼了,除此之外有java環(huán)境1.6+就Ok了,其它略過,上代碼了。
    package com.tyky.test.bean;

    public class Employee{
        
        private String id;
        
        private String name;
        
        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        private String address;
        
        
    }
    package com.tyky.service;

    import com.tyky.test.bean.Employee;

    public interface EmployeeService {

        public boolean addEmployee(Employee e);
        
        public boolean deleteEmployee(String id);
        
        public Employee getEmployee(String id);
        
    }
    package com.tyky.serviceImpl;

    import com.tyky.service.EmployeeService;
    import com.tyky.test.bean.Employee;

    public class EmployeeServiceImpl implements EmployeeService {

        @Override
        public boolean addEmployee(Employee e) {
            //業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵
            return false;
        }

        @Override
        public boolean deleteEmployee(String id) {
            //業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵
            return false;
        }

        @Override
        public Employee getEmployee(String id) {
            //業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵
            Employee e = new Employee();
            e.setAddress("http://業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵");
            e.setId("http://業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵");
            e.setName("http://業(yè)務(wù)想咋整自已實現(xiàn)去吧,我這里作例子,就直接回true了,呵呵");
            return e;
        }

        
    }
    //現(xiàn)在src下建個xfire文件夾,新建個service.xml文件
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://xfire.codehaus.org/config/1.0">

        <service>
            <name>EmployeeService</name>
            <serviceClass>com.tyky.service.EmployeeService</serviceClass>
            <implementationClass>
                com.tyky.serviceImpl.EmployeeServiceImpl
            </implementationClass>
            <style>document</style>
        </service>
    </beans>
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
      <servlet>
        <servlet-name>XFireServlet</servlet-name>
        <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>XFireServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>
    //現(xiàn)在工程完成,可以把容器集成到eclipse里跑,也可以打war包再跑,隨便你選擇一個跑開即行了,訪問http://localhost:8080/employeeServiceForXfire/services/EmployeeService?wsdl
    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions targetNamespace="http://service.tyky.com" xmlns:ns1="http://bean.test.tyky.com" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:tns="http://service.tyky.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    - <wsdl:types>
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.tyky.com">
      <xsd:element name="getEmployeein0" type="xsd:string" />
      <xsd:element name="getEmployeeout" type="ns1:Employee" />
      <xsd:element name="addEmployeein0" type="ns1:Employee" />
      <xsd:element name="addEmployeeout" type="xsd:boolean" />
      <xsd:element name="deleteEmployeein0" type="xsd:string" />
      <xsd:element name="deleteEmployeeout" type="xsd:boolean" />
      </xsd:schema>
    - <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://bean.test.tyky.com">
    - <xsd:complexType name="Employee">
    - <xsd:sequence>
      <xsd:element minOccurs="0" name="address" nillable="true" type="xsd:string" />
      <xsd:element minOccurs="0" name="id" nillable="true" type="xsd:string" />
      <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string" />
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>
      </wsdl:types>
    - <wsdl:message name="getEmployeeResponse">
      <wsdl:part name="getEmployeeout" element="tns:getEmployeeout" />
      </wsdl:message>
    - <wsdl:message name="deleteEmployeeRequest">
      <wsdl:part name="deleteEmployeein0" element="tns:deleteEmployeein0" />
      </wsdl:message>
    - <wsdl:message name="addEmployeeResponse">
      <wsdl:part name="addEmployeeout" element="tns:addEmployeeout" />
      </wsdl:message>
    - <wsdl:message name="getEmployeeRequest">
      <wsdl:part name="getEmployeein0" element="tns:getEmployeein0" />
      </wsdl:message>
    - <wsdl:message name="addEmployeeRequest">
      <wsdl:part name="addEmployeein0" element="tns:addEmployeein0" />
      </wsdl:message>
    - <wsdl:message name="deleteEmployeeResponse">
      <wsdl:part name="deleteEmployeeout" element="tns:deleteEmployeeout" />
      </wsdl:message>
    - <wsdl:portType name="EmployeeServicePortType">
    - <wsdl:operation name="getEmployee">
      <wsdl:input name="getEmployeeRequest" message="tns:getEmployeeRequest" />
      <wsdl:output name="getEmployeeResponse" message="tns:getEmployeeResponse" />
      </wsdl:operation>
    - <wsdl:operation name="addEmployee">
      <wsdl:input name="addEmployeeRequest" message="tns:addEmployeeRequest" />
      <wsdl:output name="addEmployeeResponse" message="tns:addEmployeeResponse" />
      </wsdl:operation>
    - <wsdl:operation name="deleteEmployee">
      <wsdl:input name="deleteEmployeeRequest" message="tns:deleteEmployeeRequest" />
      <wsdl:output name="deleteEmployeeResponse" message="tns:deleteEmployeeResponse" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="EmployeeServiceHttpBinding" type="tns:EmployeeServicePortType">
      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="getEmployee">
      <wsdlsoap:operation soapAction="" />
    - <wsdl:input name="getEmployeeRequest">
      <wsdlsoap:body use="literal" />
      </wsdl:input>
    - <wsdl:output name="getEmployeeResponse">
      <wsdlsoap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="addEmployee">
      <wsdlsoap:operation soapAction="" />
    - <wsdl:input name="addEmployeeRequest">
      <wsdlsoap:body use="literal" />
      </wsdl:input>
    - <wsdl:output name="addEmployeeResponse">
      <wsdlsoap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
    - <wsdl:operation name="deleteEmployee">
      <wsdlsoap:operation soapAction="" />
    - <wsdl:input name="deleteEmployeeRequest">
      <wsdlsoap:body use="literal" />
      </wsdl:input>
    - <wsdl:output name="deleteEmployeeResponse">
      <wsdlsoap:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="EmployeeService">
    - <wsdl:port name="EmployeeServiceHttpPort" binding="tns:EmployeeServiceHttpBinding">
      <wsdlsoap:address location="http://192.9.11.53:8080/employeeServiceForXfire/services/EmployeeService" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

    posted on 2011-12-28 20:56 AthrunWang 閱讀(327) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 2015日韩永久免费视频播放 | 国产免费无码AV片在线观看不卡 | 久久亚洲中文字幕精品一区四| 亚洲欧洲美洲无码精品VA| 国产AV日韩A∨亚洲AV电影| 国产精品无码素人福利免费| 国产成A人亚洲精V品无码| 久久亚洲精品国产精品婷婷| eeuss影院ss奇兵免费com| 91香蕉国产线在线观看免费 | 亚洲性无码AV中文字幕| 中文字幕乱码系列免费| 国产l精品国产亚洲区在线观看| 国产中文字幕在线免费观看 | 精品亚洲永久免费精品| 两性色午夜视频免费播放| 九九九国产精品成人免费视频| a级成人毛片免费视频高清| 国产精品亚洲片在线观看不卡| 中文字幕在线观看亚洲| 免费在线观看h片| 在线观看日本亚洲一区| 免费观看国产精品| 丝袜捆绑调教视频免费区| 亚洲午夜久久影院| 男人的好免费观看在线视频| 亚洲成av人影院| 亚洲免费视频播放| 在线观看国产一区亚洲bd| 亚洲乱亚洲乱妇无码麻豆| 中文字幕亚洲免费无线观看日本 | 国产亚洲一区二区三区在线| 在线看无码的免费网站| 亚洲精品无码久久久久APP| 成年黄网站色大免费全看| 亚洲三级电影网址| 在线观看人成网站深夜免费| 国产av无码专区亚洲av桃花庵| 亚洲AV无码精品色午夜果冻不卡 | 久久精品国产亚洲av麻豆| 亚洲精品在线免费看|