LB WSDL generated from pukeable xml
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 27 May 2005 12:13:19 +0000 (12:13 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 27 May 2005 12:13:19 +0000 (12:13 +0000)
- WS-I compliant
- compiles with gsoap
- pretty printing added in Makefile

org.glite.lb.ws-interface/Makefile
org.glite.lb.ws-interface/project/version.properties
org.glite.lb.ws-interface/src/LB.xml [new file with mode: 0644]
org.glite.lb.ws-interface/src/LB.xml.T [deleted file]
org.glite.lb.ws-interface/src/LBTypes.xml.T [new file with mode: 0644]
org.glite.lb.ws-interface/src/puke-wsdl.xsl

index aacc67c..d498bd7 100644 (file)
@@ -17,18 +17,19 @@ SUFFIXES = .T
 VPATH=${top_srcdir}/src
 AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
 XSLTPROC=xsltproc
+TIDY=tidy
 
 STAGETO=interface
 
-WSDL=LB.wsdl
+WSDL=LB.wsdl LBTypes.wsdl
 
-all compile:
+all compile: ${WSDL}
 
 check: 
        @echo No unit test required for interface-only module.
 
-stage:
-       $(MAKE) install PREFIX=${stagedir}
+stage: compile
+       $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
 
 dist: distsrc distbin
 
@@ -47,8 +48,15 @@ install:
        -mkdir -p ${PREFIX}/${STAGETO}
        -mkdir -p ${PREFIX}/share/doc/${package}-${version}
        install -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
-       cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
-#      install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
+# install the generated stuff instead
+#      cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
+       install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
+
+# JP has its own version anyway
+#      if [ x${DOSTAGE} = xyes ]; then \
+#              mkdir -p ${PREFIX}/share/lb; \
+#              install -m 644 ${top_srcdir}/src/puke-wsdl.xsl ${top_srcdir}/src/puke-ug.xsl ${PREFIX}/share/lb; \
+#      fi
 
 clean:
        rm -f *.h
@@ -59,5 +67,10 @@ clean:
        ${AT3} $< >$@ || rm -f $@
        chmod -w $@ >/dev/null
 
-${WSDL}: LB.xml
-       ${XSLTPROC} ../src/puke-wsdl.xsl LB.xml >$@
+${WSDL}: %.wsdl: %.xml puke-wsdl.xsl
+       ${XSLTPROC} ../src/puke-wsdl.xsl $< >$@
+       -${TIDY} -wrap 10000 -xml -m -i -q $@
+       -perl -i -n -e 'if (/^\s*$$/) { $$empty .= "\n"; } elsif (/^\s*<(xsd:)?(enumeration|element|input|output|fault)/) { print $$_; $$empty = "";} else { print "$$empty$$_"; $$empty=""; }; ' $@
+
+LB-ug.xml: LB.xml puke-ug.xsl
+       ${XSLTPROC} ../src/puke-ug.xsl $< >$@
index 88e0674..0866603 100755 (executable)
@@ -1,4 +1,4 @@
 #Thu May 19 13:15:14 CEST 2005
-module.version=1.2.0
-module.build=2
+module.version=2.0.0
+module.build=1
 module.age=1
diff --git a/org.glite.lb.ws-interface/src/LB.xml b/org.glite.lb.ws-interface/src/LB.xml
new file mode 100644 (file)
index 0000000..9f94f8a
--- /dev/null
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+
+<service name="LoggingAndBookkeeping"
+       ns="http://glite.org/wsdl/services/lb"
+       prefix="lb"
+       typeNs="http://glite.org/wsdl/types/lb"
+       typePrefix="lbt"
+       elemNs="http://glite.org/wsdl/elements/lb"
+       elemPrefix="lbe">
+
+       Keeping track of state of grid jobs.
+
+       <import namespace="http://glite.org/wsdl/services/lb" location="LBTypes.wsdl"/>
+
+       <fault name="genericFault"/>
+
+       <operations>
+               <op name="GetVersion">
+                       Return version of the service.
+                       <output name="version" type="xsd:string">Returned version.</output>
+                       <fault name="genericFault" type="genericFault"> Any error. </fault>
+               </op>
+               <op name="JobStatus">
+                       Query state of a single job.
+                       <input name="jobid" type="xsd:string"> Id of the queried job. </input>
+                       <input name="flags" type="jobFlags"> Which data fields to retrieve. </input>
+                       <output name="stat" type="jobStatus"> Current state of the job. </output>
+                       <fault name="genericFault" type="genericFault"> Any error. </fault>
+               </op>
+               <op name="UserJobs">
+                       Simplified query, return all jobs of the authenticated user.
+                       <output name="jobs" type="xsd:string" list="yes"> JobId's of jobs matching the query.</output>
+                       <output name="states" type="jobStatus" list="yes"> States of jobs matching the query.</output>
+                       <fault name="genericFault" type="genericFault"> Any error. </fault>
+               </op>
+               <op name="QueryJobs">
+                       Retrieve a list of jobs, including their states, based on query conditions.
+                       The conditions take the form of a list of lists.
+                       Elements of the inner lists refer to a single job attribute, the conditions are or-ed.
+                       Elements of the outer list may refer to different job attributes, they are and-ed.
+
+                       <input name="conditions" type="queryConditions" list="yes">The query conditions.</input>
+                       <input name="flags" type="jobFlags"> Which data fields to retrieve.</input>
+                       <output name="jobs" type="xsd:string" list="yes"> JobId's of jobs matching the query.</output>
+                       <output name="states" type="jobStatus" list="yes"> States of jobs matching the query.</output>
+                       <fault name="genericFault" type="genericFault"> Any error. </fault>
+               </op>
+
+               <op name="QueryEvents">
+                       Retrieve events matching a query.
+                       There are two sets of conditions, on jobs and on individual events, both have to be satisfied.
+                       Both query conditions have the same format as in QueryJobs.
+
+                       <input name="jobConditions" type="queryConditions" list="yes">
+                               Conditions on jobs.
+                       </input>
+                       <input name="eventConditions" type="queryConditions" list="yes">
+                               Conditions on individual events.
+                       </input>
+                       <output name="events" type="event" list="yes">All matchin events.</output>
+                       <fault name="genericFault" type="genericFault"> Any error. </fault>
+               </op>
+
+               <!-- TODO: event queries -->
+
+       </operations>
+
+</service>
diff --git a/org.glite.lb.ws-interface/src/LB.xml.T b/org.glite.lb.ws-interface/src/LB.xml.T
deleted file mode 100644 (file)
index a96551b..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0"?>
-
-@@@LANG: wsdl
-<!--
-@@@AUTO
--->
-
-<service name="LoggingAndBookkeeping"
-       ns="http://glite.org/wsdl/services/lb"
-       prefix="lb">
-
-       Keeping track of state of grid jobs.
-
-       <types ns="http://glite.org/wsdl/types/lb" prefix="lbt">
-               <flags name="jobFlags">
-                       Flags determining which fields of job status should be retrieved.
-                       Can be combined arbitrarily.
-                       <val name="CLASSADS">Include also long job descriptions (JDL).</val>
-                       <val name="CHILDREN">Return list of subjobs of a DAG.</val>
-                       <val name="CHILDSTAT">Return state of the subjobs, i.e. apply other flags recursively </val>
-               </flags>
-
-               <enum name="statName">
-@@@{
-       for my $stat ($status->getTypesOrdered) {
-               my $u = uc $stat;
-               my $c = getTypeComment $status $stat;
-               gen qq{
-!                      <val name="$u">$c</val>
-};
-       }
-@@@}
-               </enum>
-
-@@@{
-       for my $n ($status->getAllFieldsOrdered) {
-               my $f = selectField $status $n;
-               if ($f->{codes}) {
-                       my $n = getName $f;
-                       $n = $1.ucfirst $2 while $n =~ /([[:alpha:]]*)_([[:alpha:]]*)/;
-                               gen qq{
-!              <enum name="$n">
-};
-                               for (@{$f->{codes}}) {
-                                       my $uc = uc $_->{name};
-                                       gen qq{
-!                      <val name="$uc">$_->{comment}</val>
-};
-                               }
-                               gen qq{
-!              </enum>
-};
-               }
-       }
-@@@}
-
-<!-- FIXME: list which are arrays in fact are not portable and 
-       will not work most likely in this way -->
-
-               <struct name="jobStatus">
-                       Status of a job, possibly including subjobs.
-                       <elem name="state" type="statName">Status name.</elem>
-@@@{
-       for my $n (getAllFieldsOrdered $status) {
-               selectField $status $n;
-               my $f = getField $status;
-               my $name = getName $f;
-               $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]]*)/;
-               my $type = $f->{type};
-               my $list = 'no';
-
-               if ($main::baseTypes{$type}) {
-                       $type = eval $main::types{wsdl}->{$main::baseTypes{$type}};
-                       $list = 'yes'
-               }
-               elsif ($f->{codes}) {
-                       $type = $name;
-               }
-               else {
-                       $type = getType $f;
-               }
-
-               my $comment = getComment $f;
-# XXX: currently nothing is "optional" as we don't know from status.T 
-               gen qq{
-!                      <elem name="$name" type="$type" list="$list" optional="no">$comment</elem>
-};
-       }
-@@@}
-               </struct>
-
-               <struct name="tagValue">
-                       <elem name="tag" type="xsd:string"/>
-                       <elem name="value" type="xsd:string" optional="yes"/>
-               </struct>
-
-               <struct name="timeval">
-                       <elem name="tvSec" type="xsd:long"/>
-                       <elem name="tvUsec" type="xsd:long"/>
-               </struct>
-
-
-               <struct name="genericFault" fault="yes">
-                       Generic SOAP fault, used to deliver any LB errors.
-                       <elem name="source" type="xsd:string">Source component (module) of the error.</elem>
-                       <elem name="code" type="xsd:int">Numeric error code.</elem>
-                       <elem name="text" type="xsd:string">Error text corresponding to the code.</elem>
-                       <elem name="description" type="xsd:string" optional="yes">Additional description of the error (e.g. filename)</elem>
-                       <elem name="reason" type="genericFault" optional="yes">Reason of the error, coming from lower levels.</elem>
-               </struct>
-
-               <simple name="string"/>
-               <simple name="int"/>
-
-       </types>
-
-
-
-       <op name="JobStatus">
-               Query state of a single job.
-               <input name="jobid" type="string"> Id of the queried job. </input>
-               <input name="flags" type="jobFlags"> Which data fields to retrieve. </input>
-               <output name="stat" type="jobStatus"> Current state of the job. </output>
-               <fault name="genericFault" type="genericFault"> Any error. </fault>
-       </op>
-
-</service>
diff --git a/org.glite.lb.ws-interface/src/LBTypes.xml.T b/org.glite.lb.ws-interface/src/LBTypes.xml.T
new file mode 100644 (file)
index 0000000..69b55a7
--- /dev/null
@@ -0,0 +1,249 @@
+<?xml version="1.0"?>
+
+@@@LANG: wsdl
+<!--
+@@@AUTO
+-->
+
+<service name="LoggingAndBookkeeping"
+       ns="http://glite.org/wsdl/services/lb"
+       typePrefix="lbt">
+
+       <types ns="http://glite.org/wsdl/types/lb">
+               <flags name="jobFlags">
+                       Flags determining which fields of job status should be retrieved.
+                       Can be combined arbitrarily.
+                       <val name="CLASSADS">Include also long job descriptions (JDL).</val>
+                       <val name="CHILDREN">Return list of subjobs of a DAG.</val>
+                       <val name="CHILDSTAT">Return state of the subjobs, i.e. apply other flags recursively </val>
+               </flags>
+
+               <enum name="statName">
+@@@{
+       for my $stat ($status->getTypesOrdered) {
+               my $u = uc $stat;
+               my $c = getTypeComment $status $stat;
+               gen qq{
+!                      <val name="$u">$c</val>
+};
+       }
+@@@}
+               </enum>
+
+@@@{
+       for my $n ($status->getAllFieldsOrdered) {
+               my $f = selectField $status $n;
+               if ($f->{codes}) {
+                       my $n = getName $f;
+                       $n = $1.ucfirst $2 while $n =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+                               gen qq{
+!              <enum name="$n">
+};
+                               for (@{$f->{codes}}) {
+                                       my $uc = uc $_->{name};
+                                       gen qq{
+!                      <val name="$uc">$_->{comment}</val>
+};
+                               }
+                               gen qq{
+!              </enum>
+};
+               }
+       }
+@@@}
+
+               <struct name="jobStatus">
+                       Status of a job, possibly including subjobs.
+                       <elem name="state" type="statName">Status name.</elem>
+@@@{
+       for my $n (getAllFieldsOrdered $status) {
+               selectField $status $n;
+               my $f = getField $status;
+               my $name = getName $f;
+               $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+               my $type = $f->{type};
+               my $list = 'no';
+
+               if ($main::baseTypes{$type}) {
+                       $type = eval $main::types{wsdl}->{$main::baseTypes{$type}};
+                       $list = 'yes'
+               }
+               elsif ($f->{codes}) {
+                       $type = $name;
+               }
+               else {
+                       $type = getType $f;
+               }
+
+               my $comment = getComment $f;
+               if ($name eq 'stateEnterTimes' || $name eq 'childrenHist') {
+# XXX: stateEnterTimes and childrenHist are the only case of enum-indexed array
+                       gen qq{
+!                              <elem name="$name" type="${name}Item" list="yes" optional="yes">$comment</elem>
+};
+               }
+               else {
+# XXX: currently nothing is "optional" as we don't know from status.T 
+                       gen qq{
+!                              <elem name="$name" type="$type" list="$list" optional="no">$comment</elem>
+};
+               }
+       }
+@@@}
+               </struct>
+
+               <choice name="event">
+@@@{
+       for my $name (sort { $event->{order}->{$a} <=> $event->{order}->{$b} } getTypes $event) {
+               my $comment = getTypeComment $event $name;
+               $name = $1.ucfirst $2 while $name =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+               gen qq{
+!                      <elem name="$name" type="event$name">$comment</elem>
+};
+       }
+@@@}
+               </choice>
+
+@@@{
+       for my $type (sort { $event->{order}->{$a} <=> $event->{order}->{$b} } getTypes $event) {
+               my $tn = $type;
+               $tn = $1.ucfirst $2 while $tn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+
+               gen qq{
+!                      <struct name="event$tn">
+};
+               selectType $event '_common_';
+               for ($event->getFieldsOrdered) {
+                       my $f = selectField $event $_;
+                       my $fn = $f->{name};
+                       my $ftn = $f->getType;
+
+                       $fn = $1.ucfirst $2 while $fn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+                       $ftn = $1.ucfirst $2 while $ftn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+
+                       my $comment = getComment $f;
+                       my $opt = $f->{optional} ? 'yes' : 'no';
+                       gen qq{
+                               <elem name="$fn" type="$ftn" optional="$opt">$comment</elem>
+                       };
+               }
+
+               selectType $event $type;
+               for ($event->getFieldsOrdered) {
+                       my $f = selectField $event $_;
+                       my $fn = $f->{name};
+                       my $ftn = $f->getType;
+
+                       $fn = $1.ucfirst $2 while $fn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+                       $ftn = $1.ucfirst $2 while $ftn =~ /([[:alpha:]]*)_([[:alpha:]_]*)/;
+
+                       my $comment = getComment $f;
+                       my $opt = $f->{optional} ? 'yes' : 'no';
+                       gen qq{
+                               <elem name="$fn" type="$ftn" optional="$opt">$comment</elem>
+                       };
+               }
+               gen "</struct>\n\n";
+       }
+@@@}
+
+               <enum name="eventSource">
+                       Possible sources of LB events.
+                       <val name="userInterface"/>
+                       <val name="networkServer"/>
+                       <val name="workloadManager"/>
+                       <val name="bigHelper"/>
+                       <val name="jobSubmission"/>
+                       <val name="logMonitor"/>
+                       <val name="LRMS"/>
+                       <val name="application"/>
+               </enum>
+
+               <struct name="stateEnterTimesItem">
+                       <elem name="state" type="statName">The job state.</elem>
+                       <elem name="time" type="xsd:dateTime">When the state was entered last time.</elem>
+               </struct>
+
+               <struct name="childrenHistItem">
+                       <elem name="state" type="statName">The job state of the children.</elem>
+                       <elem name="count" type="xsd:int">How many children are in this state.</elem>
+               </struct>
+
+               <struct name="tagValue">
+                       <elem name="tag" type="xsd:string"/>
+                       <elem name="value" type="xsd:string" optional="yes"/>
+               </struct>
+
+               <struct name="timeval">
+                       <elem name="tvSec" type="xsd:long"/>
+                       <elem name="tvUsec" type="xsd:long"/>
+               </struct>
+
+
+               <struct name="genericFault" fault="yes">
+                       Generic SOAP fault, used to deliver any LB errors.
+                       <elem name="source" type="xsd:string">Source component (module) of the error.</elem>
+                       <elem name="code" type="xsd:int">Numeric error code.</elem>
+                       <elem name="text" type="xsd:string">Error text corresponding to the code.</elem>
+                       <elem name="description" type="xsd:string" optional="yes">Additional description of the error (e.g. filename)</elem>
+                       <elem name="reason" type="genericFault" optional="yes">Reason of the error, coming from lower levels.</elem>
+               </struct>
+
+               <struct name="queryConditions">
+                       An element of outer list of query conditions in job queries.
+                       It expresses possibly several conditions (records) on a single job attribute.
+                       These conditions are logically OR-ed.
+                       <elem name="attr" type="queryAttr"> The job attribute to which the query conditions apply. </elem>
+                       <elem name="tagName" type="xsd:string" optional="yes"> Name of the queried user tag if attr is USERTAG.</elem>
+                       <elem name="statName" type="statName" optional="yes"> Name of the job state to which "attr = TIME" condition refers.</elem>
+                       <elem name="record" type="queryRecord" list="yes"> The conditions. </elem>
+               </struct>
+
+               <enum name="queryAttr">
+                       Specification of a job attribute in query. 
+                       <val name="JOBID">A concrete JobId</val>
+                       <val name="OWNER">Owner of the job (X509 certificate subject).</val>
+                       <val name="STATUS">Status of the job (see statName type).</val>
+                       <val name="LOCATION">Where the job is currently handled (hostname).</val>
+                       <val name="DESTINATION">Where the job is or was scheduled to be executed.</val>
+                       <val name="DONECODE">How the job terminated (see doneCode type)</val>
+                       <val name="USERTAG">Value of particular user tag. The tag name has to be specified in queryConditions.tagName.</val>
+                       <val name="TIME">When the job entered a particular state. The state has to be specified in queryCondition.statName.</val>
+                       <val name="RESUBMITTED">The job was resubmitted.</val>
+                       <val name="PARENT">JobId of the job parend (DAG).</val>
+                       <val name="EXITCODE">UNIX exit code of the job.</val>
+                       <val name="HOST">Where the event was generated.</val>
+                       <val name="SOURCE">Source component.</val>
+                       <val name="INSTANCE">Instance of the source component.</val>
+                       <val name="EVENTTYPE">Event type.</val>
+                       <val name="CHKPTTAG">Checkpoint tag.</val>
+               </enum>
+
+               <struct name="queryRecord">
+                       A single query condition.
+                       <elem name="op" type="queryOp"> Relational operator of the condition.</elem>
+                       <elem name="value1" type="queryRecValue"> Value to compare the attribute with.</elem>
+                       <elem name="value2" type="queryRecValue" optional="yes"> Another value to compare the attribute with (op = WITHIN only).</elem>
+               </struct>
+
+               <enum name="queryOp">
+                       Relational operator of query conditions. 
+                       <val name="EQUAL"> Attribute is equal to the specified value </val>
+                       <val name="LESS"> Attribute is less than the specified value or equal </val>
+                       <val name="GREATER"> Attribute is greater than the specified value or equal </val>
+                       <val name="WITHIN"> Attribute is withing a range (queryRecord.value2 must be specified) </val>
+                       <val name="UNEQUAL"> Attribute is not equal to the specified value.</val>
+               </enum>
+               
+               <choice name="queryRecValue"> 
+                       A value to compare an attribute with in queries.
+                       Exactly one of the elements must be specified.
+                       <elem name="i" type="xsd:int">Integer.</elem>
+                       <elem name="c" type="xsd:string">String.</elem>
+                       <elem name="t" type="timeval">Timestamp.</elem>
+               </choice>
+
+
+       </types>
+
+</service>
index 9342e89..1ca4379 100644 (file)
@@ -1,12 +1,14 @@
 <?xml version="1.0"?>
 
 <xsl:stylesheet version="1.0"
+       xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 
        xmlns:lb="http://glite.org/wsdl/services/lb"
+       xmlns:lbe="http://glite.org/wsdl/elements/lb"
        xmlns:lbt="http://glite.org/wsdl/types/lb">
 
 <xsl:output indent="yes"/>
                name="{@name}"
                targetNamespace="{@ns}">
        <documentation> <xsl:value-of select="text()"/> </documentation>
-               <types>
-                       <xsl:apply-templates select="types"/>
-               </types>
 
-               <xsl:apply-templates select="op" mode="message"/>
-
-               <xsl:apply-templates select="types/struct[@fault='yes']" mode="message"/>
-
-               <portType name="{@name}PortType">
-                       <xsl:apply-templates select="op" mode="port-type"/>
-               </portType>
-
-               <binding name="{@name}" type="{@prefix}:{@name}PortType">
-                       <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-                       <xsl:apply-templates select="op" mode="binding"/>
-               </binding>
-
-               <service name="{@name}">
-                       <documentation><xsl:value-of select="text()"/></documentation>
-                       <port name="{@name}" binding="{@prefix}:{@name}">
-                               <soap:address location="http://test.glite.org/{@prefix}:8080"/>
-                       </port>
+               <xsl:apply-templates select="import"/>
 
-               </service>
+               <xsl:apply-templates select="types"/>
+               
+<!--           <xsl:apply-templates select="fault"/> -->
 
+               <xsl:apply-templates select="operations"/>
+               
        </definitions>
 </xsl:template>
 
 <xsl:template match="types">
-       <schema targetNamespace="{@ns}"
-               xmlns="http://www.w3.org/2001/XMLSchema"
-               elementFormDefault="unqualified"
-               attributeFormDefault="unqualified">
+       <wsdl:types>
+               <xsd:schema targetNamespace="{@ns}"
+                       elementFormDefault="unqualified"
+                       attributeFormDefault="unqualified">
 
-               <xsl:apply-templates/>
-       </schema>
+                       <xsl:apply-templates/>
+               </xsd:schema>
+       </wsdl:types>
+       <!-- <xsl:apply-templates select="struct[@fault='yes']" mode="message"/> -->
 </xsl:template>
 
+<!--
 <xsl:template match="simple">
        <xsd:element name="{@name}" type="xsd:{@name}"/>
+       <xsd:complexType name="{@name}List">
+               <xsd:sequence>
+                       <xsd:element name="{@name}" type="xsd:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
+               </xsd:sequence>
+       </xsd:complexType>
+       <xsd:element name="{@name}List" type="{/service/@typePrefix}:{@name}List"/>
+</xsl:template>
+
+<xsl:template match="list">
+       <xsd:complexType name="{@name}List">
+               <xsd:sequence>
+                       <xsd:element name="{@name}" type="xsd:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
+               </xsd:sequence>
+       </xsd:complexType>
 </xsl:template>
+-->
 
 <xsl:template match="enum">
        <xsd:simpleType name="{@name}">
@@ -65,7 +69,7 @@
                        <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
                </xsd:restriction>
        </xsd:simpleType>
-       <xsd:element name="{@name}" type="{/service/types/@prefix}:{@name}"/>
+<!--   <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/> -->
 </xsl:template>
 
 <xsl:template match="flags">
        </xsd:simpleType>
        <xsd:complexType name="{@name}">
                <xsd:sequence>
-                       <xsd:element name="flag" type="{/service/types/@prefix}:{@name}Value" minOccurs="0" maxOccurs="unbounded"/>
+                       <xsd:element name="flag" type="{/service/@typePrefix}:{@name}Value" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>
-       <xsd:element name="{@name}" type="{/service/types/@prefix}:{@name}"/>
+<!--   <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/> -->
 </xsl:template>
 
 <xsl:template match="struct">
        <xsd:complexType name="{@name}">
                <xsd:sequence>
+                       <xsl:call-template name="inner-struct"/>
+               </xsd:sequence>
+       </xsd:complexType>
+</xsl:template>
+
+<xsl:template match="choice">
+       <xsd:complexType name="{@name}">
+               <xsd:choice>
+                       <xsl:call-template name="inner-struct"/>
+               </xsd:choice>
+       </xsd:complexType>
+</xsl:template>
+
+
+<xsl:template name="inner-struct">
                        <xsl:for-each select="elem">
                                <xsl:variable name="type">
                                        <xsl:choose>
                                                        <xsl:value-of select="@type"/>
                                                </xsl:when>
                                                <xsl:otherwise>
-                                                       <xsl:value-of select="/service/types/@prefix"/>:<xsl:value-of select="@type"/>
+                                                       <xsl:value-of select="/service/@typePrefix"/>:<xsl:value-of select="@type"/>
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:variable>
                                </xsl:variable>
                                <xsd:element name="{@name}" type="{$type}" minOccurs="{$min}" maxOccurs="{$max}"/>
                        </xsl:for-each>
+<!--
+       <xsd:complexType name="{@name}List">
+               <xsd:sequence>
+                       <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
                </xsd:sequence>
        </xsd:complexType>
-       <xsd:element name="{@name}" type="{/service/types/@prefix}:{@name}"/>
+       <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/>
+       <xsd:element name="{@name}List" type="{/service/@typePrefix}:{@name}List"/>
+-->
 </xsl:template>
 
 <xsl:template match="op" mode="message">
        <wsdl:message name="{@name}Request">
-               <xsl:for-each select="input">
-                       <wsdl:part name="{@name}" element="{/service/types/@prefix}:{@type}">
-                               <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
-                       </wsdl:part>
-               </xsl:for-each>
+               <wsdl:part name="input" element="{/service/@elemPrefix}:{@name}">
+                       <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
+               </wsdl:part>
        </wsdl:message>
        <wsdl:message name="{@name}Response">
-               <xsl:for-each select="output">
-                       <wsdl:part name="{@name}" element="{/service/types/@prefix}:{@type}">
-                               <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
-                       </wsdl:part>
-               </xsl:for-each>
+               <wsdl:part name="output" element="{/service/@elemPrefix}:{@name}Response">
+                       <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
+               </wsdl:part>
        </wsdl:message>
 </xsl:template>
 
+<xsl:template match="op" mode="element">
+       <xsd:element name="{@name}">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsl:for-each select="input">
+                                       <xsl:variable name="prefix">
+                                               <xsl:choose>
+                                                       <xsl:when test="starts-with(@type,'xsd:')"/>
+                                                       <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsl:variable name="max">
+                                               <xsl:choose>
+                                                       <xsl:when test="@list='yes'">unbounded</xsl:when>
+                                                       <xsl:otherwise>1</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
+                               </xsl:for-each>
+                       </xsd:sequence>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="{@name}Response">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsl:for-each select="output">
+                                       <xsl:variable name="prefix">
+                                               <xsl:choose>
+                                                       <xsl:when test="starts-with(@type,'xsd:')"/>
+                                                       <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsl:variable name="max">
+                                               <xsl:choose>
+                                                       <xsl:when test="@list='yes'">unbounded</xsl:when>
+                                                       <xsl:otherwise>1</xsl:otherwise>
+                                               </xsl:choose>
+                                       </xsl:variable>
+                                       <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
+                               </xsl:for-each>
+                       </xsd:sequence>
+               </xsd:complexType>
+       </xsd:element>
+</xsl:template>
+
+
 <xsl:template match="struct[@fault='yes']" mode="message">
        <wsdl:message name="{@name}">
-               <wsdl:part name="{@name}" element="{/service/types/@prefix}:{@name}">
+               <wsdl:part name="{@name}" element="{/service/@typePrefix}:{@name}">
                        <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
                </wsdl:part>
        </wsdl:message>
 
 <xsl:template match="op" mode="binding">
        <wsdl:operation name="{@name}">
-               <soap:operation style="rpc"/>
+               <soap:operation style="document"/>
                <wsdl:input name="i">
-                       <soap:body use="literal" namespace="{/service/@ns}"/>
+                       <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="o">
-                       <soap:body use="literal" namespace="{/service/@ns}"/>
+                       <soap:body use="literal"/>
                </wsdl:output>
                <wsdl:fault name="f">
-                       <soap:fault use="literal"/>
+                       <soap:fault name="f" use="literal"/>
                </wsdl:fault>
        </wsdl:operation>
 </xsl:template>
 
+<xsl:template match="import">
+       <wsdl:import namespace="{@namespace}" location="{@location}"/>
+</xsl:template>
+
+<xsl:template match="operations">
+       <wsdl:types>
+               <xsd:schema targetNamespace="{/service/@elemNs}"
+                       elementFormDefault="unqualified"
+                       attributeFormDefault="unqualified">
+
+                       <xsl:apply-templates select="op" mode="element"/>
+
+                       <xsl:for-each select="/service/fault">
+                               <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/>
+                       </xsl:for-each>
+               </xsd:schema>
+       </wsdl:types>
+
+               <xsl:apply-templates select="/service/fault"/>
+
+               <xsl:apply-templates select="op" mode="message"/>
+
+               <wsdl:portType name="{/service/@name}PortType">
+                       <xsl:apply-templates select="op" mode="port-type"/>
+               </wsdl:portType>
+
+               <binding name="{/service/@name}" type="{/service/@prefix}:{/service/@name}PortType">
+                       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+                       <xsl:apply-templates select="op" mode="binding"/>
+               </binding>
+
+               <service name="{/service/@name}">
+                       <documentation><xsl:value-of select="text()"/></documentation>
+                       <port name="{/service/@name}" binding="{/service/@prefix}:{/service/@name}">
+                               <soap:address location="http://test.glite.org/{/service/@prefix}:8080"/>
+                       </port>
+
+               </service>
+
+</xsl:template>
+
+<xsl:template match="fault">
+       <wsdl:message name="{@name}">
+               <wsdl:part name="{@name}" element="{/service/@elemPrefix}:{@name}" />
+       </wsdl:message>
+</xsl:template>
+
+
 </xsl:stylesheet>
+