RC2 breaks my application

20 views
Skip to first unread message

Alexandre

unread,
Sep 14, 2009, 5:04:31 PM9/14/09
to play-framework
I updated my Play version to RC2 and this breaks the application that
I'm developping.
I have the same problem with play-1.0-RC-r581

I send this

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://
www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query
typeName="feature:poi" xmlns:feature="http://www.3v2.net/
guia"><ogc:Filter xmlns:ogc="http://www.opengis.net/
ogc"><ogc:And><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id</
ogc:PropertyName><ogc:Literal>2</ogc:Literal></ogc:PropertyIsEqualTo></
ogc:Or><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Box
xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:
23031"><gml:coordinates decimal="." cs="," ts="
">475634.1700138,4643167.1289068 489265.4959862,4650392.0138944</
gml:coordinates></gml:Box></ogc:BBOX></ogc:And></ogc:Filter></
wfs:Query></wfs:GetFeature>

via post

and the script is:


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import play.Play;
import play.libs.WS;
import play.mvc.Controller;
import play.mvc.results.Forbidden;
import utils.MyRenderJson;

/**
* Controlador per demanar informació a wms
*
* @author abusquets
*
*/
public class Proxy extends Controller {

/**
* Acció per defecte
*
* @param url, url que volem
*/
public static void index(String url) {

boolean allowed = false;

String proxyHostsAdmesos = Play.configuration.getProperty
("proxyHostsAdmesos");

String[] stokens = url.split("/");
if (stokens.length >= 2) {
if (proxyHostsAdmesos.toLowerCase().contains(stokens[2].toLowerCase
())) {
allowed = true;
}
}

if (!allowed) {
throw new Forbidden("Access denied");
} else {
String html = "";

if (request.method.equals("POST")) {

InputStream a = request.body;

BufferedReader reader = new BufferedReader(new InputStreamReader
(a));
StringBuilder sb = new StringBuilder();

String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
a.close();
} catch (IOException e) {
e.printStackTrace();
}
}
html = WS.url(url).body(sb.toString()).mimeType("text/xml;
charset=utf-8").post().getString();
} else {
html = WS.url(url).get().getString();
}

MyRenderJson newRender = new MyRenderJson(html);
newRender.apply(request, response);

}
}

}

Guillaume Bort

unread,
Sep 15, 2009, 4:46:23 AM9/15/09
to play-fr...@googlegroups.com, play-framework
And what is the problem exactly ?

Alexandre

unread,
Sep 16, 2009, 5:25:25 PM9/16/09
to play-framework
I can not find the error, the body string sended by WS class is equals
in rc1 and rc2.
I solved the problem replacing

html = WS.url(url).body(sb.toString()).mimeType("text/xml;
charset=utf-8").post().getString();

for this

HttpClient client = new HttpClient();
PostMethod method = new PostMethod(url);
method.setRequestBody(body);
method.setRequestHeader("Content-type", "text/xml; charset=utf-8");

client.executeMethod(method);
html = method.getResponseBodyAsString();
method.releaseConnection();





On 15 Set, 10:46, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> And what is the problem exactly ?
>
> On 14 sept. 2009, at 23:04, Alexandre <abusqu...@gmail.com> wrote:
>
>
>
> > I updated my Play version to RC2 and this breaks the application that
> > I'm developping.
> > I have the same problem with play-1.0-RC-r581
>
> > I send this
>
> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> > version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://
> >www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd

Guillaume Bort

unread,
Sep 17, 2009, 4:12:23 AM9/17/09
to play-fr...@googlegroups.com
Does the URL contains a QueryString ? If so I found a bug about that.

Alexandre

unread,
Sep 17, 2009, 4:42:48 AM9/17/09
to play-framework
The url is http://myserver/geoserver/wfs


On 17 Set, 10:12, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Does the URL contains a QueryString ? If so I found a bug about that.
>
> On 16 sept. 2009, at 23:25, Alexandre <abusqu...@gmail.com> wrote:
>
>
>
> > I can not find the error, the body string sended by WS class is equals
> > in rc1 and rc2.
> > I solved the problem replacing
>
> > html = WS.url(url).body(sb.toString()).mimeType("text/xml;
> > charset=utf-8").post().getString();
>
> > for this
>
> > HttpClient client = new HttpClient();
> > PostMethod method = new PostMethod(url);
> > method.setRequestBody(body);
> > method.setRequestHeader("Content-type", "text/xml; charset=utf-8");
>
> > client.executeMethod(method);
> > html = method.getResponseBodyAsString();
> > method.releaseConnection();
>
> > On 15 Set, 10:46, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> >> And what is the problem exactly ?
>
> >> On 14 sept. 2009, at 23:04, Alexandre <abusqu...@gmail.com> wrote:
>
> >>> I updated my Play version to RC2 and this breaks the application  
> >>> that
> >>> I'm developping.
> >>> I have the same problem with play-1.0-RC-r581
>
> >>> I send this
>
> >>> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> >>> version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://
> >>>www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transacti...

Alexandre

unread,
Sep 17, 2009, 5:52:32 AM9/17/09
to play-framework
The finality of my proxy class is send this xml code

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://
www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query
typeName="feature:poi" xmlns:feature="http://www.3v2.net/
guia"><ogc:Filter xmlns:ogc="http://www.opengis.net/
ogc"><ogc:And><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id</
ogc:PropertyName><ogc:Literal>1</ogc:Literal></
ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id</
ogc:PropertyName><ogc:Literal>2</ogc:Literal></
ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id</
ogc:PropertyName><ogc:Literal>7</ogc:Literal></
ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id</
ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo></
ogc:Or><ogc:BBOX><ogc:PropertyName>the_geom</ogc:PropertyName><gml:Box
xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:
23031"><gml:coordinates decimal="." cs="," ts="
">474110.17083676,4643167.1289068 490789.49516324,4650392.0138944</
gml:coordinates></gml:Box></ogc:BBOX></ogc:And></ogc:Filter></
wfs:Query></wfs:GetFeature>

to

http://guia.3v2.net/geoserver/wfs

I have a receiver script to capture raw post (body) and the body code
sended for WS is equals for rc1 and rc2.





On 17 Set, 10:12, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Does the URL contains a QueryString ? If so I found a bug about that.
>
> On 16 sept. 2009, at 23:25, Alexandre <abusqu...@gmail.com> wrote:
>
>
>
> > I can not find the error, the body string sended by WS class is equals
> > in rc1 and rc2.
> > I solved the problem replacing
>
> > html = WS.url(url).body(sb.toString()).mimeType("text/xml;
> > charset=utf-8").post().getString();
>
> > for this
>
> > HttpClient client = new HttpClient();
> > PostMethod method = new PostMethod(url);
> > method.setRequestBody(body);
> > method.setRequestHeader("Content-type", "text/xml; charset=utf-8");
>
> > client.executeMethod(method);
> > html = method.getResponseBodyAsString();
> > method.releaseConnection();
>
> > On 15 Set, 10:46, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> >> And what is the problem exactly ?
>
> >> On 14 sept. 2009, at 23:04, Alexandre <abusqu...@gmail.com> wrote:
>
> >>> I updated my Play version to RC2 and this breaks the application  
> >>> that
> >>> I'm developping.
> >>> I have the same problem with play-1.0-RC-r581
>
> >>> I send this
>
> >>> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> >>> version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://
> >>>www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transacti...

guillaume

unread,
Sep 18, 2009, 9:09:05 AM9/18/09
to play-framework
Well I think I found the problem, related to the body(String ...)
method. Can you try with the latest version ?

Thank a lot.

On Sep 17, 11:52 am, Alexandre <abusqu...@gmail.com> wrote:
> The finality of my proxy class is send this xml code
>
> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"

Alexandre

unread,
Sep 29, 2009, 12:28:50 PM9/29/09
to play-framework
Hi Guillaume,

Sorry for late reply, but a few days ago I had a baby.

I have upgraded the Play version and now works correctly.


On 18 Set, 15:09, guillaume <guillaume.b...@gmail.com> wrote:
> Well I think I found the problem, related to the body(String ...)
> method. Can you try with the latest version ?
>
> Thank a lot.
>
> On Sep 17, 11:52 am, Alexandre <abusqu...@gmail.com> wrote:
>
> > The finality of my proxy class is send this xml code
>
> > <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
> > version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-tr..."

Guillaume Bort

unread,
Sep 29, 2009, 2:28:17 PM9/29/09
to play-fr...@googlegroups.com
Ok fine.
Thanks.

On 29 sept. 2009, at 18:28, Alexandre <abus...@gmail.com> wrote:

>
> Hi Guillaume,
>
> Sorry for late reply, but a few days ago I had a baby.
>
> I have upgraded the Play version and now works correctly.
>
>
> On 18 Set, 15:09, guillaume <guillaume.b...@gmail.com> wrote:
>> Well I think I found the problem, related to the body(String ...)
>> method. Can you try with the latest version ?
>>
>> Thank a lot.
>>
>> On Sep 17, 11:52 am, Alexandre <abusqu...@gmail.com> wrote:
>>
>>> The finality of my proxy class is send this xml code
>>
>>> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
>>> version="1.0.0" outputFormat="JSON" xsi:schemaLocation="http://www.opengis.net/wfshttp://schemas.opengis.net/wfs/1.0.0/WFS-tr
>>> ..."
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Query
>>> typeName="feature:poi" xmlns:feature="http://www.3v2.net/
>>> guia"><ogc:Filter xmlns:ogc="http://www.opengis.net/
>>> ogc"
>>> ><o
>>> gc:And>
>>> <ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id </
>>> ogc:PropertyName><ogc:Literal>1</ogc:Literal></
>>> ogc:PropertyIsEqualTo>
>>> <ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id </
>>> ogc:PropertyName><ogc:Literal>2</ogc:Literal></
>>> ogc:PropertyIsEqualTo>
>>> <ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id </
>>> ogc:PropertyName><ogc:Literal>7</ogc:Literal></
>>> ogc:PropertyIsEqualTo>
>>> <ogc:PropertyIsEqualTo><ogc:PropertyName>categoria_id </
>>> ogc:PropertyName><ogc:Literal>3</ogc:Literal></
>>> ogc:PropertyIsEqualTo></
>>> ogc:Or><ogc:BBOX><ogc:PropertyName>the_geom</
>>> ogc:PropertyName><gml:Box
>>> xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:
>>> 23031"><gml:coordinates decimal="." cs="," ts="
Reply all
Reply to author
Forward
0 new messages