问题
I have a scatter gather proxy implementation in which I need to call multiple endpoint systems which have different authorization header (username and password is different for different systems). Currently my esb calls only one endpoint and it discards others having different credentials.
Please help.
回答1:
If your backends use basic authentication, it should work if you set the "Authorization" header before each call of the backends.
<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
来源:https://stackoverflow.com/questions/37816328/how-to-set-different-authorization-header-for-different-endpoint-in-wso2-esb