Michael,

Thank you immensely for your help.  I didn't even think to update web.xml and so had no chance of this working.  I know have a service in a distinct directory and static pages in a different directory, and I can at least control where they go. 
Having said that, I found some things on startup that I didn't anticipate:

* From testing, it appears that the basexhttp server also starts the database server.  From the options available in .basex, I was under the impression I had to start basexserver separately, but when I tried to run basexserver and subsequently basexhttp, the basexhttp server said the port was already in use. 
* It's probably obvious to people who write RESTXQ code readily, but it seems worthwhile to note that the services run on the basexhttp server JVM, and not the basexserver JVM.  Because I anticipate needing multiple databases, I'm trying to set up the server so that it can fork work over to the appropriate database.  It would be nice if I could have XQUERY code running at the basexserver JVM.

* In my .basex file, I specify
HOST=localhost
PORT=1984
SERVERPORT=1984
SERVERHOST=localhost

Since it's the basexhttp that starts the basexserver, it's not clear to me which is considered the server, but nonetheless, somehow I'm able to get the above to at least partially function, though I'm confident that I did this wrong. 

* I noticed there's a REST and a RESTXQ, for most part would I always want to use RESTXQ?

I hope those who write the documentation do not take offense to my questions. I'm not sure I would have thought to document it or how to write it in such a way that it doesn't get asked.  This project is one of the best documented in the OSS community, and even better than some products for which money changes hands.

Thanks,
Ben




Best Regards,
Ben Pracht
ben.pracht@gmail.com


On Mon, Jul 13, 2020 at 3:35 AM Michael Seiferle <ms@basex.org> wrote:
Hi Ben,

Make sure to first read my previous mail, because you need a working restxq-Setup ;-)

Theres the „rest:wadl()“ function, that generates a representation of all available endpoints.

I added it to my example project, feel free to check it out here:
https://git.basex.io/basex-public/mailinglist-autocomplete/-/commit/84fda246ca3d1dfe7319ff4a401aa1504feee48a

The result will look something like this: 
[…]
        <wadl:resource path="/search/{$what}">
            <wadl:param name="what" style="template"/>
            <wadl:method name="GET">
                <wadl:request/>
                <wadl:response>
                    <wadl:representation mediaType="application/json"/>
                </wadl:response>
            </wadl:method>
        </wadl:resource>
[…]


Hope this helps :-)

Michael 


Am 13.07.2020 um 00:31 schrieb Ben Pracht <ben.pracht@gmail.com>:



In my case, I put the hello-world service in the main project directory, in the modules directory where the RESTXQPATH and in the RESTPATH.  I've tried renaming the hello-world to .xq, .xqm and .xqy.  In all cases, it does not find the .xq file.  

Best Regards,
Ben Pracht
919.809.2439