iris-edu / webserviceshell Goto Github PK
View Code? Open in Web Editor NEWA Java web service which provides HTTP Get and Post services for backend applications.
A Java web service which provides HTTP Get and Post services for backend applications.
I am trying to set up an event service using webserviceshell v. 2.4.9. I have followed the instructions in https://github.com/iris-edu/webserviceshell/blob/master/docs/Installation.md.
FYI, instead of using the directory /WSSHOME/, I have used /tomcat/. So the path is /tomcat/tomcat. I am also using port 8880. I have replaced the dataselect with event in the file names.
First I brought up http://silverdragon.isti.com:8880/fdsnws/event/1/query?eventid=70051933 and I was getting the following error: Error 400: doIrisProcessing - No type defined or unknown query parameter: eventid
http://silverdragon.isti.com:8880/fdsnws/event/1/query?eventid=70051933
I then set the relaxedValidation parameter in the service config file:
query.relaxedValidation=true
This took care of the Error 400, but now I am getting the file coming back from the fdsn event labeled as a miniseed file downloaded to my PC. When looking at the file as text, the file is in the correct format as a QuakeML file.
It looks like the formatTypes parameter is set correctly in the service config file:
application.wadl.formatTypes =
xml: application/xml
For some reason that is being ignored and all are coming back as mseed. I am not sure if there is some default. Even when I give it the additional argument format=xml, it still comes back as .mseed
Something is not correct in the formatTypes setting since it is being ignored.
I have attached the mseed file:
mseed.zip
I have attached the service config file:
service.cfg.zip
These two dependencies are not resolvable. Makes it hard to build externally, which makes it harder to submit patches or to compile code that depends on webserviceshell.
<dependency>
<groupId>edu.iris.dmc</groupId>
<artifactId>dmc-usage-log</artifactId>
<version>${dmc.usage.log.version}</version>
</dependency>
<dependency>
<groupId>edu.iris</groupId>
<artifactId>dmc_logging</artifactId>
<version>${dmc_logging.version}</version>
</dependency>
Per Rob Casey:
Hi Philip-
I've never attempted to build this one myself, but for our internal code, we have an IRIS (Sonatype) >Nexus server that may be picking up on those dependencies you are running into. It wasn't meant to be >built outside of the DMC.
dmc-usage-log and dmc_logging are internal dependencies. I am not sure why they are listed in the >POM, but since this code is distributed for external builds, are they simply ignored unless called for by the >application?
If you can find a way to strip out those dependencies from the code I shared with you, it should be fine.
There are some things that we specifically will not share with the public. The WSS is meant for public use,
though, so I find it interesting that you are running into this problem.-Rob
It seems to me that webserviceshell only supports Java 8. Are there any plans to support more recent versions of Java?
I am confused if the formatTypes are restricted to those in the list defined in the documentation, namely the ones included below. Is it possible to add a type of CSV?
When i put format=csv and have a handler that returns CSV data for our web service, the browser barfs with the error shown below:
This page contains the following errors:
error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.
even if I map CSV to text/plain the browser doesn't recognize the return from the WSS. Do I need to spoof the return of csv files somehow so they are sent to files instead? If so, how do I manage that with the WSS and my handler?
Note that my web service if used with wget or curl returns the CSV files just fine and if in the browser I say "View Source" on the given page, I see the CSV. There is something in the return headers that just isn't working for the browser to see it or send it to a file. What am I missing.
I currently have the following settings in my service.cfg file:
query.formatTypes =
xml: application/xml,
csv: text/plain,
text: text/plain,
json: application/json
#query.formatDispositions= \
query.formatDispositions=
text: attachment; filename="${appName}${UTC}.csv",
csv: attachment; filename="${appName}${UTC}.csv",
zip: attachment; filename="data.zip"
List of "allowed?" format types extracted from HandlerRequirements.md write up:
formatType Media type
xml application/xml
mseed application/vnd.fdsn.mseed
text text/plain
texttree text/plain
json application/json
binary application/octet-stream
Hello,
I moved our webserviceshell instance (serving http://ws.resif.fr/fdnsws/dataselect/1and https://ws.resif.fr/fdsnws/station/1/) from a monotlythic deployment into a kubernetes cluster.
From there on, the IPADDRESS environment variabled passed to the CmdProcessor shows the haproxy address.
From the codebase, I see:
and then :
webserviceshell/src/main/java/edu/iris/wss/utils/WebUtils.java
Lines 78 to 82 in ccebd67
I'm not familiar with Java, but would it be possible to take also into account the HTTP headers x-original-forwarded-for
in order to set up the real client IP in IPADDRESS ?
Is there any plan to upgrade WSS to use a safe version of log4j?
Preliminary investigation shows that Java's Properties load method handles a space after a backslash as a new line rather than a continuation. As might be expected, this leads to a property object that has unexpected, strangely named properties as well as list items missing from the original desired list. Also, the resulting property object may be mostly intact, depending where the extra space occurs, leading to difficult to diagnose errors.
The probably solution is probably to preprocess the service.cfg file and remove any characters after the \ and before the end of line.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.