On Wed, Jun 8, 2011 at 10:37 PM, Gary Brown <g...@pi4tech.com> wrote: > Hi > > I'm using Tuscany 2 beta2 as an embedded component, and invoking a > service component through the > org.apache.tuscany.sca.invocation.Invoker api. > > The service has been created using the cxf wsdl2java tool, so the > parameters are jaxb based Java classes. However I would like to be > able to pass in the XML document and have the framework handle the > necessary transformation to the appropriate type required by the > service interface. > > At present the invocation is just returning a response message with an > IllegalArgumentException in the body. > > Any suggestions, or suitable examples, would be appreciated. > > Regards > Gary >
Hi Gary We do support such transformation but it relies on there being a suitable wire in place between a service binding and the service itself. If you look at the last diagram on this page [1] you'll see a JMS binding being used to access a Java service. In between the binding and the service there is a chain of interceptors. These interceptors typically do formatting and policy handling. In particular the DatabindingInterceptor will try and convert the incoming message from the format at the binding to the format required by the service. Let's say we're receiving XML and the service is written in Java using JAXB objects as operation parameters (as is the case in [1]) then the databinding will look at the incoming message, which will generally be an Axiom object when XML is coming in, and then use a JAXB context to convert this XML to appropriate JAXB objects. The reverse transformation happens when the response is returned. When you say you are "invoking a service component through the org.apache.tuscany.sca.invocation.Invoker api." can you say a bit more about how you retrieve the service to invoke and what what you actually do to enact the invocation. [1] http://tuscany.apache.org/documentation-2x/sca-java-runtime-overview.html Regards Simon -- Apache Tuscany committer: tuscany.apache.org Co-author of a book about Tuscany and SCA: tuscanyinaction.com