<div dir="ltr">Hello Gerald,<div><br></div><div>Thank you when I set the cookie it's work but it's not expected processing.</div><div>Sorry for being not clear.</div><div><br></div><div>For exemple when I do the GET request with CURL it's working without set a cookie in the headers request:</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="MsoNormal"><span lang="EN-US"><i>curl -v
"http://<host>/crv/<key>/doSomething?p1=ZH&p2=ZH&p3=3&p4=46.6947&p5=-2.8564"</i></span></p></div></blockquote><div><p class="MsoNormal">Here the log :</p></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="MsoNormal"><i>* About to connect() to <host> port 80 (#0)                                                         </i></p></div><div><p class="MsoNormal"><i>*   Trying xxx.xxx.xxx.xxx... connected                                                                             </i></p></div><div><p class="MsoNormal"><i>* Connected to <host> (</i><i>xxx.xxx.xxx.xxx</i><i>) port 80 (#0)                                                 </i></p></div><div><p class="MsoNormal"><i>> GET /crv/<key>/</i><i>doSomething?p1=ZH&p2=ZH&p3=3&p4=46.6947&p5=-2.8564</i><i> HTTP/1.1 </i></p></div><div><p class="MsoNormal"><i>> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 </i></p></div><div><p class="MsoNormal"><i>> Host: </i><i><host></i><i>                                                                                     </i></p></div><div><p class="MsoNormal"><i>> Accept: */*                                                                                                      </i></p></div><div><p class="MsoNormal"><i>>                                                                                                                  </i></p></div><div><p class="MsoNormal"><i>< HTTP/1.1 200 OK                                                                                                  </i></p></div><div><p class="MsoNormal"><i>< Server: nginx                                                                                                    </i></p></div><div><p class="MsoNormal"><i>< Date: Wed, 24 May 2017 07:53:24 GMT                                                                              </i></p></div><div><p class="MsoNormal"><i>< Content-Type: text/html; charset=utf-8                                                                           </i></p></div><div><p class="MsoNormal"><i>< Vary: Accept-Encoding                                                                                            </i></p></div><div><p class="MsoNormal"><i>< Set-Cookie: route=abe6a29b89be7b9be8f1bf07ea11b863; Path=/                                                       </i></p></div><div><p class="MsoNormal"><i>< X-Powered-By: Express                                                                                            </i></p></div><div><p class="MsoNormal"><i>< Content-Length: 29                                                                                               </i></p></div><div><p class="MsoNormal"><i>< X-Cache: xxxxxxxx                                                                    </i></p></div><div><p class="MsoNormal"><i>< X-Cache-Lookup: xxxxxxxxx                                                  </i></p></div><div><p class="MsoNormal"><i>< Connection: keep-alive                                                                                           </i></p></div><div><p class="MsoNormal"><i><                                                                                                                  </i></p></div><div><p class="MsoNormal"><i>* Connection #0 to host <host> left intact                                                          </i></p></div><div><p class="MsoNormal"><i>* Closing connection #0</i></p></div></blockquote><div><p class="MsoNormal"><i><br></i></p><p class="MsoNormal">The cookie is set in the response header and the first time I request the service, no cookies are set.<i>                   </i>                                        So in the JS file I have just to do that : ZOO.Request.Get(url, params)</p><p class="MsoNormal">But it's fails due to an segmentation fault when the ulinet set the response header at line "Set-Cookie: "</p><p class="MsoNormal">I add log in the ulinet programs for show this :</p></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><p class="MsoNormal"><span lang="EN-US">*<i> About to
connect() to <host> port 80 (#0)<span></span></i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>*   Trying xxx.xxx.xxx.xxx... connected</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>* Connected
to <host> (xxx.xxx.xxx.xxx) port 80 (#0)</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>> GET
/crv/<key>/doSomething?p1=ZH&p2=ZH&p3=3&p4=46.6947&p5=-2.8564
HTTP/1.1</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>User-Agent:
ZooWPSClient</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>Host:
<host></i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>Accept: */*</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i> </i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i><
HTTP/1.1 200 OK</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i><
Server: nginx</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>< Date:
Wed, 24 May 2017 08:09:39 GMT</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i><
Content-Type: text/html; charset=utf-8</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>< Vary:
Accept-Encoding</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>* Added
cookie route="abe6a29b89be7b9be8f1bf07ea11b863" for domain
<host>, path /, expire 0</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i><
Set-Cookie: route=abe6a29b89be7b9be8f1bf07ea11b863; Path=/</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] In function header_write_data</i></span></p></div><div><p class="MsoNormal"><span lang="EN-US"><i>[DEBUG -
ulinet] Variable tmp: route=abe6a29b89be7b9be8f1bf07ea11b863</i></span></p></div><div><p class="MsoNormal"><i>[DEBUG -
ulinet] the line before sprintf(CCookie[psInternet->id],"",tmp);</i></p></div></blockquote><div style="font-style:italic"><i><br></i></div>I hope it's help you for understand the issue.<div><i><br></i></div><div>Best regards <i>           </i>                <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-23 14:01 GMT+02:00 Fenoy Gerald <span dir="ltr"><<a href="mailto:gerald.fenoy@geolabs.fr" target="_blank">gerald.fenoy@geolabs.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">François,<br>
you should try using the revision 828.<br>
<br>
You should consider using the new version of ZOO-API.js it contains.<br>
<br>
There were no support for passing any headers to GET request from the js ZOO-API.<br>
<br>
I have modified the ZOO-API to enable this support.<br>
<br>
Still, note that defining conf["lenv"]["cookie"] is required only for services that are supposed to produce a session environment and a linked Cookie is generated and returned to the client application. So it is not the way to pass headers to your requests from the js ZOO-API.<br>
<br>
You can use the following syntaxe from your js code:<br>
<br>
var i=ZOO.Request.Get("<a href="http://www.gogle.com/" rel="noreferrer" target="_blank">http://www.<wbr>gogle.com/</a>",{"toto":"toto"},{"<wbr>Cookie": "XXX=XXXXXXXX01"});<br>
<br>
or<br>
<br>
var i=ZOO.Request.Get("<a href="http://www.gogle.com/" rel="noreferrer" target="_blank">http://www.<wbr>gogle.com/</a>",{"toto":"toto"},["<wbr>Cookie: XXX=XXXXXXXX01;"]);<br>
<br>
I hope it helps.<br>
<span class="im HOEnZb"><br>
Gérald Fenoy<br>
<a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
<br>
</span><div class="HOEnZb"><div class="h5">> Le 23 mai 2017 à 10:39, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
><br>
> Hello,<br>
><br>
> Thank you. I tested this revision but it fails. I have a segmentation error.<br>
> The line where the program fail is 97 :<br>
> sprintf(CCookie[psInternet-><wbr>id],"%s",tmp);<br>
> The value in the tmp variable is correct.<br>
><br>
> Maybe I do wrong when I declare the cookie in the JS file.<br>
> In the JS file I add this line :<br>
> conf["lenv"]["cookie"]="XXX=<wbr>XXX1000000; path=/";<br>
><br>
> and after that I do the ZOO.Request.Get<br>
><br>
><br>
><br>
> Also in the ulinet.h, the prototype was not change to :<br>
><br>
><br>
> bool setProxiesForProtcol(CURL*,<wbr>const char*);<br>
><br>
><br>
><br>
> Best regards<br>
><br>
><br>
> 2017-05-22 21:33 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
> Thanks for your feedback.<br>
><br>
> The previous ulinet.c version was containing an error. Please can you give revision 827 a try ?<br>
><br>
> I suppose it will solve your issue.<br>
><br>
> Best regards,<br>
><br>
><br>
> Gérald Fenoy<br>
> <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
><br>
> > Le 22 mai 2017 à 17:36, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
> ><br>
> > Thank you for your presicions.<br>
> ><br>
> > I have noticed an issue in the file ulinet.c of 825 revision :<br>
> > The env variable is undeclared in the function header_write_data but use in line 96.<br>
> > For test I set : char env[256]<br>
> > I don't know if it's the right correction but I when I do GET request on web service who send cookies to the client the ZOORequest failed.<br>
> ><br>
> > 2017-05-22 14:56 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
> > François,<br>
> > sorry for being not clear.<br>
> ><br>
> > In the file ZOOMakefile.opts (generated by the configure script, so you may also edit <a href="http://ZOOMakefile.opts.in" rel="noreferrer" target="_blank">ZOOMakefile.opts.in</a> in case you run the ./configure command again) you should add to you CFLAGS definition the following option: -DMSG_LAF_VERBOSE. Then remove any ulinet.o already built and run make again.<br>
> ><br>
> > I hope it helps.<br>
> ><br>
> > Best regards,<br>
> ><br>
> > Gérald Fenoy<br>
> > <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
> ><br>
> > > Le 22 mai 2017 à 14:52, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
> > ><br>
> > > Hello,<br>
> > ><br>
> > > Thank you.<br>
> > > I tested to add MSG_LAF_VERBOSE= -DMSG_LAF_VERBOSE in the zoo-kernel Makefile but it's not working.<br>
> > ><br>
> > > In the main.cfg I put this in the main section:<br>
> > > logPath = /var/log/zoo/out.log<br>
> > > But nothing is log when I use the ZOO.Request.Get in the script hello.js :<br>
> > > ./zoo_loader.cgi "Request=Execute&service=WPS&<wbr>Identifier=hellojs&version=1.<wbr>0.0&DataInputs=S=test"<br>
> > ><br>
> > ><br>
> > ><br>
> > > Best regards<br>
> > ><br>
> > ><br>
> > ><br>
> > > 2017-05-22 10:21 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
> > > Hello François,<br>
> > > sorry for late reply.<br>
> > ><br>
> > > In case you want to debug the CURL call used for every internal HTTP request and the one coming from the JS ZOO-API call, then you can define the MSG_LAF_VERBOSE variable at compilation time to produce a debug version. Once you have added the -DMSG_LAF_VERBOSE in your Makefile, simply remove the ulinet.o and run the make command again.<br>
> > ><br>
> > > In case you need only to debug the result returned by the ZOO-API call, then you can simply use the alert function from the ZOO-API to display debug messages in your web server error log file. In case you want to handle exception you can then use basic try / catch blocks.<br>
> > ><br>
> > > I hope it helps.<br>
> > ><br>
> > > ps: I have noticed that the discussion is not available to the public, you may think of answering this email using the ZOO-Discuss mailing list. What you are asking may be of interest to other also.<br>
> > ><br>
> > > Gérald Fenoy<br>
> > > <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
> > ><br>
> > > > Le 20 mai 2017 à 19:26, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
> > > ><br>
> > > > Hello Gerald,<br>
> > > ><br>
> > > > Thanks a lot for your help. Now it's work perfectly with the new revision.<br>
> > > > I think I had an old revision.<br>
> > > ><br>
> > > > Another question, how can I get log from the ZOORequest and handle exceptions ?<br>
> > > ><br>
> > > > Best regards,<br>
> > > ><br>
> > > > Dodé François<br>
> > > ><br>
> > > > 2017-05-17 14:55 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
> > > > Hello François,<br>
> > > > thanks for the feedbacks about this issue.<br>
> > > ><br>
> > > > May I ask you to build a new ZOO-Kernel using the revision 825 [1] ? This version should solve this issue.<br>
> > > ><br>
> > > > I hope to hear back from you.<br>
> > > ><br>
> > > > Best regards,<br>
> > > ><br>
> > > > [1] <a href="http://www.zoo-project.org/trac/changeset/825" rel="noreferrer" target="_blank">http://www.zoo-project.org/<wbr>trac/changeset/825</a><br>
> > > ><br>
> > > > > Le 17 mai 2017 à 10:25, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
> > > > ><br>
> > > > > Hello Gerald,<br>
> > > > ><br>
> > > > > Thank you for your quick response.<br>
> > > > > Maybe it's my install of mozjs. I run the ZOO on CentOs 6 and I had to build this library.<br>
> > > > > Here is the library :<br>
> > > > > <a href="http://ftp.mozilla.org/pub/js/js185-1.0.0.tar.gz" rel="noreferrer" target="_blank">http://ftp.mozilla.org/pub/js/<wbr>js185-1.0.0.tar.gz</a><br>
> > > > ><br>
> > > > > I add the request GET in the script hello.js.<br>
> > > > > My Javascript process call the ZOO.Request.Get like this :<br>
> > > > > ZOO.Request.Get("<a href="http://www.google.fr/" rel="noreferrer" target="_blank">http://www.<wbr>google.fr/</a>")<br>
> > > > > I put the result in the alert() function.<br>
> > > > ><br>
> > > > > Best regards,<br>
> > > > ><br>
> > > > > Dodé François<br>
> > > > ><br>
> > > > ><br>
> > > > > 2017-05-12 19:42 GMT+02:00 Fenoy Gerald <<a href="mailto:gerald.fenoy@geolabs.fr">gerald.fenoy@geolabs.fr</a>>:<br>
> > > > > Hello François,<br>
> > > > > ZOORequest shall be defined at runtime by the ZOO-Kernel [1].<br>
> > > > ><br>
> > > > > Are you sure the issue comes from call to ZOO.Request.Get ?<br>
> > > > ><br>
> > > > > Can you please provide more details about your JavScript service ?<br>
> > > > ><br>
> > > > > Best regards,<br>
> > > > ><br>
> > > > > [1] <a href="http://www.zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/service_internal_js.c#L152" rel="noreferrer" target="_blank">http://www.zoo-project.org/<wbr>trac/browser/trunk/zoo-<wbr>project/zoo-kernel/service_<wbr>internal_js.c#L152</a><br>
> > > > ><br>
> > > > > > Le 12 mai 2017 à 16:06, François Dodé <<a href="mailto:dode.francois@gmail.com">dode.francois@gmail.com</a>> a écrit :<br>
> > > > > ><br>
> > > > > > Hello,<br>
> > > > > ><br>
> > > > > > I want to make a GET request with the ZOO-api but I have the following error :<br>
> > > > > > <ows:Exception exceptionCode="InternalError"><br>
> > > > > >     <ows:ExceptionText>ZOO Kernel failed to process your request, receiving signal 11 = SIGSEGV</ows:ExceptionText><br>
> > > > > >  </ows:Exception><br>
> > > > > ><br>
> > > > > > In the ZOO-api.js in the function ZOO.Request.Get(url, params) it returns a class named ZOORequest but this class doesn't exist.<br>
> > > > > ><br>
> > > > > > Have you a solution ?<br>
> > > > > ><br>
> > > > > > Best regards<br>
> > > > > > ______________________________<wbr>_________________<br>
> > > > > > Zoo-discuss mailing list<br>
> > > > > > <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
> > > > > > <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
> > > > ><br>
> > > > ><br>
> > > > ><br>
> > > > > Gérald Fenoy<br>
> > > > > <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
> > > > ><br>
> > > > ><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Gérald Fenoy<br>
> > > > <a href="http://wiki.osgeo.org/wiki/User:Djay" rel="noreferrer" target="_blank">http://wiki.osgeo.org/wiki/<wbr>User:Djay</a><br>
> > > ><br>
> > > ><br>
> > ><br>
> > ><br>
> > > ______________________________<wbr>_________________<br>
> > > Zoo-discuss mailing list<br>
> > > <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
> > > <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
> ><br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > Zoo-discuss mailing list<br>
> > <a href="mailto:Zoo-discuss@lists.osgeo.org">Zoo-discuss@lists.osgeo.org</a><br>
> > <a href="https://lists.osgeo.org/mailman/listinfo/zoo-discuss" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/zoo-discuss</a><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>