geopython / pywps

PyWPS is an implementation of the Web Processing Service standard from the Open Geospatial Consortium. PyWPS is written in Python.
https://pywps.org
MIT License
177 stars 117 forks source link

base64.decode error #29

Closed doutriaux1 closed 8 years ago

doutriaux1 commented 9 years ago

Hello,

I have a process I define the ComplexInputType as follow

    self.dataIn = self.addComplexInput(identifier = "variable",title="variable to average",formats = [{"mimeType":"application/json"}], minOccurs=1, maxOccurs=10)
    self.domain = self.addComplexInput(identifier = "domain",title="domain over which to average",formats = [{"mimeType":"application/json","encoding":"utf-8","schema":None},])

I would lime to send json

right now my execute does nothing

  def execute(self):
    self.status.set("Starting %i, %i" % (0,0),0)
    return

The url I'm sending is:

http://localhost:8000/wps/?version=1.0.0&service=wps&request=Execute&identifier=ensemble_averager&datainputs=[domain={'longitude': {'start': -180.0, 'end': 180.0}, 'time': {'start': '1980', 'end': '1982'}};variable={'url':'file://lgm/uvcdat/2015-01-26/sample_data/clt.nc','id':'clt'}]

The process errors with the following:

PyWPS [2015-02-04 00:50:00,386] WARNING: Could not import processes from 'processes': ImportError('No module named icclim',)
PyWPS [2015-02-04 00:50:00,388] INFO: Following processes are imported: ['ensemble_averager', 'test_process']
PyWPS [2015-02-04 00:50:00,396] INFO: Status [processpaused]: Getting input variable of process ensemble_averager
Traceback (most recent call last):
  File "/lgm/uvcdat/2015-01-26/lib/python2.7/site-packages/pywps-3.2.2-py2.7.egg/pywps/Wps/Execute/__init__.py", line 382, in
 __init__
    self.consolidateInputs()
  File "/lgm/uvcdat/2015-01-26/lib/python2.7/site-packages/pywps-3.2.2-py2.7.egg/pywps/Wps/Execute/__init__.py", line 530, in
 consolidateInputs
    resp = input.setValue(inp)
  File "/lgm/uvcdat/2015-01-26/lib/python2.7/site-packages/pywps-3.2.2-py2.7.egg/pywps/Process/InAndOutputs.py", line 393, in
 setValue
    self.storeData(input["value"])
  File "/lgm/uvcdat/2015-01-26/lib/python2.7/site-packages/pywps-3.2.2-py2.7.egg/pywps/Process/InAndOutputs.py", line 470, in
 storeData
    os.remove(fout.name+".base64")
OSError: [Errno 2] No such file or directory: './pywpsInputWPjsM5.base64'
PyWPS [2015-02-04 00:50:00,401] INFO: Status [processfailed]: [Errno 2] No such file or directory: './pywpsInputWPjsM5.base64
'

I did a tracking on this, it dies on the finally, but it really died in the try bit on this line:

                   base64.decode(f1, f2)

The exception says:

Incorrect padding

I'm not sure how to fix this, I'm hoping it's something in my url

Thanks

doutriaux1 commented 9 years ago

actually setting mime type to text/json makes it work

but the official mime type for json is application/json

jachym commented 9 years ago

hmmm, thanks for hint

Wed Feb 04 2015 at 2:49:21 odesílatel Charles Doutriaux < notifications@github.com> napsal:

actually setting mime type to text/json makes it work

but the official mime type for json is application/json

Reply to this email directly or view it on GitHub https://github.com/geopython/PyWPS/issues/29#issuecomment-72775435.

tomkralidis commented 8 years ago

Can we close this issue?