WPS
WPS copied to clipboard
URL decoder swallows up "+" character in test client
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>