Hi Cleric,
Thank you for your response.
What I was actually doing is specify via XML configuration (payload-expression) what the payload should be. Here is a sample:
Code:
public interface CampaignGateway {
public Campaign createCampaign(Map<String, String> map);
}
on the gateway definition
Code:
<int:gateway service-interface="my.integration.CampaignGateway">
<int:method name="createCampaign" request-channel="requestChannel"
payload-expression="#args[0]" reply-channel="responseChannel">
<int:header name="Content-type" value="application/x-www-form-urlencoded"/>
</int:method>
</int:gateway>
Please note that I use payload-expression="#args[0]".
Im getting mbiguous method parameters; found more than one Map-typed parameter and neither one contains a @Payload annotation.
Checking GatewayMethodInboundMessageMapper, here's the code that throws the exception:
Code:
else if (Map.class.isAssignableFrom(methodParameter.getParameterType())) {
if (messageOrPayload instanceof Map && !foundPayloadAnnotation) {
throw new MessagingException("Ambiguous method parameters; found more than one " +
"Map-typed parameter and neither one contains a @Payload annotation");
}
this.copyHeaders((Map<?, ?>) argumentValue, headers);
}
It seems the code only expects Map type payloads to be defined via @Payload annotation.
Thanks!