On 14/12/06, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:

Pete Robbins wrote:
> 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,
>

I think this is a very good question!

I've been going back and forth on this, between:
a) let the user configure the PATH (and LD_LIBRARY_PATH on Windows) once
for all to include our dependencies
b) leverage the XYZ_HOME that people need to configure to build and
configure the PATH in the sample scripts

Here are few things to consider:
- I would expect users to do (a) anyway when they install the various
dependencies (and this is done for you by some of the Ruby and Python
installers for example).
- People who build from source will have the XYZ_HOME variables defined
so (b) will work well for them, but people who use the binary distros
will probably not have these variables, and asking them to define these
variables will complicate their setup.
- Setting the path in each script is not something I would recommend to
a user if he has many Tuscany programs. Ideally he should be able to run
things without writing a script to launch each program.
- On the other hand, configuring the path in our sample scripts shows
people how to do it, and allows them to replicate this by simple
copy/paste.

After writing this email, I'm now starting to think that we should not
tweak the path to our dependencies in our scripts and instead provide
the configuration snippets in a README, and ask people to configure
their environment once for all when they install Tuscany.

Like I said, I've been going back and forth on this, so I could also be
convinced otherwise... What do you think?

--
Jean-Sebastien


I think I've been through exactly the same thoughts! Maybe we should
document like "ensure the licurl libraries are on the PATH" and also ship a
tuscanyenv.bat, for users to edit, which contains the set of variables we
expect e.g.

#set TUSCANY_SCACPP=...
#set LIBCURL_HOME=<path to libcurl>
#set PATH=%TUSCANY_SCACPP%\bin;%PATH%

Maybe we could make our runxxx.bat scripts call this tuscanyenv..bat??

What is a pain though is trying to debug WHY the
tuscany_sca_rest_reference.dll will not load!! It took a while to find that
the libcurl.dll was in LIBURL_HOME and not LIBCURL_HOME\bin


--
Pete

Reply via email to