Apache camel 如何使用ws-security调用wsdl

Apache camel 如何使用ws-security调用wsdl,apache-camel,Apache Camel,我试图从ApacheCamel调用具有ws-security的wsdl服务,而不使用ApacheCxf作为端点 这是怎么做到的 提前谢谢 在不使用ApacheCXF的情况下从ApacheCamel Camel是一个集成框架(在端点之间传递消息)。Camel itelf无法在没有Camel端点的情况下调用任何外部服务(这是一种知道如何调用特定服务/技术的逻辑) 因此,如果您想调用具有安全性的web服务,您需要一些框架来签名或验证Soap消息(您自己真的不想这么做) 示例如何使用Camel和CXF做

我试图从ApacheCamel调用具有ws-security的wsdl服务,而不使用ApacheCxf作为端点

这是怎么做到的

提前谢谢

在不使用ApacheCXF的情况下从ApacheCamel

Camel是一个集成框架(在端点之间传递消息)。Camel itelf无法在没有Camel端点的情况下调用任何外部服务(这是一种知道如何调用特定服务/技术的逻辑)

因此,如果您想调用具有安全性的web服务,您需要一些框架来签名或验证Soap消息(您自己真的不想这么做)

示例如何使用Camel和CXF做到这一点:(此示例用于公开服务,而不是使用/调用,但原理相同,配置非常相似)


 <camelcxf:cxfEndpoint id="egovAddressEndpoint"
                     address="/egov/api/external/AddressService"
                     xmlns:addr="http://address.ws.egov.xxx.com/v1_0/ws"
                     serviceName="addr:eGovAddressService"
                     endpointName="addr:AddressServicePortBinding" 
serviceClass="com.xxx.egov.ws.address.v1_0.ws.EGovAddressService">
    <!--        wsdlURL="classpath:com/xxx/egov/ws/address/v1_0/AddressService.wsdl"-->
    <camelcxf:properties>
        <entry key="dataFormat" value="PAYLOAD" />
<!-- maybe one of these is enough, I put both directives to be sure.
The intention is not to provide a password callback, but let the CXF
use an underlaying security context to authenticate and authorize users -->
        <entry key="ws-security.ut.no-callbacks" value="true"/>
        <entry key="ws-security.validate.token" value="false"/>
    </camelcxf:properties>
    <camelcxf:outInterceptors>
        <!--<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>-->
    </camelcxf:outInterceptors>
    <camelcxf:inInterceptors>
        <!--<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>-->
        <ref component-id="wsSecInterceptor" />
        <ref component-id="authenticationInterceptor"/>  
        <ref component-id="authorizationInterceptor" />          
    </camelcxf:inInterceptors>
</camelcxf:cxfEndpoint>

<bean id="wsSecInterceptor" class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
    <argument>
        <map>
            <entry key="action" value="UsernameToken"/>
            <entry key="passwordType" value="PasswordText"/>
        </map>
    </argument>
</bean>