首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Camel-cxf调用NTLM安全的cxf服务?

如何使用Camel-cxf调用NTLM安全的cxf服务?
EN

Stack Overflow用户
提问于 2014-10-28 23:21:15
回答 1查看 1K关注 0票数 0

在我的Camel (2.13)流程中,我想使用Camel-CXF调用CXF服务。webservice是使用NTLM保护的。我确实发现CXF本身支持NTLM,但我在Camel-CXF上找不到任何东西。当然,我确实尝试了参数username和password,但这不起作用。Ik看起来像是Camel-CXF不支持它。对如何解决这个问题有什么想法吗?

我使用的是java6,所以我想我不需要jcifs。

罗尔德

EN

回答 1

Stack Overflow用户

发布于 2014-11-20 18:59:13

代码语言:javascript
复制
<cxf:cxfEndpoint id="sharepointQueryEndpoint"
                     address="http://yourhostwithpathtowsdl/_vti_bin/search.asmx"
                     serviceClass="com.somewhere.special.generated.QueryServiceSoap" 
                     endpointName="ssp:SecureConnection"
                     xmlns:ssp="http://microsoft.com/webservices/OfficeServer/QueryService"
            >

        <cxf:properties>
            <entry key="dataFormat" value="POJO"/>
            <entry key="loggingFeatureEnabled" value="true" />
        </cxf:properties>
        <cxf:inInterceptors>
            <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
        </cxf:inInterceptors>

        <cxf:outInterceptors>
            <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
        </cxf:outInterceptors>
    </cxf:cxfEndpoint>

    <http:conduit name="{http://microsoft.com/webservices/OfficeServer/QueryService}SecureConnection.http-conduit">
        <http:client
                AllowChunking="false"
                MaxRetransmits="11"
                Connection="Keep-Alive"
                ReceiveTimeout="60000"
                CacheControl="No-Cache"
                />

        <http:authorization>
            <sec:UserName>Domain\Username</sec:UserName>
            <sec:Password>Password</sec:Password>
            <sec:Authorization>NTLM</sec:Authorization>
        </http:authorization>

    </http:conduit>

cxfEndpoint配置中的属性serviceClass指向由wsdl2java生成的接口。enter code here注意:当此配置从基于Windows的计算机运行时,它不起作用。在握手期间,它将用当前登录用户的凭证替换http-conduit中配置的用户名/密码。有关更多信息,请参阅Can Java's 'single sign-on' (use credentials from 'Credential Manager') on Windows be disabled?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26612039

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档