On Tue, Jul 14, 2009 at 4:17 PM, Paul Fremantle<[email protected]> wrote: > It would be great to be able to assign message builders/formatters on > a per proxy basis in synapse.xml. Thoughts? > > Paul
+1 Thanks, Saliya > > On Tue, Jul 14, 2009 at 11:07 AM, Supun Kamburugamuva<[email protected]> > wrote: >> Hi, >> How about using org.apache.axis2.format.PlainTextFormatter >> and org.apache.axis2.format.PlainTextBuilder? >> >> Thanks, >> Supun.. >> >> On Tue, Jul 14, 2009 at 10:16 AM, Coulombe, Greg >> <[email protected]>wrote: >> >>> Sure. Here is the synapse.xml, axis2.xml is below: >>> >>> <definitions xmlns="http://ws.apache.org/ns/synapse"> >>> <endpoint name="myEndPoint"> >>> <address uri="http://localhost:8080/myendpoint" >>> format="rest" /> >>> </endpoint> >>> >>> <proxy name="myProxy" transports="http" startOnLoad="true"> >>> <target> >>> <inSequence> >>> <send> >>> <endpoint key="myEndPoint" /> >>> </send> >>> </inSequence> >>> <outSequence> >>> <send/> >>> </outSequence> >>> </target> >>> </proxy> >>> <sequence name="errorHandler"> >>> <log level="full" /> >>> </sequence> >>> </definitions> >>> >>> Snippets from axis2.xml: >>> >>> <messageBuilder contentType="*/*" >>> class="org.apache.axis2.format.BinaryBuilder"/> >>> ... >>> <messageFormatter contentType="*/*" >>> class="org.apache.axis2.format.BinaryFormatter"/> >>> >>> What should I modify to enable plain text, JSON and binary data to pass >>> through without change? >>> >>> Thanks, >>> >>> --GKC >>> >>> -----Original Message----- >>> From: Andreas Veithen [mailto:[email protected]] >>> Sent: Tuesday, July 14, 2009 12:45 AM >>> To: [email protected] >>> Subject: Re: Passing non-XML body content for REST services >>> >>> That should be possible. Can you post your synapse.xml file? >>> >>> Andreas >>> >>> On Mon, Jul 13, 2009 at 13:23, Coulombe, Greg<[email protected]> >>> wrote: >>> > Hello, >>> > >>> > I am developing some REST services (using the a 1.3 snapshot build of >>> > synapse) and I'd like to use Synapse to proxy REST service calls that >>> > return (or accept) non-XML content. How do I configure Synapse to >>> proxy >>> > that content without wrapping it in an XML element? The content types >>> > that I am interested in proxying are JSON and Binary. I have been >>> > playing with the Axis2 BinaryFormatter and BinaryBuilder and it seems >>> > close to what I am looking for but not exactly correct: when I call >>> GET >>> > against a service that returns a content type of >>> > application/octet-stream, I get back the binary content but it is MIME >>> > encoded (I think) in a <binary/> element. Is there a way to configure >>> > synapse/axis2 to simply pass that binary data through untouched? >>> > Similarly, I would like to do this with plain text and/or JSON data >>> too. >>> > >>> > Thanks, >>> > >>> > Greg Coulombe >>> > >>> > >>> > >>> >> >> >> >> -- >> Software Engineer, WSO2 Inc >> http://wso2.org >> supunk.blogspot.com >> > > > > -- > Paul Fremantle > Co-Founder and CTO, WSO2 > Apache Synapse PMC Chair > OASIS WS-RX TC Co-chair > > blog: http://pzf.fremantle.org > [email protected] > > "Oxygenating the Web Service Platform", www.wso2.com > -- Saliya Ekanayake http://www.esaliya.blogspot.com http://www.esaliya.wordpress.com
