<div dir="ltr"><span style="font-size:12.8px">Hi list,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><div><span style="font-size:12.8px">I'm having a problem with a service when I call another service inside the process.</span></div><div> </div><div>   def _handler(self, request, response):</div><div><br></div><div>         df = self.get_real_sky(geodf,start,end,model)<br></div><div><br></div><div><div>    def get_real_sky(self,geodf,start,end,model):</div><div>        #print 'eccolo dentro'</div><div>        import requests</div><div>        url = "<a href="http://130.192.5.114:8080/wps">http://130.192.5.114:8080/wps</a>"</div><div><br></div><div>        payload = "<wps:Execute service=\"WPS\" version=\"1.0.0\" xmlns:wps=\"<a href="http://www.opengis.net/wps/1.0.0\">http://www.opengis.net/wps/1.0.0\</a>" xmlns:ows=\"<a href="http://www.opengis.net/ows/1.1\">http://www.opengis.net/ows/1.1\</a>" xmlns:xlink=\"<a href="http://www.w3.org/1999/xlink\">http://www.w3.org/1999/xlink\</a>" xmlns:xsi=\"<a href="http://www.w3.org/2001/XMLSchema-instance\">http://www.w3.org/2001/XMLSchema-instance\</a>" xsi:schemaLocation=\"<a href="http://www.opengis.net/wps/1.0.0\n../wpsExecute_request.xsd\">http://www.opengis.net/wps/1.0.0\n../wpsExecute_request.xsd\</a>">\n <ows:Identifier>real_sky</ows:Identifier>\n  <wps:DataInputs>\n    <wps:Input>\n      <ows:Identifier>layer_in</ows:Identifier>\n    <wps:Data>\n    <wps:ComplexData>"+geodf.to_json()+"</wps:ComplexData>\n    </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>start</ows:Identifier>\n        <wps:Data>\n            <wps:LiteralData dataType=\"xs:string\">"+start+"</wps:LiteralData>\n        </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>end</ows:Identifier>\n        <wps:Data>\n            <wps:LiteralData dataType=\"xs:string\">"+end+"</wps:LiteralData>\n        </wps:Data>\n    </wps:Input>\n    <wps:Input>\n      <ows:Identifier>model</ows:Identifier>\n        <wps:Data>\n            <wps:LiteralData dataType=\"xs:string\">"+model+"</wps:LiteralData>\n        </wps:Data>\n    </wps:Input>\n  </wps:DataInputs>\n  <wps:ResponseForm>\n    <wps:RawDataOutput>\n      <ows:Identifier>layer_out</ows:Identifier>\n    </wps:RawDataOutput>\n  </wps:ResponseForm>\n</wps:Execute>"<br></div><div>        headers = {</div><div>            'content-type': "application/xml",</div><div>            'cache-control': "no-cache",</div><div>            'postman-token': "78829681-df08-3317-2e0e-90a31ea4f2a6"</div><div>            }</div><div><br></div><div>        response = requests.request("POST", url, data=payload, headers=headers)</div><div><br></div><div>        return response.text</div></div><div><br></div><div><br></div><div>The process inside def get_real_sky works if I call it by it self, but if I call inside another process dosent work, it simply blocks and do not go forward. I have tried to run only the service real_sky in another port not in 8080 like the one who calls it but in 8082. In this way it works. I dont understand if the problem is Flask or the problem is PyWPS.<br><br>If I press crtl+c to stop the process I get this:</div><div><br></div><div><div>Exception happened during processing of request from ('130.192.5.114', 49246)</div><div>Traceback (most recent call last):</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock</div><div>    self.process_request(request, client_address)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request</div><div>    self.finish_request(request, client_address)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request</div><div>    self.RequestHandlerClass(request, client_address, self)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__</div><div>    self.handle()</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/serving.py", line 216, in handle</div><div>    rv = BaseHTTPRequestHandler.handle(self)</div><div>  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle</div><div>    self.handle_one_request()</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/serving.py", line 251, in handle_one_request</div><div>    return self.run_wsgi()</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/serving.py", line 193, in run_wsgi</div><div>    execute(self.server.app)</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/serving.py", line 181, in execute</div><div>    application_iter = app(environ, start_response)</div><div>  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__</div><div>    return self.wsgi_app(environ, start_response)</div><div>  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app</div><div>    response = self.full_dispatch_request()</div><div>  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1478, in full_dispatch_request</div><div>    response = self.make_response(rv)</div><div>  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1577, in make_response</div><div>    rv = self.response_class.force_type(rv, request.environ)</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 847, in force_type</div><div>    response = BaseResponse(*_run_wsgi_app(response, environ))</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 57, in _run_wsgi_app</div><div>    return _run_wsgi_app(*args)</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/test.py", line 871, in run_wsgi_app</div><div>    app_rv = app(environ, start_response)</div><div>  File "/usr/local/lib/python2.7/dist-packages/Werkzeug-0.11.4-py2.7.egg/werkzeug/wrappers.py", line 291, in application</div><div>    return f(*args[:-2] + (request,))(*args[-2:])</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py", line 529, in __call__</div><div>    request_uuid</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py", line 296, in execute</div><div>    response = self._parse_and_execute(process, wps_request, uuid)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py", line 358, in _parse_and_execute</div><div>    wps_response = process.execute(wps_request, uuid)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py", line 145, in execute</div><div>    wps_response = self._run_process(wps_request, wps_response)</div><div>  File "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py", line 151, in _run_process</div><div>    wps_response = self.handler(wps_request, wps_response)</div><div>  File "/home/lorenzo/tools/pywps-4/pywps-4-demo/processes/solar/PV_NOCT.py", line 45, in _handler</div><div>    df = self.get_real_sky(geodf,start,end,model)</div><div>  File "/home/lorenzo/tools/pywps-4/pywps-4-demo/processes/solar/PV_NOCT.py", line 101, in get_real_sky</div><div>    response = requests.request("POST", url, data=payload, headers=headers)</div><div>  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request</div><div>    return session.request(method=method, url=url, **kwargs)</div><div>  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request</div><div>    resp = self.send(prep, **send_kwargs)</div><div>  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send</div><div>    r = adapter.send(request, **kwargs)</div><div>  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 330, in send</div><div>    timeout=timeout</div><div>  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 562, in urlopen</div><div>    body=body, headers=headers)</div><div>  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 414, in _make_request</div><div>    httplib_response = conn.getresponse(buffering=True)</div><div>  File "/usr/lib/python2.7/httplib.py", line 1051, in getresponse</div><div>    response.begin()</div><div>  File "/usr/lib/python2.7/httplib.py", line 415, in begin</div><div>    version, status, reason = self._read_status()</div><div>  File "/usr/lib/python2.7/httplib.py", line 371, in _read_status</div><div>    line = self.fp.readline(_MAXLINE + 1)</div><div>  File "/usr/lib/python2.7/socket.py", line 476, in readline</div><div>    data = self._sock.recv(self._rbufsize)</div><div>KeyboardInterrupt</div><div>----------------------------------------</div><div><div>130.192.5.114 - - [10/Jun/2016 16:25:45] "POST /wps HTTP/1.1" 200 -</div><div>INFO:werkzeug:130.192.5.114 - - [10/Jun/2016 16:25:45] "POST /wps HTTP/1.1" 200 -</div><div>----------------------------------------</div><div>Exception happened during processing of request from ('130.192.5.114', 49248)</div><div>Traceback (most recent call last):</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock</div><div>    self.process_request(request, client_address)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request</div><div>    self.finish_request(request, client_address)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request</div><div>    self.RequestHandlerClass(request, client_address, self)</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__</div><div>    self.finish()</div><div>  File "/usr/lib/python2.7/SocketServer.py", line 710, in finish</div><div>    self.wfile.close()</div><div>  File "/usr/lib/python2.7/socket.py", line 279, in close</div><div>    self.flush()</div><div>  File "/usr/lib/python2.7/socket.py", line 303, in flush</div><div>    self._sock.sendall(view[write_offset:write_offset+buffer_size])</div><div>error: [Errno 32] Broken pipe</div><div>----------------------------------------</div></div><div><br></div><br>Any suggestion?<br><br>Best,<br><br>Lorenzo</div><div><br></div><div><br></div><div><br></div><div><br></div></div>