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

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

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

    athrunwang

    紀(jì)元
    數(shù)據(jù)加載中……
    簡(jiǎn)單的基于xfire框架發(fā)布webserivce服務(wù)
    前段時(shí)間在弄各種框架下的webservice,要弄demo,網(wǎng)上搜羅了許多,都講得很好,但感覺(jué)就是說(shuō)得很多很復(fù)雜,我就想弄個(gè)服務(wù)出來(lái)供我用一下, 要像網(wǎng)上那么做覺(jué)著太麻煩,后來(lái)參考各路神仙大佬們后,把代碼極度縮小,寫(xiě)了個(gè)小實(shí)例供自個(gè)跑著玩,順便代碼貼上,供大伙口水
    支持包:xfire框架lib下核心包,自己官網(wǎng)上下去,在這里就不貼了,除此之外有java環(huán)境1.6+就Ok了,其它略過(guò),上代碼了。
    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ù)想咋整自已實(shí)現(xiàn)去吧,我這里作例子,就直接回true了,呵呵
            return false;
        }

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

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

        
    }
    //現(xiàn)在src下建個(gè)xfire文件夾,新建個(gè)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包再跑,隨便你選擇一個(gè)跑開(kāi)即行了,訪(fǎng)問(wèn)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 閱讀(331) 評(píng)論(0)  編輯  收藏


    只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 中文毛片无遮挡高潮免费| 久久久久久国产精品免费免费| 亚洲精品~无码抽插| 99re6热视频精品免费观看| 亚洲一级视频在线观看| 亚洲国产精品毛片av不卡在线| 两个人看的www高清免费视频| 亚洲一区无码中文字幕乱码| 免费在线视频一区| 一区二区三区观看免费中文视频在线播放| 亚洲fuli在线观看| 国产综合精品久久亚洲| 在线看片韩国免费人成视频| 一级毛片大全免费播放| 亚洲成av人片不卡无码| 亚洲国产成人久久综合区| 国产福利视精品永久免费| 乱淫片免费影院观看| 亚洲一区二区三区播放在线| 中文字幕亚洲乱码熟女一区二区| 67194熟妇在线永久免费观看| 国产视频精品免费视频| 亚洲精品第一综合99久久| 亚洲AV无码专区电影在线观看| 在线日韩av永久免费观看| 三年片在线观看免费大全电影| 国产亚洲精彩视频| 亚洲精品中文字幕无乱码麻豆| 亚洲精品美女久久777777| 国产禁女女网站免费看| 嘿嘿嘿视频免费网站在线观看| 国产精品免费久久久久电影网| 亚洲国产无线乱码在线观看| 亚洲精品成人网站在线播放| 久久久久国产成人精品亚洲午夜 | 免费一区二区三区| 中美日韩在线网免费毛片视频| 亚洲中文字幕无码久久| 亚洲福利一区二区精品秒拍| 亚洲国产精品无码专区在线观看| 免费大黄网站在线观看|