[Zoo-discuss] BufferPy problem

Farkas H farkas.dus at gmail.com
Sun Jan 13 11:43:03 PST 2013


Hi Gérald,

thanks for your answer.
The response of the browser command
"http://localhost/cgi-bin/zoo_loader.cgi" is as suspected [1].

Firebug reports that parsing the xml causes an error [2] when
processing the JavaScript via http-Post request.

Do you have any idea?
Hope to hear from you.

Regards,
Farkas

[1]...
<ows:Exception exceptionCode="MissingParameterValue">
<ows:ExceptionText>Parameter <request> was not specified</ows:ExceptionText>
...

[2]
xml:
XML Parsing Error: no element found Address: moz-zero principal:
moz-nullprincipal:{54e932d0-2278-4cfa-9f15-8bea05872c6a} Line Number
1, Column 1:


On 13 January 2013 19:00, Gérald Fenoy <gerald.fenoy at geolabs.fr> wrote:
> Hi Farkas,
> sorry for this so silly mistake …
>
> I cannot understand that you cannot request the server from a client until we are well speaking about the same machine when speaking of client and server in our case as we are using the "localhost" name to access the "remote" server.
>
> Can you please confirm that if you load the link http://localhost/cgi-bin/zoo_loader.cgi from your browser you get an   ExceptionReport document displayed letting you know that no request parameter was set ?
>
> I would like to make sure you get at least this working correctly to make sure you can run the ZOO-Kernel from the Apache server.
>
> Hope to hear from you.
> Best regards,
>
>
> Gérald Fenoy
> gerald.fenoy at geolabs.fr
>
>
> Le 13 janv. 2013 à 09:37, Farkas H <farkas.dus at gmail.com> a écrit :
>
>> Hi Gérald,
>>
>> thanks for your answer.
>>
>> BoundaryPy, BufferPy, CentroidPy, ConvexHullPy, DifferencePy,
>> IntersectionPy, SymDifferncePy are ok with changeset 388,
>> UnionPy still doesn't work.
>> This is no problem for me, I just want to let you know.
>> Please find the error message here [1].
>>
>> I have still problems to request the server from a client. The return
>> message of the status is 'error'.
>> I've used http-Post as suggested.
>> Please find my script here [2].
>> Http-Get requests doesn't work either.
>>
>> I appreciate any advice and hope to hear from you.
>>
>> Regards,
>> Farkas
>>
>> [1]
>> Unable to run your python process properly. Please check the following messages
>> : ['  File "C:\\OSGeo4W\\bin\\ogr_sp.py", line 203, in UnionPy\n    tmp=geometry
>> 1[j].Clone()\n']</ows:ExceptionText>
>>
>> TRACE : list index out of range
>> <type 'exceptions.IndexError'>
>> Unable to run your python process properly. Please check the following
>> messages : ['  File "C:\\OSGeo4W\\bin\\ogr_sp.py", line 203, in
>> UnionPy\n    tmp=geometry1[j].Clone()\n']
>>
>> [2]
>> ...
>>            $.ajax({
>>                type: 'POST',
>>                url: 'http://localhost/cgi-bin/zoo_loader.cgi',
>>                contentType: 'text/xml',
>>                data: '<wps:Execute service="WPS" version ...
>> /wps:Execute>',
>>                complete: function(xml, status) {
>>                  alert("status: " + status);
>>                  alert("xml: " + xml.responseXML);
>>                  $("#divResult").html(xml.responseXML);
>>                }
>>            });
>> ...
>>
>> return messages:
>> status: error
>> xml: undefined
>>
>>
>> On 11 January 2013 15:52, Gérald Fenoy <gerald.fenoy at geolabs.fr> wrote:
>>> Hi Farkas,
>>> thanks for providing such feedbacks.
>>>
>>> If there is no issue in setting variable globally on your side then we can left this. But I would like to figure out what is the issue.
>>>
>>> Please, can I ask you to use the rev. 388 [1] of ogr_sp.py, it contains fixes for your points 1, 2 and 3 ?
>>>
>>> For the issue in requesting the server (your point 4), you should avoid using "type: 'GET'," and "contentType: 'text/xml'," for the same request. Simply remove the contentType attribute of your GET requests and then your alternative test should works.
>>> Note that for the example I provided in my previous mail, I used <DATA> value without describing it. It should be the XML request to send. You may also notice that it was an example using POST method.
>>>
>>> Hope this helps,
>>> Best regards,
>>>
>>> [1] http://zoo-project.org/trac/changeset/388
>>>
>>>
>>> Gérald Fenoy
>>> gerald.fenoy at geolabs.fr
>>>
>>> Le 11 janv. 2013 à 14:27, Farkas H <farkas.dus at gmail.com> a écrit :
>>>
>>>> Hi Gérald,
>>>>
>>>> happy new year.
>>>> Thank you for your response.
>>>>
>>>> Yes, I'm using the same settings for the GDAL_DATA variable.
>>>> It's no problem to me to set the variable in the main.cfg file and in Windows.
>>>>
>>>> I've changed the ogr_sp.py file as described. Now I get another error
>>>> message [1].
>>>> The CentroidPy and the ConvexHullPy requests doesn't work either.
>>>> Please find the error messages here [2] and here [3].
>>>>
>>>> I've tried to send a GetCapabilities request via http-Get using
>>>> JavaScript and Ajax as suggested [4].
>>>> The server returns an error in the status variable.
>>>> Do you have any idea what could be wrong?
>>>>
>>>> Thanks for your support.
>>>> Hope to hear from you.
>>>>
>>>> Regards,
>>>> Farkas
>>>>
>>>> [1]
>>>> Unable to run your python process properly. Please check the following messages
>>>> : ['  File "C:\\OSGeo4W\\bin\\ogr_sp.py", line 207, in UnionPy\n    if not(tres.
>>>> IsEmpty()):\n', '  File "C:\\Python27\\lib\\site-packages\\osgeo\\ogr.py", line
>>>> 2758, in __getattr__\n    raise AttributeError(key)\n']</ows:ExceptionText>
>>>>
>>>> [2]
>>>> Unable to run your python process properly. Please check the following messages
>>>> : ['  File "C:\\OSGeo4W\\bin\\ogr_sp.py", line 165, in CentroidPy\n    return zo
>>>> o.SUCCEEDED\n']</ows:ExceptionText>
>>>>
>>>> [3]
>>>> Unable to run your python process properly. Please check the following messages
>>>> : ['  File "C:\\OSGeo4W\\bin\\ogr_sp.py", line 179, in ConvexHullPy\n    return
>>>> zoo.SUCCEEDED\n']</ows:ExceptionText>
>>>>
>>>> [4]
>>>> $.ajax({
>>>>   type: 'GET',
>>>>   url: 'http://localhost/cgi-bin/zoo_loader.cgi',
>>>>   contentType: 'text/xml',
>>>>   data: "{'serviceprovider=&metapath=&request=GetCapabilities&Service=WPS'}",
>>>>     complete: function(xml, status) {
>>>>         $("#divResult").html(status);
>>>>     }
>>>> });
>>>>
>>>> Alternatively, I've tried
>>>>   url: 'http://localhost/cgi-bin/zoo_loader.cgi?serviceprovider=&metapath=&request=GetCapabilities&Service=WPS',
>>>>   contentType: 'text/xml',
>>>>
>>>>
>>>> result: error
>>>>
>>>>
>>>>
>>>> On 9 January 2013 10:29, Gérald Fenoy <gerald.fenoy at geolabs.fr> wrote:
>>>>> Hi Farkas,
>>>>> happy new year 2013!
>>>>>
>>>>> My answer in the following.
>>>>>
>>>>> Gérald Fenoy
>>>>> gerald.fenoy at geolabs.fr
>>>>>
>>>>> Le 30 déc. 2012 à 23:32, Farkas H <farkas.dus at gmail.com> a écrit :
>>>>>
>>>>>> Hi Gérald,
>>>>>>
>>>>>> sorry for my late answer.
>>>>>> I've setup the kernel with revision 381 and the updated file ogr_sp.py.
>>>>>>
>>>>>> The command ".\zoo_loader.cgi.." still doesn't work with my main.cfg.
>>>>>> Please find the log file here [1].
>>>>>>
>>>>>> However the command works if I set the GDAL_DATA variable manually (as
>>>>>> previously).
>>>>>> Please find the log file here [2].
>>>>>>
>>>>>> Please find my main.cfg here [3].
>>>>>> I'll create an account and also will open the ticket in the next days.
>>>>>
>>>>> I guess that you're using the same settings in both cases for the value of GDAL_DATA ?
>>>>>
>>>>>>
>>>>>>
>>>>>> Http-Post and http-Get requests for BufferPy are both ok now.
>>>>>
>>>>> That is a good news.
>>>>>
>>>>>>
>>>>>>
>>>>>> I'm a little bit confused where the server puts the referenced
>>>>>> response data, if I set output asReference="true".
>>>>>> The server response:
>>>>>> ...
>>>>>> <wps:Reference href="http://localhost:80///tmp/ms_tmp/BufferPy_Result_1029
>>>>>> 88.xml" mimeType="text/xml" encoding="UTF-8" schema="http://schemas.opengis.net/
>>>>>> gml/3.1.0/base/feature.xsd"/>
>>>>>> ...
>>>>>>
>>>>>> Due to this response I would suspect the data in the apache file structure.
>>>>>> In my case the response file should be returned in
>>>>>> C:\OSGeo4W\apache\htdocs\tmp\ms_tmp\...
>>>>>>
>>>>>> But the file is returned in C:\tmp\ms_tmp.
>>>>>> If the path [Sysdrive:]\tmp\ms_tmp\ doesn't exist the process fails.
>>>>>> Error message: "ZOO Kernel failed to process your request receiving
>>>>>> signal 11 = SIGSEGV"
>>>>>>
>>>>>> Is there a context to the variables in the file main.cfg?
>>>>>> Could you please explain the variables tmpPath, tmpUrl and dataPath in
>>>>>> the main.cfg.
>>>>>
>>>>> This is due to settings made in the main.cfg file. You define here the tmpPath which is the full path to store temporary files on your server hard drive.  Then you get a tmpUrl which is used to build the URL to give back to you in the response to let you fetch the resource.
>>>>>
>>>>> I'm really interested in working deeper on this as I should modify a bit the ZOO-Kernel code to make it working on IIS server and it worked before with Apache on Windows so I will probably have to check what is the version  and set environment variables in a different manner. Or maybe use both methods every time to make sure that whatever is your Web Server you'll be able to use this capabilities of automatic env variables setting.
>>>>>
>>>>>>
>>>>>>
>>>>>> This update also fixes the following requests: IntersectPy,
>>>>>> DifferencePy, SymDifferencePy.
>>>>>> => http://lists.osgeo.org/pipermail/zoo-discuss/2012-November/000874.html
>>>>>
>>>>> Great thanks a lot for your testing.
>>>>>
>>>>>>
>>>>>>
>>>>>> The function UnionPy still doesn't work. Please find the error message here [4].
>>>>>
>>>>> I guess this is because of line 203 containing currently the following:
>>>>>
>>>>> tres=geometry1[i].Union(geometry2[j])
>>>>>
>>>>> which should be replaced by the following:
>>>>>
>>>>> tres=geometry1[j].Clone()
>>>>> resg=geometry2[j].GetGeometryRef()
>>>>> resg=geometry1[i].GetGeometryRef().Union(resg)
>>>>> tres.SetGeometryDirectly(resg)
>>>>>
>>>>> I think this should solve the issue.
>>>>>
>>>>>>
>>>>>>
>>>>>> Currently I'm running http-Post requests directly on the server using
>>>>>> the following command:
>>>>>> curl -H "content-type: text/xml" -d @[http-Post_request_file.xml]
>>>>>> http://localhost/cgi-bin/zoo_loader.cgi
>>>>>>
>>>>>> How can I send http-Post requests from the client?
>>>>>>
>>>>>
>>>>> I guess you're asking how to send requests using JavaScript code running on the client side. If yes, then you can use something similar to the following in your JavaScript code:
>>>>>
>>>>> $.ajax({
>>>>>       type: 'POST',
>>>>>       contentType: 'text/xml',
>>>>>       data: <DATA>,
>>>>>       complete: function(xml,status){
>>>>>               // Do whatever you want with your result
>>>>>       }
>>>>> })
>>>>>
>>>>> Hope this helps and to her back from you,
>>>>> Best regards,
>>>> _______________________________________________
>>>> Zoo-discuss mailing list
>>>> Zoo-discuss at lists.osgeo.org
>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss
>>>
>> _______________________________________________
>> Zoo-discuss mailing list
>> Zoo-discuss at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss
>


More information about the Zoo-discuss mailing list