--- /dev/null
+<?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>
--- /dev/null
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0"
+ 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:lbt="http://glite.org/wsdl/types/lb">
+
+<xsl:output indent="yes"/>
+
+<xsl:template match="/service">
+ <definitions
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ 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>
+
+ </service>
+
+ </definitions>
+</xsl:template>
+
+<xsl:template match="types">
+ <schema targetNamespace="{@ns}"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="unqualified"
+ attributeFormDefault="unqualified">
+
+ <xsl:apply-templates/>
+ </schema>
+</xsl:template>
+
+<xsl:template match="simple">
+ <xsd:element name="{@name}" type="xsd:{@name}"/>
+</xsl:template>
+
+<xsl:template match="enum">
+ <xsd:simpleType name="{@name}">
+ <xsd:restriction base="xsd:string">
+ <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}"/>
+</xsl:template>
+
+<xsl:template match="flags">
+ <xsd:simpleType name="{@name}Value">
+ <xsd:restriction base="xsd:string">
+ <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
+ </xsd:restriction>
+ </xsd:simpleType>
+ <xsd:complexType name="{@name}">
+ <xsd:sequence>
+ <xsd:element name="flag" type="{/service/types/@prefix}:{@name}Value" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="{@name}" type="{/service/types/@prefix}:{@name}"/>
+</xsl:template>
+
+<xsl:template match="struct">
+ <xsd:complexType name="{@name}">
+ <xsd:sequence>
+ <xsl:for-each select="elem">
+ <xsl:variable name="type">
+ <xsl:choose>
+ <xsl:when test="contains(@type,':')">
+ <xsl:value-of select="@type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="/service/types/@prefix"/>:<xsl:value-of select="@type"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min">
+ <xsl:choose>
+ <xsl:when test="@optional='yes'">0</xsl:when>
+ <xsl:otherwise>1</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="{$type}" minOccurs="{$min}" maxOccurs="{$max}"/>
+ </xsl:for-each>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="{@name}" type="{/service/types/@prefix}:{@name}"/>
+</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: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:message>
+</xsl:template>
+
+<xsl:template match="struct[@fault='yes']" mode="message">
+ <wsdl:message name="{@name}">
+ <wsdl:part name="{@name}" element="{/service/types/@prefix}:{@name}">
+ <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
+ </wsdl:part>
+ </wsdl:message>
+</xsl:template>
+
+<xsl:template match="op" mode="port-type">
+ <wsdl:operation name="{@name}">
+ <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
+ <wsdl:input name="i" message="{/service/@prefix}:{@name}Request"/>
+ <wsdl:output name="o" message="{/service/@prefix}:{@name}Response"/>
+ <wsdl:fault name="f" message="{/service/@prefix}:{fault/@name}"/>
+ </wsdl:operation>
+</xsl:template>
+
+<xsl:template match="op" mode="binding">
+ <wsdl:operation name="{@name}">
+ <soap:operation style="rpc"/>
+ <wsdl:input name="i">
+ <soap:body use="literal" namespace="{/service/@ns}"/>
+ </wsdl:input>
+ <wsdl:output name="o">
+ <soap:body use="literal" namespace="{/service/@ns}"/>
+ </wsdl:output>
+ <wsdl:fault name="f">
+ <soap:fault use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+</xsl:template>
+
+</xsl:stylesheet>