CXF下基于已发布WSDL获取远程服务

                                 新手教程

 (详细内容请下载附件)

阅读本文前提:

           假设您已经阅读了我另外一篇不成熟的文章<< eclipse3.3+CXF2.1配置                        webservice开发环境>>

           地址:http://zhaoyl.iteye.com/admin/blogs/183779

本文目标:

           1、进一步熟悉使用soa tools

           2、使用soa tool发布已经生成的wsdl,向外界提供远程服务

           3、使用wsdl first project方式 ,根据服务提供商发布的wsdl,调用远程服务

           4code first wsdl  first 区别及code first带来的问题

后续文章目标:

           1spring下使用cxf发布服务(服务端)并调用服务接口(客户端)

           2wsdl first 并介绍wsdl编写规则

    明:

           本文为我手写而成,未抄袭其他人之作品等。如确实有雷同,请告知

           文中若有错误之处,请来信告知

           如您转载,请保留作者信息,致谢

联系方式: QQ252574345

           MSNlele_love_lomboz@hotmail.com

                           第一部分 发布服务并使用客户端调用

一.上篇文章续

1、项目目录如下

 

可以看到,我们已经生成了wsdl。此时,只是定义业务接口暴露给外界,而并未提供接口的实现,即:服务将要提供的功能还没有实现。

Demo.wsdl

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

<wsdl:definitions name="HelloService" targetNamespace="http://webservice.zhaoyl.org/" xmlns:tns="http://webservice.zhaoyl.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

  <wsdl:types>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.zhaoyl.org/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://webservice.zhaoyl.org/">

    <xs:element name="sayHello" type="tns:sayHello"/>

    <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>

    <xs:complexType name="sayHello">

        <xs:sequence/>

    </xs:complexType>

    <xs:complexType name="sayHelloResponse">

        <xs:sequence>

            <xs:element minOccurs="0" name="return" type="xs:string"/>

        </xs:sequence>

    </xs:complexType>

</xs:schema>

  </wsdl:types>

  <wsdl:message name="sayHello">

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

    </wsdl:part>

  </wsdl:message>

  <wsdl:message name="sayHelloResponse">

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

    </wsdl:part>

  </wsdl:message>

  <wsdl:portType name="Hello">

    <wsdl:operation name="sayHello">

      <wsdl:input name="sayHello" message="tns:sayHello">

    </wsdl:input>

      <wsdl:output name="sayHelloResponse" message="tns:sayHelloResponse">

    </wsdl:output>

    </wsdl:operation>

  </wsdl:portType>

  <wsdl:binding name="HelloServiceSoapBinding" type="tns:Hello">

    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="sayHello">

      <soap:operation soapAction="" style="document"/>

      <wsdl:input name="sayHello">

        <soap:body use="literal"/>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值