problems whit WFS POST and ProxyRedirector

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problems whit WFS POST and ProxyRedirector

italavera
Hi, again I have been getting problems with posting gml to retrieve features Types
when I send a GML http POST query (using WebServiceForm widget) I get this exception from my geoserver local.

<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows http://10.90.0.192:11080/geoserver/schemas/ows/1.0.0
/owsExceptionReport.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows">
  <ows:Exception exceptionCode="MissingParameterValue" locator="request">
    <ows:ExceptionText>Could not determine geoserver request
      from http request org.apache.catalina.connector.RequestFacade@8cbc51</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>
To determine the problem I followed this steps
1- download the mapbuilder
2-Create a dynamic Web Project with eclipse (moving source and content to webContent folder)
3- Deployed in tomcat and start it in debug mode.
While Debugging my app aplication I found this in ProxyRedirector class

line 147 httppost.setRequestBody(body);
line 148 if (0 == httppost.getParameters().length && !hasXmlContentType(request)){
            log.debug("No Name/Value pairs found ... pushing as raw_post_data");
            httppost.setParameter("raw_post_data", body);
        }

In my app I have WebServiceForm widget with a wfs_GetFeature.xsl that generate post data without http Parameters
so lines 147 and 148 are executed. So the body request (GML sepecifing a query) is duplicated in body and as a parameter in the httpPost,method.
To solve the problem I have modified the code as following

line 148    if (0 == httppost.getParameters().length && !hasXmlContentType(request)){
            log.debug("No Name/Value pairs found ... pushing as raw_post_data");
            httppost.setParameter("raw_post_data", body);
        }

private boolean hasXmlContentType(HttpServletRequest request) {
    // TODO Auto-generated method stub
    String [] splitted = request.getHeader("content-type").split("xml");
    return splitted!=null && splitted.length>0;
}

I ask if the body has a xml request if so, I didn't duplicate it in a the raw_data parameter request.
I have attached the new file, and hope have fixed a new bug :D.

Regards
Nacho
PD:Sorry about my horrible english :D






-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

ProxyRedirect.java (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problems whit WFS POST and ProxyRedirector

Andreas Hocevar
Hi,

I suspect you used a wfs url like http://yourhost/geoserver instead of
http://yourhost/geoserver/wfs. Please check if this is the case.

Regards,
Andreas.

On Mon, Jul 28, 2008 at 5:56 PM, Ignacio Talavera
<[hidden email]> wrote:

> Hi, again I have been getting problems with posting gml to retrieve features
> Types
> when I send a GML http POST query (using WebServiceForm widget) I get this
> exception from my geoserver local.
>
> <ows:ExceptionReport version="1.0.0"
>
>   xsi:schemaLocation="http://www.opengis.net/ows
> http://10.90.0.192:11080/geoserver/schemas/ows/1.0.0
>
> /owsExceptionReport.xsd"
>
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ows="http://www.opengis.net/ows">
>
>   <ows:Exception exceptionCode="MissingParameterValue" locator="request">
>
>     <ows:ExceptionText>Could not determine geoserver request
>
>       from http request
> org.apache.catalina.connector.RequestFacade@8cbc51</ows:ExceptionText>
>
>   </ows:Exception>
>
> </ows:ExceptionReport>
>
> To determine the problem I followed this steps
> 1- download the mapbuilder
> 2-Create a dynamic Web Project with eclipse (moving source and content to
> webContent folder)
> 3- Deployed in tomcat and start it in debug mode.
> While Debugging my app aplication I found this in ProxyRedirector class
>
> line 147 httppost.setRequestBody(body);
> line 148 if (0 == httppost.getParameters().length &&
> !hasXmlContentType(request)){
>             log.debug("No Name/Value pairs found ... pushing as
> raw_post_data");
>             httppost.setParameter("raw_post_data", body);
>         }
>
> In my app I have WebServiceForm widget with a wfs_GetFeature.xsl that
> generate post data without http Parameters
> so lines 147 and 148 are executed. So the body request (GML sepecifing a
> query) is duplicated in body and as a parameter in the httpPost,method.
> To solve the problem I have modified the code as following
>
> line 148    if (0 == httppost.getParameters().length &&
> !hasXmlContentType(request)){
>             log.debug("No Name/Value pairs found ... pushing as
> raw_post_data");
>             httppost.setParameter("raw_post_data", body);
>         }
>
> private boolean hasXmlContentType(HttpServletRequest request) {
>     // TODO Auto-generated method stub
>     String [] splitted = request.getHeader("content-type").split("xml");
>     return splitted!=null && splitted.length>0;
> }
>
> I ask if the body has a xml request if so, I didn't duplicate it in a the
> raw_data parameter request.
> I have attached the new file, and hope have fixed a new bug :D.
>
> Regards
> Nacho
> PD:Sorry about my horrible english :D
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Mapbuilder-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mapbuilder-users
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users
Reply | Threaded
Open this post in threaded view
|

Re: problems whit WFS POST and ProxyRedirector

italavera
No you're wrong I  used http://yourhost/geoserver/wfs. :(

On Mon, Jul 28, 2008 at 2:02 PM, Andreas Hocevar <[hidden email]> wrote:
Hi,

I suspect you used a wfs url like http://yourhost/geoserver instead of
http://yourhost/geoserver/wfs. Please check if this is the case.

Regards,
Andreas.

On Mon, Jul 28, 2008 at 5:56 PM, Ignacio Talavera
<[hidden email]> wrote:
> Hi, again I have been getting problems with posting gml to retrieve features
> Types
> when I send a GML http POST query (using WebServiceForm widget) I get this
> exception from my geoserver local.
>
> <ows:ExceptionReport version="1.0.0"
>
>   xsi:schemaLocation="http://www.opengis.net/ows
> http://10.90.0.192:11080/geoserver/schemas/ows/1.0.0
>
> /owsExceptionReport.xsd"
>
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ows="http://www.opengis.net/ows">
>
>   <ows:Exception exceptionCode="MissingParameterValue" locator="request">
>
>     <ows:ExceptionText>Could not determine geoserver request
>
>       from http request
> org.apache.catalina.connector.RequestFacade@8cbc51</ows:ExceptionText>
>
>   </ows:Exception>
>
> </ows:ExceptionReport>
>
> To determine the problem I followed this steps
> 1- download the mapbuilder
> 2-Create a dynamic Web Project with eclipse (moving source and content to
> webContent folder)
> 3- Deployed in tomcat and start it in debug mode.
> While Debugging my app aplication I found this in ProxyRedirector class
>
> line 147 httppost.setRequestBody(body);
> line 148 if (0 == httppost.getParameters().length &&
> !hasXmlContentType(request)){
>             log.debug("No Name/Value pairs found ... pushing as
> raw_post_data");
>             httppost.setParameter("raw_post_data", body);
>         }
>
> In my app I have WebServiceForm widget with a wfs_GetFeature.xsl that
> generate post data without http Parameters
> so lines 147 and 148 are executed. So the body request (GML sepecifing a
> query) is duplicated in body and as a parameter in the httpPost,method.
> To solve the problem I have modified the code as following
>
> line 148    if (0 == httppost.getParameters().length &&
> !hasXmlContentType(request)){
>             log.debug("No Name/Value pairs found ... pushing as
> raw_post_data");
>             httppost.setParameter("raw_post_data", body);
>         }
>
> private boolean hasXmlContentType(HttpServletRequest request) {
>     // TODO Auto-generated method stub
>     String [] splitted = request.getHeader("content-type").split("xml");
>     return splitted!=null && splitted.length>0;
> }
>
> I ask if the body has a xml request if so, I didn't duplicate it in a the
> raw_data parameter request.
> I have attached the new file, and hope have fixed a new bug :D.
>
> Regards
> Nacho
> PD:Sorry about my horrible english :D
>
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Mapbuilder-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mapbuilder-users
>
>


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mapbuilder-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users