论坛首页 Java企业应用论坛

如何用cxf的动态客户端调用原系统的axis服务?

浏览 4831 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-04-30  
SOA
    如题,原系统使用axis开发的webservice服务端,现在想做个前置机,前置机用cxf提供webservice给其他系统,但是功能还是得调用原系统的webservice,使用了ClientProxyFactoryBean动态客户端,不成功。

    原来的axis的wsdl文件也不能生成cxf的客户端。wsdl2java出错。而且在eclipse里面校验时有警告。
    该服务只有一个方法:productorder,参数Productorder是个对象
    axis服务端生成的wsdl文档:


   
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://_interface.productorder.product.jboss.callcenter.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://_interface.productorder.product.jboss.callcenter.com" xmlns:intf="http://_interface.productorder.product.jboss.callcenter.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema targetNamespace="http://_interface.productorder.product.jboss.callcenter.com" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="Productorder">
    <sequence>
     <element name="card_id" type="xsd:string"/>
     <element name="product_id" type="xsd:string"/>
     <element name="opert_id" type="xsd:string"/>
     <element name="trade_id" type="xsd:string"/>
     <element name="amount_month" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="productorderRequest">

      <wsdl:part name="productorder" type="impl:Productorder"/>

   </wsdl:message>

   <wsdl:message name="productorderResponse">

      <wsdl:part name="productorderReturn" type="soapenc:string"/>

   </wsdl:message>

   <wsdl:portType name="ProductOrderServicePort">

      <wsdl:operation name="productorder" parameterOrder="productorder">

         <wsdl:input message="impl:productorderRequest" name="productorderRequest"/>

         <wsdl:output message="impl:productorderResponse" name="productorderResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="ProductOrderServicePortSoapBinding" type="impl:ProductOrderServicePort">

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

      <wsdl:operation name="productorder">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="productorderRequest">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://_interface.productorder.product.jboss.callcenter.com" use="encoded"/>

         </wsdl:input>

         <wsdl:output name="productorderResponse">

            <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://_interface.productorder.product.jboss.callcenter.com" use="encoded"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="ProductOrderServicePortService">

      <wsdl:port binding="impl:ProductOrderServicePortSoapBinding" name="ProductOrderServicePort">

         <wsdlsoap:address location="http://10.1.1.187:9000/BossServiceForTS/services/ProductOrderServicePort"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>


难道一定要用axis才能调用?
PS:用axis生成的客户端是可以成功调用的
   发表时间:2008-05-03  
你的wsdl 是rpc-encoded , CXF不支持这种编码方式。
0 请登录后投票
   发表时间:2008-05-04  
Oh,no
那只好还是用axis来调用了
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics