You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by Raido Kuli <ra...@gmail.com> on 2010/02/17 14:58:02 UTC

Re: [jira] Commented: (WOOKIE-118) GET and POST request broken (jQuery + Widget.proxify)

     [java] 15:49:16,401  WARN log:? - /wookie/proxy
     [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
k-ordi:8082/demo_xml/response.php&ants=tere Not Found<!DOCTYPE HTML PUBLIC "-//I
ETF//DTD HTML 2.0//EN">
     [java] <html><head>
     [java] <title>404 Not Found</title>
     [java] </head><body>
     [java] <h1>Not Found</h1>
     [java] <p>The requested URL /demo_xml/response.php&amp;ants=tere was not fo
und on this server.</p>
     [java] </body></html>

jQuery.get() without "?" fix, produces still the same error, maybe
really jQuery can't handle proxified URL, have to dig in more.

One more issue has now occured, jQuery allows specifing datatype
(which comes from server), now jQuery.get()/jQuery.post() fails/breaks
when datatype is set to "xml". No response from server is ever caught.
 When datatypes is "html", server response is recieved, but i need the
datatype to be XML, to use jQuery useful XML manipulation functions.

Console window doesn't produce any errors with datatype "xml".

jQuery.post() + parameters now seems to work okay (simple hello world
test, haven't tried to send some XML through it).

--
Raido



On Wed, Feb 17, 2010 at 2:57 PM, Scott Wilson (JIRA) <ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/WOOKIE-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834755#action_12834755 ]
>
> Scott Wilson commented on WOOKIE-118:
> -------------------------------------
>
> Checked in some more changes... it turns out the POST support passed through the request body but not form parameters. I've changed it to do both, and added more test cases for that.
>
> On the other issue - perhaps JQuery is parsing the proxied URL, noting it already contains a "?" and then prepending "&" before adding the parameters?
>
>> GET and POST request broken (jQuery + Widget.proxify)
>> -----------------------------------------------------
>>
>>                 Key: WOOKIE-118
>>                 URL: https://issues.apache.org/jira/browse/WOOKIE-118
>>             Project: Wookie
>>          Issue Type: Bug
>>          Components: Server
>>            Reporter: Raido Kuli
>>             Fix For: 0.8.1
>>
>>
>>      [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
>> k-ordi:8082/demo_xml/response.php&responseXml=%3C%3Fxml+version%3D%221.0%22+enco
>> ding%3D%22UTF-8%22%3F%3E%0D%0A%3CwidgetResponse%3E%0D%0A%3Cresponse+Identifier%3
>> D%22RESPONSE_3%22+value%3D%22G%22%3E%3C%2Fresponse%3E%0D%0A%3C%2FwidgetResponse%
>> 3E Not Found<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>      [java] <html><head>
>>      [java] <title>404 Not Found</title>
>>      [java] </head><body>
>>      [java] <h1>Not Found</h1>
>>      [java] <p>The requested URL /demo_xml/response.php&amp;responseXml=&lt;?xml
>> +version=&quot;1.0&quot;+encoding=&quot;UTF-8&quot;?&gt;
>>      [java] &lt;widgetResponse&gt;
>>      [java] &lt;response+Identifier=&quot;RESPONSE_3&quot;+value=&quot;G&quot;&g
>> t;&lt;/response&gt;
>>      [java] &lt;/widgetResponse&gt; was not found on this server.</p>
>>      [java] </body></html>
>>      [java]
>>      [java]     at org.apache.wookie.proxy.ProxyClient.executeMethod(ProxyClient
>> .java:149)
>>      [java]     at org.apache.wookie.proxy.ProxyClient.fetchData(ProxyClient.jav
>> a:169)
>>      [java]     at org.apache.wookie.proxy.ProxyClient.get(ProxyClient.java:85)
>>      [java]     at org.apache.wookie.proxy.ProxyServlet.dealWithRequest(ProxySer
>> vlet.java:100)
>>      [java]     at org.apache.wookie.proxy.ProxyServlet.doGet(ProxyServlet.java:
>> 61)
>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>      [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
>> java:487)
>>      [java]     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>> (ServletHandler.java:1098)
>>      [java]     at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter
>> .java:34)
>> This happens if i trie run jQuery.get() ->
>> var loc = Widget.proxify('http://mywidget.get.url/response.php');
>> jQuery.get(
>>                           loc, { responseXml : respXml },
>>                                       handleResponse
>>            );
>> This code above brokes the proxy. I've also found a fix for this, you need to add "?" in the end of URL manually. So the code would look like ->
>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php?');
>> jQuery.get(
>>                           loc, { responseXml : respXml },
>>                                       handleResponse
>>            );
>> This way the GET request starts to work.
>> Now for the POST request, I am in wookie-dev list  and got some emails, that "POST is now forwarded through proxy", but with jQuery it does not.
>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php');
>> jQuery.post(
>>                           loc, { responseXml : respXml },
>>                                       handleResponse
>>            );
>> PHP script returns empty $_POST.
>> Maybe I am doing something wrong ?
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

Re: [jira] Commented: (WOOKIE-118) GET and POST request broken (jQuery + Widget.proxify)

Posted by Raido Kuli <ra...@gmail.com>.
I did a test with PHP script

<?php

header("Content-type: text/xml"); // application/xml
echo file_get_contents("test3.xml");

?>

browsing the url
(http://localhost:8080/wookie/proxy?instanceid_key=D7GlSw7mzGFDcx7VWbAQmLFNC0c.eq.&url=http://htk-ordi:8082/demo_xml/render.php)
through proxy gives back plain text file, altough header is set to be
"text/xml", directly browsing
"http://htk-ordi:8082/demo_xml/render.php" show XML correctly.

As I understand, headers are getting messed up somewhere in proxy.

--
Raido


On Wed, Feb 17, 2010 at 4:04 PM, Raido Kuli <ra...@gmail.com> wrote:
> 00:16:52.498    0.124   670     5365    GET     200     text/plain      http://localhost:8080/wookie/proxy?instanceid_key=D7GlSw7mzGFDcx7VWbAQmLFNC0c.eq.&url=http://htk-ordi:8082/demo_xml/test3.xml
>
> jQuery.get() does the request and seems, but something is broken. Type
> should be application/xml and nohting is ever caught by script.
>
> --
> Raido
>
>
>
>
> On Wed, Feb 17, 2010 at 3:58 PM, Raido Kuli <ra...@gmail.com> wrote:
>>     [java] 15:49:16,401  WARN log:? - /wookie/proxy
>>     [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
>> k-ordi:8082/demo_xml/response.php&ants=tere Not Found<!DOCTYPE HTML PUBLIC "-//I
>> ETF//DTD HTML 2.0//EN">
>>     [java] <html><head>
>>     [java] <title>404 Not Found</title>
>>     [java] </head><body>
>>     [java] <h1>Not Found</h1>
>>     [java] <p>The requested URL /demo_xml/response.php&amp;ants=tere was not fo
>> und on this server.</p>
>>     [java] </body></html>
>>
>> jQuery.get() without "?" fix, produces still the same error, maybe
>> really jQuery can't handle proxified URL, have to dig in more.
>>
>> One more issue has now occured, jQuery allows specifing datatype
>> (which comes from server), now jQuery.get()/jQuery.post() fails/breaks
>> when datatype is set to "xml". No response from server is ever caught.
>>  When datatypes is "html", server response is recieved, but i need the
>> datatype to be XML, to use jQuery useful XML manipulation functions.
>>
>> Console window doesn't produce any errors with datatype "xml".
>>
>> jQuery.post() + parameters now seems to work okay (simple hello world
>> test, haven't tried to send some XML through it).
>>
>> --
>> Raido
>>
>>
>>
>> On Wed, Feb 17, 2010 at 2:57 PM, Scott Wilson (JIRA) <ji...@apache.org> wrote:
>>>
>>>    [ https://issues.apache.org/jira/browse/WOOKIE-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834755#action_12834755 ]
>>>
>>> Scott Wilson commented on WOOKIE-118:
>>> -------------------------------------
>>>
>>> Checked in some more changes... it turns out the POST support passed through the request body but not form parameters. I've changed it to do both, and added more test cases for that.
>>>
>>> On the other issue - perhaps JQuery is parsing the proxied URL, noting it already contains a "?" and then prepending "&" before adding the parameters?
>>>
>>>> GET and POST request broken (jQuery + Widget.proxify)
>>>> -----------------------------------------------------
>>>>
>>>>                 Key: WOOKIE-118
>>>>                 URL: https://issues.apache.org/jira/browse/WOOKIE-118
>>>>             Project: Wookie
>>>>          Issue Type: Bug
>>>>          Components: Server
>>>>            Reporter: Raido Kuli
>>>>             Fix For: 0.8.1
>>>>
>>>>
>>>>      [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
>>>> k-ordi:8082/demo_xml/response.php&responseXml=%3C%3Fxml+version%3D%221.0%22+enco
>>>> ding%3D%22UTF-8%22%3F%3E%0D%0A%3CwidgetResponse%3E%0D%0A%3Cresponse+Identifier%3
>>>> D%22RESPONSE_3%22+value%3D%22G%22%3E%3C%2Fresponse%3E%0D%0A%3C%2FwidgetResponse%
>>>> 3E Not Found<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>>>      [java] <html><head>
>>>>      [java] <title>404 Not Found</title>
>>>>      [java] </head><body>
>>>>      [java] <h1>Not Found</h1>
>>>>      [java] <p>The requested URL /demo_xml/response.php&amp;responseXml=&lt;?xml
>>>> +version=&quot;1.0&quot;+encoding=&quot;UTF-8&quot;?&gt;
>>>>      [java] &lt;widgetResponse&gt;
>>>>      [java] &lt;response+Identifier=&quot;RESPONSE_3&quot;+value=&quot;G&quot;&g
>>>> t;&lt;/response&gt;
>>>>      [java] &lt;/widgetResponse&gt; was not found on this server.</p>
>>>>      [java] </body></html>
>>>>      [java]
>>>>      [java]     at org.apache.wookie.proxy.ProxyClient.executeMethod(ProxyClient
>>>> .java:149)
>>>>      [java]     at org.apache.wookie.proxy.ProxyClient.fetchData(ProxyClient.jav
>>>> a:169)
>>>>      [java]     at org.apache.wookie.proxy.ProxyClient.get(ProxyClient.java:85)
>>>>      [java]     at org.apache.wookie.proxy.ProxyServlet.dealWithRequest(ProxySer
>>>> vlet.java:100)
>>>>      [java]     at org.apache.wookie.proxy.ProxyServlet.doGet(ProxyServlet.java:
>>>> 61)
>>>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>>      [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
>>>> java:487)
>>>>      [java]     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>>>> (ServletHandler.java:1098)
>>>>      [java]     at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter
>>>> .java:34)
>>>> This happens if i trie run jQuery.get() ->
>>>> var loc = Widget.proxify('http://mywidget.get.url/response.php');
>>>> jQuery.get(
>>>>                           loc, { responseXml : respXml },
>>>>                                       handleResponse
>>>>            );
>>>> This code above brokes the proxy. I've also found a fix for this, you need to add "?" in the end of URL manually. So the code would look like ->
>>>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php?');
>>>> jQuery.get(
>>>>                           loc, { responseXml : respXml },
>>>>                                       handleResponse
>>>>            );
>>>> This way the GET request starts to work.
>>>> Now for the POST request, I am in wookie-dev list  and got some emails, that "POST is now forwarded through proxy", but with jQuery it does not.
>>>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php');
>>>> jQuery.post(
>>>>                           loc, { responseXml : respXml },
>>>>                                       handleResponse
>>>>            );
>>>> PHP script returns empty $_POST.
>>>> Maybe I am doing something wrong ?
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>
>

Re: [jira] Commented: (WOOKIE-118) GET and POST request broken (jQuery + Widget.proxify)

Posted by Raido Kuli <ra...@gmail.com>.
00:16:52.498	0.124	670	5365	GET	200	text/plain	http://localhost:8080/wookie/proxy?instanceid_key=D7GlSw7mzGFDcx7VWbAQmLFNC0c.eq.&url=http://htk-ordi:8082/demo_xml/test3.xml

jQuery.get() does the request and seems, but something is broken. Type
should be application/xml and nohting is ever caught by script.

--
Raido




On Wed, Feb 17, 2010 at 3:58 PM, Raido Kuli <ra...@gmail.com> wrote:
>     [java] 15:49:16,401  WARN log:? - /wookie/proxy
>     [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
> k-ordi:8082/demo_xml/response.php&ants=tere Not Found<!DOCTYPE HTML PUBLIC "-//I
> ETF//DTD HTML 2.0//EN">
>     [java] <html><head>
>     [java] <title>404 Not Found</title>
>     [java] </head><body>
>     [java] <h1>Not Found</h1>
>     [java] <p>The requested URL /demo_xml/response.php&amp;ants=tere was not fo
> und on this server.</p>
>     [java] </body></html>
>
> jQuery.get() without "?" fix, produces still the same error, maybe
> really jQuery can't handle proxified URL, have to dig in more.
>
> One more issue has now occured, jQuery allows specifing datatype
> (which comes from server), now jQuery.get()/jQuery.post() fails/breaks
> when datatype is set to "xml". No response from server is ever caught.
>  When datatypes is "html", server response is recieved, but i need the
> datatype to be XML, to use jQuery useful XML manipulation functions.
>
> Console window doesn't produce any errors with datatype "xml".
>
> jQuery.post() + parameters now seems to work okay (simple hello world
> test, haven't tried to send some XML through it).
>
> --
> Raido
>
>
>
> On Wed, Feb 17, 2010 at 2:57 PM, Scott Wilson (JIRA) <ji...@apache.org> wrote:
>>
>>    [ https://issues.apache.org/jira/browse/WOOKIE-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834755#action_12834755 ]
>>
>> Scott Wilson commented on WOOKIE-118:
>> -------------------------------------
>>
>> Checked in some more changes... it turns out the POST support passed through the request body but not form parameters. I've changed it to do both, and added more test cases for that.
>>
>> On the other issue - perhaps JQuery is parsing the proxied URL, noting it already contains a "?" and then prepending "&" before adding the parameters?
>>
>>> GET and POST request broken (jQuery + Widget.proxify)
>>> -----------------------------------------------------
>>>
>>>                 Key: WOOKIE-118
>>>                 URL: https://issues.apache.org/jira/browse/WOOKIE-118
>>>             Project: Wookie
>>>          Issue Type: Bug
>>>          Components: Server
>>>            Reporter: Raido Kuli
>>>             Fix For: 0.8.1
>>>
>>>
>>>      [java] java.lang.Exception: Method failed: HTTP/1.1 404 Not Found http://ht
>>> k-ordi:8082/demo_xml/response.php&responseXml=%3C%3Fxml+version%3D%221.0%22+enco
>>> ding%3D%22UTF-8%22%3F%3E%0D%0A%3CwidgetResponse%3E%0D%0A%3Cresponse+Identifier%3
>>> D%22RESPONSE_3%22+value%3D%22G%22%3E%3C%2Fresponse%3E%0D%0A%3C%2FwidgetResponse%
>>> 3E Not Found<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>>>      [java] <html><head>
>>>      [java] <title>404 Not Found</title>
>>>      [java] </head><body>
>>>      [java] <h1>Not Found</h1>
>>>      [java] <p>The requested URL /demo_xml/response.php&amp;responseXml=&lt;?xml
>>> +version=&quot;1.0&quot;+encoding=&quot;UTF-8&quot;?&gt;
>>>      [java] &lt;widgetResponse&gt;
>>>      [java] &lt;response+Identifier=&quot;RESPONSE_3&quot;+value=&quot;G&quot;&g
>>> t;&lt;/response&gt;
>>>      [java] &lt;/widgetResponse&gt; was not found on this server.</p>
>>>      [java] </body></html>
>>>      [java]
>>>      [java]     at org.apache.wookie.proxy.ProxyClient.executeMethod(ProxyClient
>>> .java:149)
>>>      [java]     at org.apache.wookie.proxy.ProxyClient.fetchData(ProxyClient.jav
>>> a:169)
>>>      [java]     at org.apache.wookie.proxy.ProxyClient.get(ProxyClient.java:85)
>>>      [java]     at org.apache.wookie.proxy.ProxyServlet.dealWithRequest(ProxySer
>>> vlet.java:100)
>>>      [java]     at org.apache.wookie.proxy.ProxyServlet.doGet(ProxyServlet.java:
>>> 61)
>>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>>>      [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>>>      [java]     at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
>>> java:487)
>>>      [java]     at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
>>> (ServletHandler.java:1098)
>>>      [java]     at org.apache.wookie.server.CharSetFilter.doFilter(CharSetFilter
>>> .java:34)
>>> This happens if i trie run jQuery.get() ->
>>> var loc = Widget.proxify('http://mywidget.get.url/response.php');
>>> jQuery.get(
>>>                           loc, { responseXml : respXml },
>>>                                       handleResponse
>>>            );
>>> This code above brokes the proxy. I've also found a fix for this, you need to add "?" in the end of URL manually. So the code would look like ->
>>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php?');
>>> jQuery.get(
>>>                           loc, { responseXml : respXml },
>>>                                       handleResponse
>>>            );
>>> This way the GET request starts to work.
>>> Now for the POST request, I am in wookie-dev list  and got some emails, that "POST is now forwarded through proxy", but with jQuery it does not.
>>> var loc = Widget.proxify('http://htk-ordi:8082/demo_xml/response.php');
>>> jQuery.post(
>>>                           loc, { responseXml : respXml },
>>>                                       handleResponse
>>>            );
>>> PHP script returns empty $_POST.
>>> Maybe I am doing something wrong ?
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>