From ehbrecht at dkrz.de Wed Apr 7 10:53:47 2021 From: ehbrecht at dkrz.de (Carsten Ehbrecht) Date: Wed, 7 Apr 2021 19:53:47 +0200 Subject: [PyWPS-dev] Testing the services via Python In-Reply-To: <1202188666.239624.1615574174118@mail.yahoo.com> References: <1202188666.239624.1615574174118.ref@mail.yahoo.com> <1202188666.239624.1615574174118@mail.yahoo.com> Message-ID: <107508F2-E083-453B-8434-96C879528688@dkrz.de> Hi Robert, There is the Emu WPS with some example processes ? and also tests: https://github.com/bird-house/emu/blob/master/tests/test_wps_pandas.py You can also use OWSLib or birdy to execute the process more conveniently: https://nbviewer.jupyter.org/github/bird-house/birdy/blob/v0.7.0/notebooks/examples/emu-example.ipynb In your example it looks like you are using POST method for a WPS GET request. A doc (a bit dusty) I use to lookup the WPS details: http://geoprocessing.info/wpsdoc/1x0Execute Some other outdated examples: https://github.com/bird-house/notebooks/blob/master/sandbox/tutorial/t04-wps-execute.ipynb Cheers, Carsten -- Carsten Ehbrecht Abteilung Datenmanagement Deutsches Klimarechenzentrum GmbH (DKRZ) Bundesstra?e 45 a ? D-20146 Hamburg ? Germany Phone: +49 40 460094-148 FAX: +49 40 460094-270 Email: ehbrecht at dkrz.de URL: www.dkrz.de Gesch?ftsf?hrer: Prof. Dr. Thomas Ludwig Sitz der Gesellschaft: Hamburg Amtsgericht Hamburg HRB 39784 > On 12. Mar 2021, at 19:36, nagyrobi_r at yahoo.com wrote: > > Hei wonderful people. > > I am new to PyWPS, which i see as a wonderful tool and i am trying to learn. I am trying to test if the dev server works without having any kind of front-end developed. I am making a mistake here, wouldn't know what. Could anybody please guide me on how i could test the processes with python? > > import requests > > headers = {'Content-Type':'application/gml+xml'} > target_url = 'http://localhost:5000/wps?service=wps&version=1.0.0&request=execute&identifier=feature_count' > > with open('/home/robocop/pywps/pywps/pywps/data/railroads.gml', 'rb') as f: > files = {'layer': f} > r = requests.post(target_url, > headers=headers, > files=files) > > This lands me a 400 error, with exceptionCode = "NoApplicableCode" > > Thank you for your time. > > > Kind regards, > Robert Nagy > _______________________________________________ > pywps-dev mailing list > pywps-dev at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/pywps-dev -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: