public bool Parse(ProcessDescription processDescription) { string responseDocumentParam = Utils.DecodeURI(Utils.GetParameter("ResponseDocument")); string rawDataOutputParam = Utils.DecodeURI(Utils.GetParameter("RawDataOutput")); if (!String.IsNullOrEmpty(responseDocumentParam)) { if (!String.IsNullOrEmpty(rawDataOutputParam)) { throw new ExceptionReport("Only one kind of ResponseForm is allowed, but ResponseDocument and RawDataOutput were found!", ExceptionCode.InvalidParameterValue, "ResponseForm"); } responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.lineage = Boolean.Parse(Utils.GetParameter("lineage", "false")); responseDocument.status = Boolean.Parse(Utils.GetParameter("status", "false")); responseDocument.storeExecuteResponse = Boolean.Parse(Utils.GetParameter("storeExecuteResponse", "false")); responseDocument.Parse(responseDocumentParam, processDescription); } else if (!String.IsNullOrEmpty(rawDataOutputParam)) { outputDefinition = new OutputDefinitionType("wps:RawDataOutput"); outputDefinition.Parse(rawDataOutputParam, processDescription); } else { // include all responses because no requested identifier was provided responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.Outputs.AddRange(processDescription.GetProcessOutputParameters()); responseDocument.lineage = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("lineage", "false"))); responseDocument.status = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("status", "false"))); responseDocument.storeExecuteResponse = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("storeExecuteResponse", "false"))); } return(true); }
public override bool Parse(XmlNode node, ProcessDescription processDescription) { if (node == null) { // include all responses because no requested identifier was provided responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.Outputs.AddRange(processDescription.GetProcessOutputParameters()); return(true); } // Create an XmlNamespaceManager for resolving namespaces. XmlNamespaceManager nsmgr = Utils.CreateWPSNamespaceManager(node.OwnerDocument); XmlNode rawDataOutputNode = node.SelectSingleNode("wps:RawDataOutput", nsmgr); XmlNode responseDocNode = node.SelectSingleNode("wps:ResponseDocument", nsmgr); if (responseDocNode != null) { if (rawDataOutputNode != null) { throw new ExceptionReport("Only one kind of ResponseForm is allowed, but ResponseDocument and RawDataOutput were found!", ExceptionCode.InvalidParameterValue, "ResponseForm"); } responseDocument = new ResponseDocumentType("wps:ResponseDocument"); return(responseDocument.Parse(responseDocNode, processDescription)); } else if (rawDataOutputNode != null) { outputDefinition = new OutputDefinitionType("wps:RawDataOutput"); return(outputDefinition.Parse(rawDataOutputNode, processDescription)); } else { throw new ExceptionReport("A ResponseForm is provided, but neither ResponseDocument nor RawDataOutput element was found!", ExceptionCode.MissingParameterValue, "wps:ResponseForm"); } }
public bool Parse(ProcessDescription processDescription) { string responseDocumentParam = Utils.DecodeURI(Utils.GetParameter("ResponseDocument")); string rawDataOutputParam = Utils.DecodeURI(Utils.GetParameter("RawDataOutput")); if (!String.IsNullOrEmpty(responseDocumentParam)) { if (!String.IsNullOrEmpty(rawDataOutputParam)) throw new ExceptionReport("Only one kind of ResponseForm is allowed, but ResponseDocument and RawDataOutput were found!", ExceptionCode.InvalidParameterValue, "ResponseForm"); responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.lineage = Boolean.Parse(Utils.GetParameter("lineage", "false")); responseDocument.status = Boolean.Parse(Utils.GetParameter("status", "false")); responseDocument.storeExecuteResponse = Boolean.Parse(Utils.GetParameter("storeExecuteResponse", "false")); responseDocument.Parse(responseDocumentParam, processDescription); } else if (!String.IsNullOrEmpty(rawDataOutputParam)) { outputDefinition = new OutputDefinitionType("wps:RawDataOutput"); outputDefinition.Parse(rawDataOutputParam, processDescription); } else { // include all responses because no requested identifier was provided responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.Outputs.AddRange(processDescription.GetProcessOutputParameters()); responseDocument.lineage = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("lineage", "false"))); responseDocument.status = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("status", "false"))); responseDocument.storeExecuteResponse = Boolean.Parse(Utils.DecodeURI(Utils.GetParameter("storeExecuteResponse", "false"))); } return true; }
public override bool Parse(XmlNode node, ProcessDescription processDescription) { if (node == null) { // include all responses because no requested identifier was provided responseDocument = new ResponseDocumentType("wps:ResponseDocument"); responseDocument.Outputs.AddRange(processDescription.GetProcessOutputParameters()); return true; } // Create an XmlNamespaceManager for resolving namespaces. XmlNamespaceManager nsmgr = Utils.CreateWPSNamespaceManager(node.OwnerDocument); XmlNode rawDataOutputNode = node.SelectSingleNode("wps:RawDataOutput", nsmgr); XmlNode responseDocNode = node.SelectSingleNode("wps:ResponseDocument", nsmgr); if (responseDocNode != null) { if (rawDataOutputNode != null) throw new ExceptionReport("Only one kind of ResponseForm is allowed, but ResponseDocument and RawDataOutput were found!", ExceptionCode.InvalidParameterValue, "ResponseForm"); responseDocument = new ResponseDocumentType("wps:ResponseDocument"); return responseDocument.Parse(responseDocNode, processDescription); } else if (rawDataOutputNode != null) { outputDefinition = new OutputDefinitionType("wps:RawDataOutput"); return outputDefinition.Parse(rawDataOutputNode, processDescription); } else throw new ExceptionReport("A ResponseForm is provided, but neither ResponseDocument nor RawDataOutput element was found!", ExceptionCode.MissingParameterValue, "wps:ResponseForm"); }