52North / WPS

**DEPRECATED** The 52°North Web Processing Service enables the deployment of geo-processes on the web in a standardized way.
GNU General Public License v2.0
63 stars 55 forks source link

URL decoder swallows up "+" character in test client #147

Open nuest opened 10 years ago

nuest commented 10 years ago

Sending the request below with the R calculator process, the + as a value of op disappears after URLDecoder.decode(documentString, characterEncoding); in https://github.com/52North/WPS/blob/feature/spring-new-admin-app/52n-wps-server/src/main/java/org/n52/wps/server/WebProcessingService.java#L339

This error appears with the test client that uses application/x-www-form-urlencoded!

Solution: The test client should use the content type header for XML, e.g. text/xml.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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>org.n52.wps.server.r.test.calculator</ows:Identifier>
  <wps:DataInputs>
    <wps:Input>
      <ows:Identifier>a</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>10</wps:LiteralData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>b</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>10</wps:LiteralData>
      </wps:Data>
    </wps:Input>
    <wps:Input>
      <ows:Identifier>op</ows:Identifier>
      <wps:Data>
        <wps:LiteralData>+</wps:LiteralData>
      </wps:Data>
    </wps:Input>
  </wps:DataInputs>
  <wps:ResponseForm>
    <wps:ResponseDocument storeExecuteResponse="false">
      <wps:Output asReference="false">
        <ows:Identifier>result</ows:Identifier>
      </wps:Output>
      <wps:Output>
        <ows:Identifier>sessionInfo</ows:Identifier>
      </wps:Output>
      <wps:Output>
        <ows:Identifier>warnings</ows:Identifier>
      </wps:Output>
    </wps:ResponseDocument>
  </wps:ResponseForm>
</wps:Execute>

​