[Zoo-discuss] BufferPy problem

Farkas H farkas.dus at gmail.com
Mon Jan 14 14:10:42 PST 2013


Hi Gérald,

the curl requests are working.
Even after the removal of the carriage returns from the xml file, the
result is the same.

I've compiled the kernel using rev. 390. But I still don't get a
response if I send the http-Post request via Browser.
- status: 'error'
- xml.responseText: empty
- apache log - request method: OPTIONS
- apache log - sent bytes: 531 (curl 5539)

There is still a problem on the kernel side.
I hope to hear from you.

Regards,
Farkas


On 14 January 2013 13:53, Gérald Fenoy <gerald.fenoy at geolabs.fr> wrote:
> Farkas,
> I've committed a small change (rev. 390) which may explain why it is working from your curl request and not from a browser.
>
> Can you confirm that this rev. 390 solve your issue please ?
>
> Waiting for your answer,
> Best regards,
>
> Gérald Fenoy
> gerald.fenoy at geolabs.fr
>
>
> Le 14 janv. 2013 à 08:16, Gérald Fenoy <gerald.fenoy at geolabs.fr> a écrit :
>
>> Hi Farkas,
>> personally I think that it is a good point to get the curl request working as it means that your ZOO-Kernel is correctly working.
>>
>> I would like to make sure that you get also the XML response but as you said you get a correct response I guess it is the case.
>>
>> You said you removed the carriage returns, did you try without the carriage return with curl to make sure there is no issue on that side ?
>> I think that this should confirm or not that there is no problem on the ZOO-Kernel side but only on the way we are requesting it.
>>
>> Note that you should be able to use the $.ajax function without any issue, you should use it in the following way:
>>
>> $.ajax({
>>       type: "POST",
>>       url: "http://localhost/cgi-bin/zoo_loader.cgi",
>>       contenteType: "text/xml",
>>       data: data,
>>       complete: function(xml,status){
>>               alert(xml.reponseText);
>>       }
>> });
>>
>> This should not imply that you get OPTION request from apache error log. Please make sure you use well this Ajax request and not another one probably present in your application.
>>
>> I'm pretty sure this will work.
>>
>> Hope to hear back from you,
>> Best regards,
>>
>> Gérald Fenoy
>> gerald.fenoy at geolabs.fr
>>
>>
>> Le 13 janv. 2013 à 23:37, Farkas H <farkas.dus at gmail.com> a écrit :
>>
>>> Hi Gérald,
>>>
>>> thanks for your answer.
>>> With changeset 389 all mentioned Python requests are ok. Thank you very much.
>>>
>>>
>>> Concerning the Post request I do the following.
>>> I have a xml file containing a http-Post request [1]. I send this Post
>>> request via curl to the server and get a correct response.
>>> Please find the log file here [2] and the apache log file here [3].
>>>
>>> Than I simply assign the content of the xml file with the Post request
>>> to the data variable in the JavaScript file (I've removed the carriage
>>> returns).
>>> ...
>>> data: 'content of the xml file with the Post request from above',
>>> ...
>>>
>>> Than I send the Post request embedded in the JavaScript file to the server.
>>>
>>> The status in the apache log file is OK, 200 [4].
>>> However the request method in the apache log file is OPTIONS and the
>>> number of bytes sent to the client is less (531 vs. 1390).
>>>
>>> Do you have any idea?
>>> Hope to hear from you.
>>>
>>> Regards,
>>> Farkas
>>>
>>>
>>> [1] ======
>>> <wps:Execute service="WPS" version="1.0.0"
>>> xmlns:wps="http://www.opengis.net/wps/1.0.0"
>>> xmlns:ows="http://www.opengis.net/ows/1.1"
>>> xmlns:xlink="http://www.w3.org/1999/xlink"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
>>> http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
>>> <ows:Identifier>BufferPy</ows:Identifier>
>>> <wps:DataInputs>
>>> <wps:Input>
>>> <ows:Identifier>InputPolygon</ows:Identifier>
>>> <ows:Title>water bodies</ows:Title>
>>> <wps:Reference xlink:href="http://demo.opengeo.org/geoserver/ows?Request=GetFeature&Service=WFS&Version=1.0.0&Typename=topp:states"/>
>>> </wps:Input>
>>> <wps:Input>
>>> <ows:Identifier>BufferDistance</ows:Identifier>
>>> <ows:Title>Emergency area.</ows:Title>
>>> <wps:Data>
>>> <wps:LiteralData>0.01</wps:LiteralData>
>>> </wps:Data>
>>> </wps:Input>
>>> </wps:DataInputs>
>>> <wps:ResponseForm>
>>> <wps:ResponseDocument storeExecuteResponse="false">
>>> <wps:Output asReference="true">
>>> <ows:Identifier>Result</ows:Identifier>
>>> </wps:Output>
>>> </wps:ResponseDocument>
>>> </wps:ResponseForm>
>>> </wps:Execute>
>>>
>>>
>>> [2]   ======
>>> * About to connect() to localhost port 80
>>> *   Trying 127.0.0.1... connected
>>> * Connected to localhost (127.0.0.1) port 80
>>>> POST /cgi-bin/zoo_loader.cgi HTTP/1.1
>>>> User-Agent: curl/7.15.1 (i386-pc-win32) libcurl/7.15.1 OpenSSL/1.0.1c zlib/1.2.3
>>>> Host: localhost
>>>> Accept: */*
>>>> content-type: text/xml
>>>> Content-Length: 1040
>>>> Expect: 100-continue
>>>>
>>> < HTTP/1.1 100 Continue
>>> HTTP/1.1 200 OK
>>> < Date: Sun, 13 Jan 2013 22:09:34 GMT
>>> < Server: Apache/2.2.14 (Win32)
>>> < Transfer-Encoding: chunked
>>> < Content-Type: text/xml; charset=UTF-8
>>> * Connection #0 to host localhost left intact
>>> * Closing connection #0
>>>
>>>
>>> [3] ======
>>> 127.0.0.1 - - [13/Jan/2013:23:09:34 +0100] "POST
>>> /cgi-bin/zoo_loader.cgi HTTP/1.1" 200 1390
>>>
>>>
>>> [4] ======
>>> 127.0.0.1 - - [13/Jan/2013:23:06:42 +0100] "OPTIONS
>>> /cgi-bin/zoo_loader.cgi HTTP/1.1" 200 531
>>>
>>>
>>>
>>> On 13 January 2013 20:50, Gérald Fenoy <gerald.fenoy at geolabs.fr> wrote:
>>>> Hi Farkas,
>>>> I forgot to say in my previous email that using rev. 389 should solve issue using UnionPy service.
>>>>
>>>> I'm not sure to follow what happen when you use POST request. Did you try using curl tool from command line with -v option to get a verbose output ? If yes, what was the output ? I guess it would be helpful for testing your ZOO-Kernel version and make sure it can handle properly the POST requests to run curl from command line.
>>>>
>>>> Did you take a look at the Apache error log ? Maybe there is some user privileges issue due to running zoo_loader.cgi from the command line using another user (which make some files owned by this user).
>>>>
>>>> It would be helpful to get more details on what is not working what is exactly the XML request you are using to request the ZOO-Kernel.
>>>>
>>>> I hope you can provide more details.
>>>>
>>>> Waiting for your answer,
>>>> Best regards,
>>>>
>>>>
>>>>
>>>> Gérald Fenoy
>>>> gerald.fenoy at geolabs.fr
>>>>
>>>>
>>>> Le 13 janv. 2013 à 20:43, Farkas H <farkas.dus at gmail.com> a écrit :
>>>>
>>>>> Firebug reports that parsing the xml causes an error [2] when
>>>>> processing the JavaScript via http-Post request.
>>>>>
>>>>> Do you have any idea?
>>>>
>>> _______________________________________________
>>> 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