Ticket #85 (new defect)
Wrong values assigned to optional input parameters
Reported by: | Knut Landmark | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | zoo-kernel | Version: | |
Keywords: | Cc: |
Description (last modified by djay) (diff)
In the attached example (Example.zcfg and example.cpp), there are three input parameters: optional_complex_type, optional_literal, and mandatory_literal (default: "mandatory_literal_default"). The parameter optional_literal does not have a default value, as this is not required for LiteralData? according to the OGC WPS specification. The example code simply dumps the content of each corresponding input map to file.
The request
service=WPS&version=1&request=Execute&Identifier=Example&DataInputs=mandatory_literal=example&ResponseDocument=Dummy@mimeType=text/xml&storeExecuteResponse=true&status=false
(no optional data given, and status=false) yields the following input maps:
[optional_literal] minOccurs = 0 maxOccurs = 1 DataType = string value = mandatory_literal_default inRequest = false
[optional_complex_type] minOccurs = 0 maxOccurs = 1 mimeType = text/xml encoding = UTF-8 inRequest = false value = NULL
[mandatory_literal] value = example
Note: Here optional_literal has been assigned the default value for mandatory_literal.
Running the above request with status=true instead yields the following input maps:
[optional_literal] value = 0 DataType = string minOccurs = 0 maxOccurs = 0 inRequest = true
[optional_complex_type] value = 0 mimeType = text/xml encoding = UTF-8 minOccurs = 0 maxOccurs = 0 inRequest = true
[mandatory_literal] value = example
Note: Here optional_literal and optional_complex_type both have the attribute inRequest=true although they are not included in the request, and both have been assigned the value "0".
These tests were performed on a Windows 7 system. The behavior in the second case (status=true) may be Windows-specific, but it may also be related to this ticket: http://zoo-project.org/trac/ticket/75. There should be a safe way to determine whether an optional parameter is in the request or not.