Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring integration 具有基本身份验证的Spring集成出站网关_Spring Integration - Fatal编程技术网

Spring integration 具有基本身份验证的Spring集成出站网关

Spring integration 具有基本身份验证的Spring集成出站网关,spring-integration,Spring Integration,我见过一些例子,但我无法使用这些解决方案 问题是,我必须将基本身份验证信息作为配置的一部分传递 下面是当前请求…您能告诉我如何添加基本身份验证吗 <bean id="WSACaoedelen" class="nl.bIntnActiCallback"> <constructor-arg index="0" value="http://enst.nl/kkm/Kkmervice/toest"></constructor-arg>

我见过一些例子,但我无法使用这些解决方案

问题是,我必须将基本身份验证信息作为配置的一部分传递

下面是当前请求…您能告诉我如何添加基本身份验证吗

<bean id="WSACaoedelen" class="nl.bIntnActiCallback">
        <constructor-arg index="0" value="http://enst.nl/kkm/Kkmervice/toest"></constructor-arg>
        <constructor-arg index="1" value="${KKSEURL}"></constructor-arg>
    </bean> 
    <int:chain input-channel="kkChannel" output-channel="dest-channel">
        <ws:header-enricher>       
            <ws:soap-action value="http://knst.nl/kkm/KkService/toest"/>
        </ws:header-enricher>           
        <ws:outbound-gateway uri="${GATEWAY}" request-callback="WSACaoedelen"/>
    </int:chain>

基本身份验证的要点是它是HTTP传输的一部分

您需要考虑使用<代码> HtpPosithsMsAsEsEngs<代码>,使用注入的<代码> SETCuffTIANTALSH()/<代码>。在您的情况下,我想您可以使用
UsernamePasswordCredentials

<bean id="httpComponentsMessageSender" class="org.springframework.ws.transport.http.HttpComponentsMessageSender">
    <property name="credentials">
        <bean class="org.apache.http.auth.UsernamePasswordCredentials">
            <constructor-arg value="userName"/>
            <constructor-arg value="password"/>
        </bean>
    </property>
</bean>
...
<ws:outbound-gateway uri="${GATEWAY}" message-sender="httpComponentsMessageSender"/>

...

答案有效。谢谢。由于我们还有加密,我需要使用属性BSPWD=ENC(${BSPWD})和jasypt bean?错误:soapenv:Server.Transport.Http.4011136 Http Web服务返回错误:Http/1.1 401未经授权