0 0

使用CXF生成的WSDL,如何才能带ws-security5

如题。

 

由于项目需求,服务端使用CXF建一个WebService,但客户端是C#与PHP的。

 

由于C#或者PHP都通过WSDL文件,来反射生成调用代码,因此要求在生成的WSDL中带WS-SECURITY的信息。但CXF默认生成的都没带该部分信息。

 

google一天了,都没有看到怎么做的例子。

 

请问这里有人知道吗?

 

我希望生成的WDSL如:http://lists.w3.org/Archives/Public/www-ws-desc/2005Jan/att-0094/soap-header-blocks.html

 

 

<?xml version="1.0"?>
<wsdl:description name="StockQuote" 
  xmlns:wsdl="http://www.w3.org/@@@@/@@/wsdl"
  targetNamespace="http://example.com/stockquote"
  xmlns:tns="http://example.com/stockquote"
  xmlns:wsoap="http://www.w3.org/@@@@/@@/wsdl/soap"
  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
     
  <wsdl:types>
    <xs:schema targetNamespace="http://example.com/stockquote"
      xmlns:xs="http://www.w3.org/2001/XMLSchema" 
      elementFormDefault="qualified">
      <xs:import
        namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
        schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
      <xs:element name="TradePriceRequest">
        <xs:complexType>
          <xs:all>
            <xs:element name="tickerSymbol" type="xs:string"/>
          </xs:all>
        </xs:complexType>
      </xs:element>
      <xs:element name="TradePrice">
        <xs:complexType>
          <xs:all>
            <xs:element name="price" type="xs:float"/>
          </xs:all>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="myHeaders">
        <xs:sequence>
         <xs:element ref="wsse:Security" 
               wsoap:mustUnderstand="true"/>
         <xs:element name="isGoldClubMember" 
               type="xs:boolean" wsoap:mustUnderstand="true"/>
         <xs:element name="promotionalCode" 
               type="xs:string" minOccurs="0"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
  </wsdl:types>
  
  <wsdl:interface name="StockQuoteInterface">
    <wsdl:operation name="GetLastTradePrice" 
      pattern="http://www.w3.org/@@@@/@@/wsdl/in-out">
      <wsdl:input element="tns:GetLastTradePriceInput"/>
      <wsdl:output element="tns:GetLastTradePriceOutput"/>
    </wsdl:operation>
  </wsdl:interface>
  
  <wsdl:binding name="StockQuoteSoapBinding" interface="tns:StockQuoteInterface"
    type="http://www.w3.org/@@@@/@@/wsdl/soap" 
    wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
    <wsdl:operation ref="tns:GetLastTradePrice" 
      wsoap:action="http://example.com/GetLastTradePrice">
        <wsdl:input wsoap:headerDescription="tns:myHeaders"/>
        <wsdl:output wsoap:headerDescription="tns:myHeaders"/>
    </wsdl:operation>
  </wsdl:binding>
  
  <wsdl:service name="StockQuoteService" interface="tns:StockQuoteInterface">
    <wsdl:documentation>My first service</wsdl:documentation>
    <wsdl:endpoint name="StockQuoteEndPoint" binding="tns:StockQuoteBinding" 
    address="http://example.com/endpoint/stockquote"/>
  </wsdl:service>
  
</wsdl:description>
2012年10月29日 17:57
目前还没有答案

相关推荐

    cxfWebservice客户端全部jar包及极简调用方法.rar

    udp-3.0.11.jar,cxf-rt-wsdl-3.0.0.jar,cxf-rt-ws-security-3.0.0.jar,neethi-3.0.3.jar,slf4j-api-1.7.7.jar,stax2-api-3.1.4.jar,woodstox-core-asl-4.4.1.jar,wsdl4j-1.6.3.jar,wss4j-bindings-2.0.9.jar,xml...

    wsdl2java源码-wsdl-to-stub-generate:从wsdl生成存根的项目

    wsdl2java源码wsdl 到存根生成 从 wsdl 生成存根的项目 生成客户端存根 添加以下依赖项以从 wsdl 文件创建存根 org.apache.cxf cxf ...中添加以下代码以生成客户端存根 org.apache.cxf ...cxf-rt-ws-security 3.1.4

    apache-cxf-3.3.5

    Web Services Standards Support: CXF supports a variety of web service standards including SOAP, the Basic Profile, WSDL, WS-Addressing, WS-Policy, WS-ReliableMessaging, WS-Security, WS-SecurityPolicy,...

    apache-cxf-3.3.4

    WS-Security WS-SecurityPolicy WS-SecureConversation JAX-WS API,用于Web服务开发 WSDL优先工具 Java优先支持 JAX-RS (JSR 311 1.0) API,用于RESTfulWeb服务开发 JavaScript编程模型,用于客户端和服务端...

    cxf(jax-ws)+spring+hibernate整合包

    jetty-io-8.1.7.v20120910.jar,jetty-security-8.1.7.v20120910.jar,jetty-server-8.1.7.v20120910.jar,jetty-util-8.1.7.v20120910.jar,joda-time-1.6.2.jar,js-1.7R2.jar,jsf-api.jar,jsf-impl.jar,jstl-1.2.jar,...

    apache-cxf-3.1.1

    支持 Web Services 标准:CXF 支持多种 Web Services 标准,包含 SOAP、Basic Profile、WS-Addressing、WS-Policy、WS-ReliableMessaging 和 WS-Security。Frontends:CXF 支持多种“Frontend”编程模型,CXF 实现了...

    cxf+spring webservice jar包

    jetty-security-7.5.4.v20111024.jar jetty-server-7.5.4.v20111024.jar jetty-util-7.5.4.v20111024.jar joda-time-1.6.2.jar js-1.7R2.jar json-lib-2.4-jdk15.jar jsr311-api-1.1.1.jar mimepull-1.7.jar msv-...

    CXF创建webservice服务端.doc

    1. 支持 Web Services 标准:CXF 支持多种 Web Services 标准,包含 SOAP、Basic Profile、WS-Addressing、WS-Policy、WS-ReliableMessaging 和 WS-Security。 2. Frontends:CXF 支持多种“Frontend”编程模型,...

    CXF的学习笔记

    CXF 包含了大量的功能特性,但是主要集中在以下几个方面: 支持 Web Services 标准:CXF 支持多种 Web Services 标准,包含 SOAP、Basic Profile、WS-Addressing、WS-Policy、WS-ReliableMessaging 和 WS-Security。...

    cxf:Apache CXF

    CXF包含广泛的功能集,但主要集中在以下领域: Web服务标准支持:CXF支持各种Web服务标准,包括SOAP,基本配置文件,WSDL,WS-Addressing,WS-Policy,WS-ReliableMessaging,WS-Security,WS-Securi

    wssecurity:wssecurity 示例存储库

    .wsdl 生成实体定义 Web 服务实现类配置 cxf jaxws 端点参考添加spring web配置创建 Web 应用程序 web.xml 描述符将 jetty maven 插件添加到启动实现 Web 服务客户端使用拦截器保护 Web 服务使用 WS-Policy 保护 Web...

    WebService CXF学习文档

    做开发时,查了大量资料,发现一比较全面的资料,分享一下! WebService CXF学习——入门篇 1.CXF由来 2.HelloWorld 3.WSDL描述 WebService CXF学习——进阶篇 ... 3.WS-Security WebService CXF学习——JAXB剖析

Global site tag (gtag.js) - Google Analytics