Hmm, I think I've figured this out. The CamelProxyFactoryBean uses ProxyHelper to create the proxied service - but the "convert a bean invocation with one arg to just the arg" logic requires using the PojoProxyHelper to create the proxied service, as it's using a different invocation handler. So, using a camel proxy in a Spring xml file will never have this behaviour.
It also means that documentation on here: http://camel.apache.org/using-camelproxy.html may be wrong, as it's using the ProxyHelper to create the proxy that demos this feature. I'll have to create an account and log a bug, I think. Regards, Liam Clarke On Sun, Dec 30, 2012 at 3:56 PM, Liam Clarke-Hutchinson <l...@steelsky.co.nz> wrote: > Hi all, > > Quick question, at which point does the BeanInvocation transform into a > first-class payload as documented here: > http://camel.apache.org/using-camelproxy.html ? From the examples in the > docs it looks like it leaves the proxy endpoint as the first-class payload. > > I ask because I'm proxying a service that should meet the requirements for > the implicit transform from BeanInvocation to the first-class argument, but > it's entering the route as a BeanInvocation. The problem is manifesting at > the GSON marshalling stage - the bean invocation is being marshalled, not > the method call argument, so when it arrives in the service, all the fields > of the argument are null. > > The interface (and concrete implementation) being proxied are here: > https://gist.github.com/4410704 > The Spring / Camel context is here: https://gist.github.com/4410713 > > You can see that I've got a commented out explicit transform there - it is > working around the problem by pulling the argument out of the BeanInvocation > explicitly, but it'd be nice if I could used the existing functionality in > Camel. > > Any thoughts / criticisms welcomed, I'm quite new to Camel and I'm amazed at > how powerful it can be, but I do worry about using it inefficiently. > > Regards, > > Liam Clarke > > > > >