cxf客户端和总线配置

时间:2015-09-22 11:54:12

标签: web-services cxf jax-ws

我配置cxf客户端(在配置下面)

弹簧CXF客户端:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:cxf="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"
        xsi:schemaLocation="http://www.springframework.org/schema/beans  
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd  
        http://www.springframework.org/schema/context  
        http://www.springframework.org/schema/context/spring-context-3.2.xsd  
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <jaxws:client id="testClient" serviceClass="com.ws.client.TestWS"  address="http://localhost:7001/ir.school-0.0.1-releases/ws/testService">
         <jaxws:binding>
             <soap:soapBinding version="1.2" mtomEnabled="true" />
         </jaxws:binding>
    </jaxws:client>
    <cxf:bus>
        <cxf:outInterceptors>
             <bean class="com.ws.client.OrderProcessClientHandler" />
        </cxf:outInterceptors>
    </cxf:bus>
</beans>

在weblogic 12.1.3上启动应用程序时出现以下错误

  

引起者:org.xml.sax.SAXParseException; lineNumber:22; columnNumber:11; cvc-complex-type.2.4.c:匹配的通配符是strict,但是找不到元素'cxf:bus'的声明。

1 个答案:

答案 0 :(得分:3)

the example in the documentation;标题中定义的xmlns:cxf包含大量数据,其值应该只是http://cxf.apache.org/core而不是您当前的

    xmlns:cxf="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"

您应将其移至xsi:schemaLocation