blob: 07a3c5c2d7f7c2d87f0b5f68471ca670b9615562 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
WSDL Descriptor for the Cocoon Usage Feedback demo application exposed as a
Web Service (REST style).
-->
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s0="http://www.cocoonhive.org/cocoonbook/2002/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.cocoonhive.org/cocoonbook/2002/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:schemaLocation="http://schemas.xmlsoap.org/wsdl/
http://schemas.xmlsoap.org/wsdl/">
<!--
The root WSDL element references a set of related standards
which you may not be familiar with.
Do not worry, this most probably means that you do not need them yet.
-->
<!-- First we will describe the input parameters -->
<message name="UsageFeedbackHttpGetIn">
<!--
Usually request parameters are of type xsd:string.
However, a more restricting type can be used if the WSDL file is accompanied by
an XML Schema document which enumerates the constraints.
For example regular expression patterns, enumerations and number precision
can be enforced with custom types.
-->
<part name="firstName" type="xsd:string"/>
<part name="lastName" type="xsd:string"/>
<part name="email" type="xsd:string"/>
<part name="age" type="xsd:nonNegativeInteger"/>
<!--
The "hobby" element is interesting in that it has one parameter name with multiple values.
It is well described with the XForms selectMany element, but it cannot be expressed with the current WSDL syntax.
Therefore, alternative avenues, like this inline remark, need to be used to annotate that the parameter type is a list of strings.
-->
<part name="hobby" type="xsd:string"/>
<!--
Another feature not supported by WSDL directly is specifying optional input parameters for
HTTP GET binding.
For example, the "favorite" parameters are not required by the UsageFeedback application.
Again, this inline remark will communicate to the client this information.
-->
<part name="favorite[1]" type="xsd:string"/>
<part name="favorite[2]" type="xsd:string"/>
<part name="favorite[3]" type="xsd:string"/>
<part name="hidden" type="xsd:boolean"/>
<part name="number" type="xsd:string"/>
<part name="liveUrl" type="xsd:string"/>
<part name="publish" type="xsd:boolean"/>
<part name="system/os" type="xsd:string"/>
<part name="system/processor" type="xsd:string"/>
<part name="system/@ram" type="xsd:nonNegativeInteger"/>
<part name="system/servletEngine" type="xsd:string"/>
<part name="system/javaVersion" type="xsd:string"/>
</message>
<!-- Next, we define the format of the output message -->
<message name="UsageFeedbackHttpGetOut">
<part name="Body" element="html:html"/>
</message>
<portType name="UsageFeedbackHttpGet">
<operation name="UsageFeedback">
<documentation>
Returns document with OK or Error message in XML format.
If the operation succeeds the output document will be:
<![CDATA[
<document>
<ok/>
</document>
]]>
Otherwise the response will look similar to:
<![CDATA[
<document xmlns:xf="http://apache.org/cocoon/xmlform/1.0">
<error>
<xf:violation ref="/lastName">Last name should be at least 4 characters.</xf:violation>
</error>
</document>
]]></documentation>
<input message="s0:HelloWorldHttpGetIn"/>
<output message="s0:HelloWorldHttpGetOut"/>
</operation>
</portType>
<!--
This WSDL file describes only one REST resource - WSUsageFeedback
accesible via HttpGet.
The complete URI of the resource is
http://localhost:8080/cocoon/samples/xmlform/wizard/UsageFeedbackService?firstName=...
-->
<binding name="UsageFeedbackHttpGet" type="s0:UsageFeedbackHttpGet">
<http:binding verb="GET"/>
<operation name="WSUsageFeedback">
<http:operation location="/UsageFeedbackService"/>
<input>
<http:urlEncoded/>
</input>
<output>
<mime:mimeXml part="Body"/>
</output>
</operation>
</binding>
<service name="UsageFeedback">
<port name="UsageFeedbackHttpGet" binding="s0:UsageFeedbackHttpGet">
<http:address location="http://localhost:8080/cocoon/samples/xmlform"/>
</port>
</service>
</definitions>