[Pywps-commits] r1052 - branches/pywps-3.2-soap/pywps/XSLT
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Nov 4 16:35:07 CET 2010
Author: jesus
Date: 2010-11-04 16:35:06 +0100 (Thu, 04 Nov 2010)
New Revision: 1052
Modified:
branches/pywps-3.2-soap/pywps/XSLT/SOAP2WPS.xsl
branches/pywps-3.2-soap/pywps/XSLT/WPS2SOAP.xsl
branches/pywps-3.2-soap/pywps/XSLT/describeProcess2WSDL.xsl
Log:
Async support. XSLT file split into smaller templates
Modified: branches/pywps-3.2-soap/pywps/XSLT/SOAP2WPS.xsl
===================================================================
--- branches/pywps-3.2-soap/pywps/XSLT/SOAP2WPS.xsl 2010-11-04 15:34:16 UTC (rev 1051)
+++ branches/pywps-3.2-soap/pywps/XSLT/SOAP2WPS.xsl 2010-11-04 15:35:06 UTC (rev 1052)
@@ -1,16 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1">
<xsl:template match="/">
<!-- Determine the Execute process id -->
<!-- It gets the root element and passed the string after ExecuteProcess-->
- <!-- PROBLEM: Namespaces in the WPS:Execute aren't passed to ComplexData (mainly OWS and WPS) -->
- <!-- 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" -->
- <!-- xmlns:ows="http://www.opengis.net/ows/1.1" -->
- <!-- xmlns:wps="http://www.opengis.net/wps/1.0.0" -->
- <xsl:variable name="processID" select="substring-after(name(./*),'ExecuteProcess_')"/>
+
+ <!-- Check if its sync or async -->
+
+ <xsl:variable name="async" select="boolean(contains(name(./*),'Async'))"/>
+
+
+ <xsl:variable name="processID" select="substring-after(name(./*),'_')"/>
+ <!-- default HTTP method -->
<xsl:variable name="HTTP_METHOD">GET</xsl:variable>
- <wps:Execute xmlns:ows="http://REPLACEME/ows/1.1" xmlns:wps="http://REPLACEME/wps/1.0.0" service="WPS" version="1.0.0">
+ <!-- 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" -->
+ <!-- -->
+
+ <!-- Execute element -->
+ <xsl:element name="Execute" namespace="http://www.opengis.net/wps/1.0.0">
+ <xsl:copy-of select="document('')/xsl:stylesheet/namespace::*[name()!='xsl']"/>
+ <xsl:attribute name="service"><xsl:value-of select="'WPS'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="version"><xsl:value-of select="'1.0.0'"></xsl:value-of></xsl:attribute>
+
+
+ <!-- <wps:Execute xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:wps="http://www.opengis.net/wps/1.0.0" service="WPS" version="1.0.0" > -->
<ows:Identifier>
<xsl:value-of select="$processID"/>
</ows:Identifier>
@@ -27,12 +40,12 @@
</ows:Identifier>
<wps:Data>
<wps:ComplexData>
- <!--embedded XML begins here.-->
+
+ <xsl:copy-of select="./*"/>
+
+
+ <!--embedded XML begins here.xsl:copy-of select=".*" /-->
- <xsl:copy-of select="./*" />
-
-
-
<!--embedded XML ends here.-->
</wps:ComplexData>
</wps:Data>
@@ -78,10 +91,21 @@
</xsl:for-each>
</wps:DataInputs>
<wps:ResponseForm>
- <wps:ResponseDocument lineage="false">
- </wps:ResponseDocument>
+ <!-- Response document either sync or async -->
+ <xsl:element name="ResponseDocument">
+ <xsl:attribute name="lineage"><xsl:value-of select="'false'"></xsl:value-of></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$async">
+ <xsl:attribute name="storeExecuteResponse"><xsl:value-of select="'true'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="status"><xsl:value-of select="'true'"></xsl:value-of></xsl:attribute>
+ </xsl:when><xsl:otherwise>
+ <xsl:attribute name="storeExecuteResponse"><xsl:value-of select="'false'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="status"><xsl:value-of select="'false'"></xsl:value-of></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element> <!-- end of response document -->
+
</wps:ResponseForm>
- </wps:Execute>
+ </xsl:element><!-- End of execute element -->
</xsl:template>
-
</xsl:stylesheet>
\ No newline at end of file
Modified: branches/pywps-3.2-soap/pywps/XSLT/WPS2SOAP.xsl
===================================================================
--- branches/pywps-3.2-soap/pywps/XSLT/WPS2SOAP.xsl 2010-11-04 15:34:16 UTC (rev 1051)
+++ branches/pywps-3.2-soap/pywps/XSLT/WPS2SOAP.xsl 2010-11-04 15:35:06 UTC (rev 1052)
@@ -1,10 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
- <!-- Getting Identifier and concerning it -->
- <xsl:variable name="identifier" select="//*[local-name() = 'Identifier']"/>
- <xsl:variable name="identifierSOAP" select="concat('ExecuteProcess_',$identifier,'Response')"/>
- <xsl:value-of select="$identifierSOAP"></xsl:value-of>
+
+ <!-- Either the response is a processAccepted (async) or ProcessSucceeded (sync or final result from async) -->
+ <!-- <wps:ProcessAccepted> then we have an async call -->
+ <xsl:variable name="async" select="boolean(//*[local-name()='ProcessAccepted'])"/>
+
+ <xsl:variable name="identifier" select="//*[local-name() = 'Identifier']"/>
+<xsl:variable name="identifierSOAP">
+ <xsl:choose>
+ <xsl:when test="$async">
+ <xsl:value-of select="concat('ExecuteProcessAsync_',$identifier,'Response')"></xsl:value-of>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ExecuteProcess_',$identifier,'Response')"></xsl:value-of></xsl:otherwise>
+ </xsl:choose>
+</xsl:variable>
+
<xsl:element name="{$identifierSOAP}">
+
+ <xsl:choose>
+ <xsl:when test="$async">
+ <!-- statusURL reply -->
+ <xsl:element name="statusURLResult"><xsl:value-of select="//*[local-name()='ExecuteResponse']/@statusLocation"></xsl:value-of></xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:for-each select="//*[local-name()='Output']">
<xsl:choose>
@@ -19,7 +40,7 @@
<xsl:when test="./*/*/*">
<xsl:element name="{$complexIdentifier}"><xsl:copy-of select="./*/*/*" /></xsl:element>
</xsl:when>
- <xsl:otherwise test="./*/*/text()">
+ <xsl:otherwise>
<xsl:element name="{$complexIdentifier}"><xsl:value-of select="./*/*/text()" /></xsl:element>
</xsl:otherwise>
</xsl:choose> <!-- End of complexData type choose -->
@@ -28,6 +49,8 @@
</xsl:choose> <!-- end of literal complexdata choose -->
</xsl:for-each> <!-- end of Outoput output-->
+ </xsl:otherwise> <!-- end of sync option -->
+ </xsl:choose> <!-- end of async/sync choose -->
</xsl:element> <!-- end of ExecuteProcess_fooResponse -->
</xsl:template>
Modified: branches/pywps-3.2-soap/pywps/XSLT/describeProcess2WSDL.xsl
===================================================================
--- branches/pywps-3.2-soap/pywps/XSLT/describeProcess2WSDL.xsl 2010-11-04 15:34:16 UTC (rev 1051)
+++ branches/pywps-3.2-soap/pywps/XSLT/describeProcess2WSDL.xsl 2010-11-04 15:35:06 UTC (rev 1052)
@@ -20,7 +20,7 @@
<xsl:variable name="serverURL"><xsl:value-of select="'http://localhost/wps.cgi'"></xsl:value-of></xsl:variable>
<xsl:variable name="serverName"><xsl:value-of select="'PywpsServer'"></xsl:value-of></xsl:variable>
-->
-
+
<xsl:template match="/">
@@ -72,104 +72,23 @@
<!-- End of General WPS support -->
<!-- ExecuteProcess support -->
<!-- loop thru processes and set the xsd types -->
+
<xsl:for-each select="//*[local-name()='ProcessDescription']">
- <xsl:variable name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"></xsl:variable>
- <!-- Inputs -->
- <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema"><xsl:attribute name="targetNamespace"><xsl:value-of select="'http://www.opengis.net/wps/1.0.0'"></xsl:value-of></xsl:attribute>
- <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
-
- <xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
- <xsl:element name="complexType" namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:element name="sequence" namespace="http://www.w3.org/2001/XMLSchema">
- <!-- Getting the Input value: minOccurs, maxOccurs,Identifier, and datatype (LiteralData) from each input -->
- <xsl:for-each select="./*/*[local-name()='Input']">
- <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:attribute name="minOccurs"><xsl:value-of select="./@minOccurs"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="maxOccurs"><xsl:value-of select="./@maxOccurs"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="name"><xsl:value-of select="./*[local-name()='Identifier']"></xsl:value-of></xsl:attribute>
- <!-- If to fecth datatype, its not safe to use ows:reference better to get the element value -->
- <!-- If no dataType then we need to -->
-
- <xsl:if test="./*/*[local-name()='DataType']">
- <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
- </xsl:if>
-
-
-
-
-
- </xsl:element><!-- End of element inside sequence -->
-
- </xsl:for-each> <!-- end of Input loop -->
-
-
-
- </xsl:element><!-- End of sequence -->
-
- </xsl:element> <!-- End of complexType -->
-
- </xsl:element><!-- End of element ExecuteProcess Input definition -->
- </xsl:element><!-- End of xsd:schema End of inputs -->
- <!-- Outputs/Response -->
- <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema"><xsl:attribute name="targetNamespace"><xsl:value-of select="'http://www.opengis.net/wps/1.0.0'"></xsl:value-of></xsl:attribute>
- <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
- <!-- Using processID from above -->
- <xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
- <xsl:element name="complexType" namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:element name="sequence" namespace="http://www.w3.org/2001/XMLSchema">
- <!-- Getting the Ouput value: ,Identifier, and datatype (LiteralData) from each input -->
- <xsl:for-each select="./*/*[local-name()='Output']">
- <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
- <xsl:attribute name="name"><xsl:value-of select="concat(./*[local-name()='Identifier'],'Result')"></xsl:value-of></xsl:attribute>
- <!-- not certain if a default minOccurs and maxOccurs should be set -->
- <xsl:attribute name="minOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="maxOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
- <xsl:if test="./*/*[local-name()='DataType']">
- <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
- </xsl:if>
-
- <!-- <xsl:choose>
- <xsl:when test="./*/*[local-name()='DataType']">
- <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="type"><xsl:value-of select="'wps:anyXMLType'"></xsl:value-of></xsl:attribute>
-
- </xsl:otherwise>
-
- </xsl:choose>
- -->
-
-
- <xsl:if test="./*/*[local-name()='DataType']">
- <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
- </xsl:if>
-
- </xsl:element><!-- response result element -->
-
-
-
-
- </xsl:for-each> <!-- End of output loop -->
-
- </xsl:element> <!-- sequence element end -->
-
-
- </xsl:element> <!-- ComplexType end -->
- </xsl:element> <!-- End of elemement with process response name -->
-
- <!-- adding anyXMLType -->
- <!-- <complexType name="anyXMLType" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.opengis.net/wps/1.0.0">
- <sequence>
- <any namespace="##any" processContents="lax" minOccurs="1" maxOccurs="1"></any>
- </sequence>
- </complexType>-->
-
- </xsl:element><!-- End of xsd:schema End of output -->
-
-
-
-
+
+ <xsl:call-template name="typeDescribe">
+ <xsl:with-param name="async" select="false()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+
+
+ <xsl:if test="string(./@storeSupported)='true' and string(./@statusSupported)='true'">
+ <xsl:call-template name="typeDescribe">
+ <xsl:with-param name="async" select="true()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcessAsync_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+ </xsl:if>
+
+
</xsl:for-each><!-- End of DescribeProcess loop for types -->
</xsl:element> <!-- End of types element -->
@@ -211,19 +130,20 @@
<!-- Process loop to fetch name -->
<!-- Its better to do another loop than one giant loop with everythin -->
<xsl:for-each select="//*[local-name()='ProcessDescription']">
- <xsl:variable name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"></xsl:variable>
- <!-- request message -->
- <xsl:element name="message"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Request')"></xsl:value-of></xsl:attribute>
- <xsl:element name="part"><xsl:attribute name="name"><xsl:value-of select="'DataInputs'"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="element"><xsl:value-of select="concat('wps:',$processID)"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element>
+ <xsl:call-template name="messageDescribe">
+ <xsl:with-param name="async" select="false()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+
+
+ <xsl:if test="string(./@storeSupported)='true' and string(./@statusSupported)='true'">
+ <xsl:call-template name="messageDescribe">
+ <xsl:with-param name="async" select="true()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcessAsync_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+ </xsl:if>
- <!-- response message -->
- <xsl:element name="message"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
- <xsl:element name="part"><xsl:attribute name="name"><xsl:value-of select="'ProcessOutputs'"></xsl:value-of></xsl:attribute>
- <xsl:attribute name="element"><xsl:value-of select="concat('wps:',$processID,'Response')"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element>
</xsl:for-each> <!-- End of process description loop for message -->
@@ -251,15 +171,24 @@
</xsl:element><!-- end of operation -->
<!-- Processes operations -->
+
<xsl:for-each select="//*[local-name()='ProcessDescription']">
- <xsl:variable name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"></xsl:variable><!-- Note: variable only exist inside the loop -->
-
- <xsl:element name="operation"><xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
- <xsl:element name="input"><xsl:attribute name="message"><xsl:value-of select="concat('tns:',$processID,'Request')"></xsl:value-of></xsl:attribute></xsl:element>
- <xsl:element name="output"><xsl:attribute name="message"><xsl:value-of select="concat('tns:',$processID,'Response')"></xsl:value-of></xsl:attribute></xsl:element>
- <xsl:element name="fault"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute><xsl:attribute name="message"><xsl:value-of select="'tns:ExceptionResponse'"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element>
- </xsl:for-each>
+
+ <xsl:call-template name="operationDescribe">
+ <xsl:with-param name="async" select="false()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+
+ <xsl:if test="string(./@storeSupported)='true' and string(./@statusSupported)='true'">
+ <xsl:call-template name="operationDescribe">
+ <xsl:with-param name="async" select="true()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcessAsync_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+ </xsl:if>
+
+
+ </xsl:for-each>
+
<!-- end of operation -->
</xsl:element> <!-- End of portType -->
@@ -319,23 +248,21 @@
<!-- Loop for each operation -->
<xsl:for-each select="//*[local-name()='ProcessDescription']">
+
<xsl:variable name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"></xsl:variable><!-- Note: variable only exist inside the loop -->
- <xsl:element name="operation"><xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
- <xsl:element name="operation" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="soapAction"><xsl:value-of select="concat($serverURL,'/',$processID)"></xsl:value-of></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="'document'"></xsl:value-of></xsl:attribute></xsl:element>
-
- <xsl:element name="input"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Request')"></xsl:value-of></xsl:attribute>
- <xsl:element name="body" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element><!-- end input -->
-
- <xsl:element name="output"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
- <xsl:element name="body" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element><!-- end input -->
-
- <xsl:element name="fault"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute>
- <xsl:element name="fault" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
- </xsl:element><!-- end input -->
- </xsl:element><!-- end operation -->
+ <xsl:call-template name="bindingDescribe">
+ <xsl:with-param name="async" select="false()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcess_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+
+ <xsl:if test="string(./@storeSupported)='true' and string(./@statusSupported)='true'">
+ <xsl:call-template name="bindingDescribe">
+ <xsl:with-param name="async" select="true()" />
+ <xsl:with-param name="processID" select="concat('ExecuteProcessAsync_',./*[local-name()='Identifier'])"/>
+ </xsl:call-template>
+ </xsl:if>
+
</xsl:for-each> <!-- End of SOAP operation for each process -->
</xsl:element><!--End of binding -->
@@ -352,6 +279,171 @@
</xsl:element> <!-- end of service element -->
</xsl:element> <!-- End of definitions, end of WSDL -->
- <foo><xsl:value-of select="$serverName" /></foo>
+
</xsl:template>
+
+<!-- types ProcessDescription template-->
+
+<xsl:template name="typeDescribe" >
+<xsl:param name="async"/>
+<xsl:param name="processID"/>
+
+ <!-- Inputs -->
+
+
+ <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema"><xsl:attribute name="targetNamespace"><xsl:value-of select="'http://www.opengis.net/wps/1.0.0'"></xsl:value-of></xsl:attribute>
+ <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+
+ <xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
+ <xsl:element name="complexType" namespace="http://www.w3.org/2001/XMLSchema">
+ <xsl:element name="sequence" namespace="http://www.w3.org/2001/XMLSchema">
+ <!-- Getting the Input value: minOccurs, maxOccurs,Identifier, and datatype (LiteralData) from each input -->
+ <xsl:for-each select="./*/*[local-name()='Input']">
+ <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+ <xsl:attribute name="minOccurs"><xsl:value-of select="./@minOccurs"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="maxOccurs"><xsl:value-of select="./@maxOccurs"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="name"><xsl:value-of select="./*[local-name()='Identifier']"></xsl:value-of></xsl:attribute>
+ <!-- If to fecth datatype, its not safe to use ows:reference better to get the element value -->
+ <!-- If no dataType then we need to -->
+
+ <xsl:if test="./*/*[local-name()='DataType']">
+ <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
+ </xsl:if>
+
+ </xsl:element><!-- End of element inside sequence -->
+ </xsl:for-each> <!-- end of Input loop -->
+
+ </xsl:element><!-- End of sequence -->
+
+ </xsl:element> <!-- End of complexType -->
+
+ </xsl:element><!-- End of element ExecuteProcess Input definition -->
+ </xsl:element><!-- End of xsd:schema End of inputs -->
+
+ <!-- Outputs/Response -->
+ <xsl:element name="schema" namespace="http://www.w3.org/2001/XMLSchema"><xsl:attribute name="targetNamespace"><xsl:value-of select="'http://www.opengis.net/wps/1.0.0'"></xsl:value-of></xsl:attribute>
+ <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+ <!-- Using processID from above -->
+ <xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
+ <xsl:element name="complexType" namespace="http://www.w3.org/2001/XMLSchema">
+ <xsl:element name="sequence" namespace="http://www.w3.org/2001/XMLSchema">
+
+
+ <!-- Getting the Ouput value: ,Identifier, and datatype (LiteralData) from each input -->
+ <!-- If we have ascyn process then there is only one result -->
+ <xsl:choose>
+ <xsl:when test="$async">
+ <!-- Element supporting URL -->
+ <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+ <xsl:attribute name="name"><xsl:value-of select="'statusURLResult'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="minOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="maxOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:for-each select="./*/*[local-name()='Output']">
+ <xsl:element name="element" namespace="http://www.w3.org/2001/XMLSchema">
+ <xsl:attribute name="name"><xsl:value-of select="concat(./*[local-name()='Identifier'],'Result')"></xsl:value-of></xsl:attribute>
+ <!-- not certain if a default minOccurs and maxOccurs should be set -->
+ <xsl:attribute name="minOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="maxOccurs"><xsl:value-of select="'1'"></xsl:value-of></xsl:attribute>
+ <xsl:if test="./*/*[local-name()='DataType']">
+ <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
+ </xsl:if>
+
+ <!-- <xsl:choose>
+ <xsl:when test="./*/*[local-name()='DataType']">
+ <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="type"><xsl:value-of select="'wps:anyXMLType'"></xsl:value-of></xsl:attribute>
+
+ </xsl:otherwise>
+
+ </xsl:choose>
+ -->
+
+
+ <xsl:if test="./*/*[local-name()='DataType']">
+ <xsl:attribute name="type"><xsl:value-of select="concat('xsd:',./*/*[local-name()='DataType'])"></xsl:value-of></xsl:attribute>
+ </xsl:if>
+
+ </xsl:element><!-- response result element -->
+
+
+
+
+ </xsl:for-each> <!-- End of output loop -->
+ </xsl:otherwise> <!-- End of sync reponse from choose -->
+ </xsl:choose> <!-- end of Async or sync output -->
+
+
+ </xsl:element> <!-- sequence element end -->
+
+
+ </xsl:element> <!-- ComplexType end -->
+ </xsl:element> <!-- End of elemement with process response name -->
+
+ <!-- adding anyXMLType -->
+ <!-- <complexType name="anyXMLType" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.opengis.net/wps/1.0.0">
+ <sequence>
+ <any namespace="##any" processContents="lax" minOccurs="1" maxOccurs="1"></any>
+ </sequence>
+ </complexType>-->
+
+ </xsl:element><!-- End of xsd:schema End of output -->
+
+</xsl:template>
+
+<xsl:template name="messageDescribe">
+<xsl:param name="async"/>
+<xsl:param name="processID"/>
+
+ <!-- request message -->
+ <xsl:element name="message"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Request')"></xsl:value-of></xsl:attribute>
+ <xsl:element name="part"><xsl:attribute name="name"><xsl:value-of select="'DataInputs'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="element"><xsl:value-of select="concat('wps:',$processID)"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element>
+
+ <!-- response message -->
+ <xsl:element name="message"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
+ <xsl:element name="part"><xsl:attribute name="name"><xsl:value-of select="'ProcessOutputs'"></xsl:value-of></xsl:attribute>
+ <xsl:attribute name="element"><xsl:value-of select="concat('wps:',$processID,'Response')"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template name="operationDescribe">
+<xsl:param name="async"/>
+<xsl:param name="processID"/>
+ <!-- Operation section inside portType -->
+
+
+ <xsl:element name="operation"><xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
+ <xsl:element name="input"><xsl:attribute name="message"><xsl:value-of select="concat('tns:',$processID,'Request')"></xsl:value-of></xsl:attribute></xsl:element>
+ <xsl:element name="output"><xsl:attribute name="message"><xsl:value-of select="concat('tns:',$processID,'Response')"></xsl:value-of></xsl:attribute></xsl:element>
+ <xsl:element name="fault"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute><xsl:attribute name="message"><xsl:value-of select="'tns:ExceptionResponse'"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template name="bindingDescribe">
+<xsl:param name="async"/>
+<xsl:param name="processID"/>
+ <xsl:element name="operation"><xsl:attribute name="name"><xsl:value-of select="$processID"></xsl:value-of></xsl:attribute>
+ <xsl:element name="operation" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="soapAction"><xsl:value-of select="concat($serverURL,'/',$processID)"></xsl:value-of></xsl:attribute><xsl:attribute name="style"><xsl:value-of select="'document'"></xsl:value-of></xsl:attribute></xsl:element>
+
+ <xsl:element name="input"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Request')"></xsl:value-of></xsl:attribute>
+ <xsl:element name="body" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element><!-- end input -->
+
+ <xsl:element name="output"><xsl:attribute name="name"><xsl:value-of select="concat($processID,'Response')"></xsl:value-of></xsl:attribute>
+ <xsl:element name="body" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element><!-- end input -->
+
+ <xsl:element name="fault"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute>
+ <xsl:element name="fault" namespace="http://schemas.xmlsoap.org/wsdl/soap/"><xsl:attribute name="name"><xsl:value-of select="'ExceptionResponse'"></xsl:value-of></xsl:attribute><xsl:attribute name="use"><xsl:value-of select="'literal'"></xsl:value-of></xsl:attribute></xsl:element>
+ </xsl:element><!-- end input -->
+ </xsl:element><!-- end operation -->
+</xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
More information about the Pywps-commits
mailing list