IDL & WSDL
Robert Olson
olson at mcs.anl.gov
Wed May 7 10:29:29 CDT 2003
My curiosity got the best of me and I had to try this.
The following IDL:
module AG
{
enum userType { person, node };
struct user {
string name;
userType type;
};
struct entryReturn {
boolean success;
long privateId;
sequence<user> users;
};
interface VenueServer
{
entryReturn Enter(in string profile);
};
};
translates to the WSDL at the end of this message.
I find the IDL formulation of that made-up interface quite readable and
reasonably self-documenting.
--bob
<?xml version="1.0"?>
<!-- root element definitions defines set of related services -->
<definitions name="vc.wsdl"
targetNamespace="vc"
xmlns:wsdlns ="vc"
xmlns:typens ="vc"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
xmlns ="http://schemas.xmlsoap.org/wsdl/"
>
<!-- types encapsulates schema types; here using xsd -->
<types>
<!-- all type declarations are in a chunk of xsd -->
<schema targetNamespace="vc"
xmlns ="http://www.w3.org/2001/XMLSchema"
elementFormDefault = "qualified"
xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
xmlns:soap ="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc ="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>
<!-- define enum AG_userType-->
<xsd:simpleType name="AG_userType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value ="person" />
<xsd:enumeration value ="node" />
</xsd:restriction>
</xsd:simpleType>
<!-- define struct AG_user-->
<complexType name="AG_user">
<xsd:sequence>
<xsd:element name="name" minOccurs="1" maxOccurs="1" type="xsd:string" />
<xsd:element name="type" minOccurs="1" maxOccurs="1"
type="typens:AG_userType" />
</xsd:sequence>
</complexType>
<!-- define struct AG_entryReturn-->
<complexType name="AG_entryReturn">
<xsd:sequence>
<xsd:element name="success" minOccurs="1" maxOccurs="1"
type="xsd:boolean" />
<xsd:element name="privateId" minOccurs="1" maxOccurs="1"
type="xsd:long" />
<xsd:element name="users" minOccurs="1" maxOccurs="1"
type="typens:SequenceOf_AG_user" />
</xsd:sequence>
</complexType>
<complexType name="SequenceOf_AG_user">
<xsd:complexContent>
<xsd:restriction base="soapenc:Array">
<xsd:sequence>
<xsd:element type="typens:AG_user" name="item" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute ref="soapenc:arrayType"
wsdl:arrayType="typens:AG_user[]"/>
</xsd:restriction>
</xsd:complexContent>
</complexType>
</schema>
</types>
<!-- define operation: AG_VenueServer_Enter-->
<message name="AG_VenueServer_EnterRequest" >
<part name="profile" type="xsd:string" />
</message>
<message name="AG_VenueServer_EnterResponse" >
<part name="return" type="typens:AG_entryReturn" />
</message>
<portType name="AG_VenueServerPortType">
<operation name="AG_VenueServer_Enter">
<input message="wsdlns:AG_VenueServer_EnterRequest" />
<output message="wsdlns:AG_VenueServer_EnterResponse" />
</operation>
</portType>
<binding name="AG_VenueServerBinding" type="wsdlns:AG_VenueServerPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="AG_VenueServer_Enter" >
<soap:operation soapAction="AG_VenueServer_Enter" />
<input>
<soap:body use="encoded" namespace="vc"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soap:body use="encoded" namespace="vc"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
<fault>
<soap:body use="encoded" namespace="vc"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</fault>
</operation>
</binding>
<service name="AG_VenueServerService" >
<port name="AG_VenueServerPort" binding="wsdlns:AG_VenueServerBinding" >
<soap:address location="foo" />
</port>
</service>
</definitions>
More information about the ag-dev
mailing list