Guillaume Okay, I'm new to REST so I may be missing something there too but this is where I'm at. SMX will receive a JMS message with an XML payload. The XML will have two high level nodes. One node's value will be the service to call (will become part of the REST URL). The other node will be a big chunk of XML to be POSTed to the service. The content-type is x-www-form-urlencoded.
I extended DefaultHttpProviderMarshaler and I call httpExchange.setRequestContent(bigXmlChunkContentOfTheSecondNode). This almost works. I use JaxenStringXPathExpression to get the value of the first node and set the REST URL. Then my class has a new property, contentExpression, also a JaxenStringXPathExpression. I use this to define the XPath to the second node, the one with the big chunk of XML, but it adds the values of the second node. What I need is the chunk of XML, elements, attributes and all. I guess I could introduce a Saxon endpoint to do a transformation and a router to send the message to different HTTP endpoints based on the first node but that seems a lot less elegant than just dynamically determining the REST URL in the marshaler. It works fine for GETs but then POST, I'm learning, is a different story. Any thoughts? Thanks Tom gnodet wrote: > > I really think the best way would be to create your own marshaler if the > default one does not work for you. If you come up with something generic > enough feel free to contribute it back. However, the > DefaultHttpProviderMarshaler should send a POST request if the input > message > is not null, but this is more like a soap POST rather than a form post > with > key/value pairs. Is that what you'd need ? How do you extract the > key/value pairs from the exchange ? > > On Tue, Apr 1, 2008 at 3:26 PM, Tom Purcell > <[EMAIL PROTECTED]> > wrote: > >> >> Hello >> >> I'm trying to use the servicemix-http http:provider to call a RESTful >> service. GET works fine but I'm having trouble trying to configure it to >> do >> a post. It appears to me that DefaultHttpProviderMarshaler does not >> directly >> support this and so I must write my own Marshaler to set the content. My >> first question is just a request to verify that is correct and that I'm >> not >> missing something. >> >> My next question is about >> http://issues.apache.org/activemq/browse/SM-580 >> SM-580 <http://issues.apache.org/activemq/browse/SM-580SM-580> . This >> appears to address this situation although I'm not certain it >> does so in a RESTful way (I'm new to REST). SM-580 appears to be >> scheduled >> for 3.3 so is this what I would use once 3.3 is released and when is 3.3 >> scheduled for release? >> >> Thanks >> Tom >> -- >> View this message in context: >> http://www.nabble.com/servicemix-http-Post-support-tp16418421s12049p16418421.html >> Sent from the ServiceMix - User mailing list archive at Nabble.com. >> >> > > > -- > Cheers, > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > > -- View this message in context: http://www.nabble.com/servicemix-http-Post-support-tp16418421p16427193.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
