Hi Bert, I agree there's going to be some challenges to solve to integrate REST well with Tuscany, I'll stay out of that for now and focus on how to get you started with bindings. Implementing a simple binding would be a good place to start so if you want to port over the old jsonrpc binding that would be great.
The code for that is at, http://svn.apache.org/repos/asf/incubator/tuscany/branches/java-post-M1/sca/bindings/binding.jsonrpc/, and there's a sample, http://svn.apache.org/repos/asf/incubator/tuscany/branches/java-post-M1/samples/sca/helloworldjsonrpc/. You could download the Tuscany M1 distribution if you want to see the sample running. I'd start by taking the sample and getting it to fit in with the new code base - convert the SCDL to the new format, and get the war packaging correct. You could use the Axis2 WS sample as a model for that which is at, http://svn.apache.org/repos/asf/incubator/tuscany/java/samples/sca/helloworldws/. (The WAR packaging is going to change once I finish the TuscanyServletListener and ServletHost work, I'll let you know when that goes in) Once you get the WAR right when you deploy it to tomcat you should see an exception about an unrecognized element: binding.jsonrpc, thats because Tuscany doesn't have a binding for it so now you need to convert the binding over to the new Tuscany runtime. There's several bindings to use as models, the RMI or echo ones are simple, the Axis2 uses the ServletHost which you'll also need to do: http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/bindings/binding.rmi/ http://svn.apache.org/repos/asf/incubator/tuscany/java/samples/sca/echo.binding/ http://svn.apache.org/repos/asf/incubator/tuscany/java/sca/bindings/binding.axis2/ Copy the existing echo or RMI binding, rename all 'rmi' to jsonrpc', then try to hook up the JSONRPCEntryPointServlet based on what the Axis2 binding is doing. You wont need the RMIReference or RMIInvoker classes as jsonrpc only supports services. There's also a binding using DWR instead of json-rpc-java which you port to the new runtime and its a bit more interesting as it also supports references (well, externalServices) so you could look at that as well if you're interested: http://svn.apache.org/repos/asf/incubator/tuscany/sandbox/ant/ajax/. If you search back in the dev list archives there's a few mails where we talk about what these two binding do. Hope this helps, ...ant On 8/17/06, Bert Lamb <[EMAIL PROTECTED]> wrote:
On 8/16/06, Jeremy Boynes <[EMAIL PROTECTED]> wrote: > > In terms of the basic transport, in M1 we had a JSON-RPC binding that > supported JSON encoded data over HTTP. We have not got around yet to > porting that to the new structure in the trunk. Looking at that would > be a good way to dig into how Tuscany works. > I can make an attempt to try and port the jsonrpc binding from M1 over to trunk style extensions if this would be appreciated. I agree that should help me get an understanding of how some of Tuscany works. > Oisin may have been referring to how REST would impact the > programming model rather than the implementation of bindings. For > example, how would cache information in the request be handled by the > binding and/or exposed to the application code? What is the mapping > between REST resources and SCA services? > Yes, the more I read, the more I wonder if trying to support REST style web applications in SCA is going to become a square peg in a round hole problem. I've only begun really looking at this though, and welcome any thoughts on the subject of how one might attempt to interface REST resources in SCA. -Bert --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]