`
suhuanzheng7784877
  • 浏览: 692687 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
Ff8d036b-05a9-33b5-828a-2633bb68b7e6
读金庸故事,品程序人生
浏览量:47291
社区版块
存档分类
最新评论

Web Service框架XFire与Tomcat集成(2)

阅读更多

Wsdl内容如下

<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions targetNamespace="http://webservice"

    xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"

    xmlns:tns="http://webservice"

    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://webservice">

           <xsd:element name="sayHello">

              <xsd:complexType>

                  <xsd:sequence>

                     <xsd:element maxOccurs="1" minOccurs="1"

                         name="in0" nillable="true" type="xsd:string" />

                  </xsd:sequence>

               </xsd:complexType>

           </xsd:element>

           <xsd:element name="sayHelloResponse">

              <xsd:complexType>

                  <xsd:sequence>

                     <xsd:element maxOccurs="1" minOccurs="1"

                         name="out" nillable="true" type="xsd:string" />

                  </xsd:sequence>

              </xsd:complexType>

           </xsd:element>

       </xsd:schema>

    </wsdl:types>

    <wsdl:message name="sayHelloResponse">

       <wsdl:part name="parameters" element="tns:sayHelloResponse">

       </wsdl:part>

    </wsdl:message>

    <wsdl:message name="sayHelloRequest">

       <wsdl:part name="parameters" element="tns:sayHello"></wsdl:part>

    </wsdl:message>

    <wsdl:portType name="sayHelloPortType">

       <wsdl:operation name="sayHello">

           <wsdl:input name="sayHelloRequest"

              message="tns:sayHelloRequest">

           </wsdl:input>

           <wsdl:output name="sayHelloResponse"

              message="tns:sayHelloResponse">

           </wsdl:output>

       </wsdl:operation>

    </wsdl:portType>

    <wsdl:binding name="sayHelloHttpBinding"

       type="tns:sayHelloPortType">

       <wsdlsoap:binding style="document"

           transport="http://schemas.xmlsoap.org/soap/http" />

       <wsdl:operation name="sayHello">

           <wsdlsoap:operation soapAction="" />

           <wsdl:input name="sayHelloRequest">

              <wsdlsoap:body use="literal" />

           </wsdl:input>

           <wsdl:output name="sayHelloResponse">

              <wsdlsoap:body use="literal" />

           </wsdl:output>

       </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="sayHello">

       <wsdl:port name="sayHelloHttpPort"

           binding="tns:sayHelloHttpBinding">

           <wsdlsoap:address

               location="http://127.0.0.1:8080/xfireClient/services/sayHello" />

       </wsdl:port>

    </wsdl:service>

</wsdl:definitions>

到此,一个小小的web service已经发布成功。下次有时间在写XFire客户端的代码和实例。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics