如何为 wso2 esb 中的不同端点设置不同的授权 header

how to set different authorization header for different endpoint in wso2 esb

我有一个分散收集代理实现,其中我需要调用具有不同授权的多个端点系统 header(不同系统的用户名和密码不同)。目前我的 esb 只调用一个端点,它会丢弃其他具有不同凭据的端点。

请帮忙。

如果您的后端使用基本身份验证,则在每次调用后端之前设置 "Authorization" header 应该可以。

<property xmlns:ns="http://org.apache.synapse/xsd"  
       name="Authorization"  
       expression="fn:concat('Basic ', base64Encode('username:password'))"  
       scope="transport"/>  
  <send>  endpoint1

.....

<property xmlns:ns="http://org.apache.synapse/xsd"  
           name="Authorization"  
           expression="fn:concat('Basic ', base64Encode('username2:password2'))"  
           scope="transport"/>  
      <send>  endpoint2