ule子3.7.将自定义SOAP标头添加到web-service-consumer [英] Mule 3.7. Add custom SOAP header to web-service-consumer

查看:101
本文介绍了ule子3.7.将自定义SOAP标头添加到web-service-consumer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自定义Mule 3.7中的soap头.默认情况下,使用网络服务消费者,我得到以下信息:

I am trying to customize the soap header in Mule 3.7. By default using the web-service-consumer I get the following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap:mustUnderstand="1">
        <wsse:UsernameToken wsu:Id="UsernameToken-6CF0E33EE8AA1E3DB414700278333141">
            <wsse:Username>TEST/wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"/>
        </wsse:UsernameToken>
    </wsse:Security>
</SOAP-ENV:Header>

但是,我想将SOAP标头更改为:

However, I would like to change the SOAP header to be:

<soap:Header>
<Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <UsernameToken>
        <Username>TEST</Username>
    </UsernameToken>
</Security>

我需要在M子中添加以下内容吗?

Where in Mule do I need to add the below?

<set-property propertyName="soap.Authorization"
value="<auth>Bearer MWYxMDk4ZDktNzkyOC00Z</auth>"/>

是否需要在下面的ws:consumer-config中添加以上内容?

Does the above need to be added in the ws:consumer-config below?

<ws:consumer-config name="WSConsumerConfig" wsdlLocation="${wsdl.location}"
service="aService" port="aServiceHttpPort" serviceAddress="${service.url}"
connectorConfig="HTTPRequestConfig" doc:name="Web Service Consumer">

推荐答案

我已通过在调用ws-consumer之前添加一个message-property-transformer来解决问题:

I have fixed by adding a message-property-transformer just before the call to the ws-consumer:

<message-properties-transformer doc:name="Message Properties">
                <add-message-property key="soap.header" value="${web.service.username.token}"/>
            </message-properties-transformer>

这篇关于ule子3.7.将自定义SOAP标头添加到web-service-consumer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆