XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Bruce CantorSubject: Exposing xquery as webservice issue
Author: Bruce Cantor
Date: 30 Mar 2022 11:31 AM
Hi

I am trying to create a webservice as described in chapter 9 of DataDirect XQuery® User’s Guide and Reference (ddxug.pdf)

I would like to create simple webservice that makes it possible to download a stockfile if you know the name of the file.

So, finding that the XQueryWebService Framework makes it possible to expose a xquery script as a rest service I have tried to create the above web project.

But I am having trouble getting it to work.

The webserver just returns 'This page cannot be displayed'

I am thinking that it might be related to this statement in the documentation:

"Let's take a look at emp.xquery, which we have saved to our
local XQuery directory (c:\MyQueryDir, as defined in web.xml)."

I cannot find any reference in the documentation how to define the path in the web.xml file. Currently the xquery file is just located in {tomcat_home}/webapps/project

IS the missing definition in the web.xml file the problem?
If so, how do I define the path in the web.xml file?

Attached is a zip of my very simple project that should return the filename param to the user when called.


UnknownPriceStockFiles.zip
web prj zipped path{tomcatHome\webapps}

Postnext
Ivan PedruzziSubject: Exposing xquery as webservice issue
Author: Ivan Pedruzzi
Date: 31 Mar 2022 05:54 PM
Bruce you are running XPS, look at the documentation for how to expose a pipeline as web service, the approach is far more powerful



Ivan Pedruzzi
Stylus Studio Team

Postnext
Bruce CantorSubject: Exposing xquery as webservice issue
Author: Bruce Cantor
Date: 19 Oct 2022 11:27 AM
Hi Ivan

In the XPS I end up with the same result.

I have defined a simple pipeline that does nothing but return the posted XML back to the client.

It is placed in C:\xps\pipelines\PipelinesIn and named TestWebService.IngoingFlow.pipeline
together with the binding file TestWebService.IngoingFlow.pipeline.binding

But when I try to call the endpoint I am unsure what the URL should be, nothing I try ends up triggering the pipeline, I get an 'Can’t reach this page' error, and when I use Postman to post to the URL I can see an error like this one in the consol: 'Error: connect ECONNREFUSED 127.0.0.1:80'.

The guide says
http://localhost/rest/pipelineRun?pipelineId=prj\mypipeline.pipeline

and I have tried to guess the correct url from the path that my pipeline has, without luck.

If my pipeline is placed as stated above, how should the URL be?

Kind regards Bruce


UnknownTestwebserviceendpoint.zip
zip file with pipeline

Postnext
Ivan PedruzziSubject: Exposing xquery as webservice issue
Author: Ivan Pedruzzi
Date: 20 Oct 2022 02:03 AM
Originally Posted: 20 Oct 2022 01:26 AM
which URL did you try?

Set pipelineId to <pipeline project folder>/<pipeline file>

in your example
pipelineId=PipelinesIn/TestWebService.IngoingFlow.pipeline


Assuming that your XPS instance is running on your local machine on port 80, the following URL can be executed from your browser and works.


http://localhost/rest/pipelineRun?pipelineId=PipelinesIn/TestWebService.IngoingFlow.pipeline


I attached a screenshot of your pipeline running on my XPS which is on port 81

you can also using HTTP POST to pass a payload to the pipeline

Postnext
Bruce CantorSubject: Exposing xquery as webservice issue
Author: Bruce Cantor
Date: 20 Oct 2022 10:01 AM
Thanks Ivan

I needed to post to port 81.

http://localhost:81/rest/pipelineRun?pipelineId=PipelinesIn/TestWebService.IngoingFlow.pipeline

And change the '\' to '/' in the parameter. (Documentation says backslash, but this does not work for me)

Now, if I could use https instead of http I would be even more happy.
Is it possible to setup an endpoint on https?

Posttop
Ivan PedruzziSubject: Exposing xquery as webservice issue
Author: Ivan Pedruzzi
Date: 20 Oct 2022 04:35 PM
XML Pipeline Server bundles the most the deployed web server in the world: Apache Tomcat (xps\tomcat).

There is extensive documentation on how to configure HTTPS on Apache
Tomcat
https://tomcat.apache.org/tomcat-10.0-doc/ssl-howto.html


Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.