我在WSO2 EI上配置了WSDL代理服务,该服务指向OAuth确保的外部服务。
我的问题是,除了我的所有努力之外,我无法在服务电话上设置持票人授权标题。服务端点始终返回"找不到oauth代币"错误。我已经尝试了有关标题的所有WSO2教程和文档(使用标题中介和标头作为属性),但没有任何可用。
我的问题与这个问题相似,也没有anwser。
WSDL代理服务由WCF .NET应用程序消耗,并设置了承载标头。
这是XML配置:
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="WSDLProxy"
startOnLoad="true"
statistics="disable"
trace="disable"
transports="http">
<target>
<inSequence>
<send>
<endpoint>
<wsdl port="RegisterEndpoint"
service="RegisterService.serviceagent"
uri="[external-wsdl-uri]"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
</target>
<publishWSDL uri="[external-wsdl-uri]"/>
</proxy>
在传递场景中,例如WSDL代理服务的给定样本,如果在客户端的请求中发送了" WSDLProxy'的请求",则将'授权'标题发送到后端服务。。但是,如果您的客户在自定义运输标题中发送携带者令牌,则必须在后端呼叫之前将其设置为"授权"标题,如下所示。
。
...
<inSequence>
<property expression="get-property('transport', 'CUSTOM-Bearer')" name="Authorization" scope="transport" type="STRING"/>
<property action="remove" name="CUSTOM-Bearer" scope="transport"/>
<send>
<endpoint>
<wsdl port="RegisterEndpoint"
service="RegisterService.serviceagent"
uri="[external-wsdl-uri]"/>
</endpoint>
</send>
</inSequence>
...