On 12/12/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Jean-Sebastien Delfino wrote: > Jean-Sebastien Delfino wrote: >> Pete Robbins wrote: >>> On 07/12/06, Andrew Borley <[EMAIL PROTECTED]> wrote: >>>> >>>> On 12/7/06, Andrew Borley <[EMAIL PROTECTED]> wrote: >>>> > On 11/20/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote: >>>> > > I checked in the initial structure of a REST extension under >>>> > > cpp/sca/runtime/extensions/rest, revision r477110. >>>> > > >>>> > > The idea is to add support for <interface.rest> and >>>> <binding.rest> on >>>> > > services and references and implement a RESTFul pattern (using the >>>> HTTP >>>> > > Post/Get/Put/Delete verbs to implement >>>> Create/Retrieve/Update/Delete >>>> > > operations on resources) as well as a simple service invocation >>>> > > mechanism using HTTP Get and Post. >>>> > > >>>> > > I have updated the Linux build files, added a configure >>>> > > --enable-restbinding option and the necessary Makefile.am files. >>>> > > >>>> > > The reference binding requires Libcurl (I tried 7.15.5) and >>>> CURL_LIB >>>> and >>>> > > CURL_INCLUDE environment variables pointing to its lib and include >>>> > > directories. >>>> > > The service binding requires Apache httpd (2.2.x) and HTTPD_LIB >>>> and >>>> > > HTTPD_INCLUDE environment variables. >>>> > > >>>> > > The SCDL model classes should be roughly Ok but the >>>> ServiceProxy and >>>> > > ServiceWrapper classes are under construction and only useful to >>>> verify >>>> > > that the extension can be built. >>>> > > >>>> > >>>> > I just committed the build files & a few minor changes to get the >>>> > extension building on Windows - you will need to set the environment >>>> > variables LIBCURL_HOME and HTTPD_HOME to point to the appropriate >>>> > places (guess!) >>>> > >>>> > Haven't yet got the sample going - that's the next job. >>>> > >>>> > Cheers >>>> > Andy >>>> > >>>> >>>> I spent most of today trying to get the RestCalculator sample up and >>>> running on Windows. I hit a few issues: >>>> >>>> Libcurl - this was the major one. The extension built fine but died on >>>> the restclient side of the sample when it tried to initialise libcurl >>>> (via the curl_global_init() call). I tried all the different kinds of >>>> libcurl for Windows that are available at [1] but I got the same >>>> result with all of them. Eventually I built my own from source, and >>>> that died too until I built it via VS Express rather than the >>>> command-line build! At this point it all started working and I began >>>> to see messages appearing on the server. >>>> >>>> To have to download the src and build it would be a huge hassle for >>>> users that we *really* want to avoid. It may just be that I was doing >>>> something wrong with my libcurl stuff but I couldn't see what - I was >>>> just getting the windows "it's died" message that you normally get >>>> when libraries don't like each other. If anyone else could try it out >>>> and see what happens for them with the windows libcurl binary distros >>>> it would be appreciated! >>> >>> >>> >>> I wonder if our building with vc8 is causing the incomaptibility. We >>> have >>> had issue before with dll's being built against different versions >>> of the >>> msvc runtime dlls. >>> >>> >>> >>> REST service - after all the shenanigans with libcurl, I hit an issue >>>> with tuscany_sca_mod_rest.dll that I didn't have time to get past. In >>>> ModREST.cpp the request->path_info is coming out as >>>> /htdocs/rest/sample.calculator.CalculatorComponent/CalculatorService/div, >>>> >>>> but it looks like the code expects it to be something like >>>> /sample.calculator.CalculatorComponent/CalculatorService/div - this >>>> meant that the runtime was looking for a component named htdocs and a >>>> service named rest! I assume you get the path without the /htdocs/rest >>>> part on Linux, although it's a bit odd that the data is different on >>>> Windows.. I'm on Apache HTTPD 2.2.3 - is that the same version you're >>>> using? >>>> >>>> Anyway, I'm doing a presentation on Tuscany at the Javapolis >>>> conference in Belgium next week, so I'll be preparing for/going to >>>> that over the next few days, and won't have much time to progress this >>>> or the HttpdBigBank sample. I've put the windows deploy/run scripts >>>> for RestCalculator on svn, so if anyone does fancy trying it out I'll >>>> be interested in your results! >>>> >>>> Cheers >>>> >>>> Andy >>>> >>>> [1] http://curl.haxx.se/download.html >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>>> For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >> >> I finished setting up a complete Windows environment with Curl and >> Httpd yesterday evening. I noticed that there are many Curl >> distributions available, so I picked an "MSVC development >> distribution" and will give it a try today. >> > > Andy, > > The RestCalculator sample now works on Windows, with the following > configuration: > - an MSVC based Libcurl distribution (at > http://curl.haxx.se/download.html, the one before the last one at the > bottom of the page, more precisely > libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3.zip from Chris Drake). > - an update to the VSExpress project to link with the import lib from > that Libcurl distro > - an update to the HTTPD conf to specify a DocumentRoot (and load the > Mime and Dir HTTPD modules into the server), I added the gen of this > conf to the startserver.bat script. > > So if you download the Libcurl distribution above and update from the > SVN head, it should work now. > > I started to update the scripts and conf in the RestCustomer sample as > well but it doesn't work yet, I'll continue to work on it later this > evening. > After fixing the deploy.bat script in the REST Customer sample (it was missing a copy of the required Customer.xsd to the deploy directory), this sample now works as well.
I hit a couple of issues running the REST samples. I think the startserver.bat and runrestclient.bat need to add libcurl to the PATH. The client script adds %LIBCURL_HOME%\bin to the path but this needs to be %LIBCURL_HOME% for the version of libcurl you mention above. startserver does not add libcurl to the path. Should we change these scripts to check for LIBCURL_HOME being set and then ad both %LIBCURL_HOME%\bin and %LIBCURL_HOME% to the PATH? Cheers, -- Pete
