Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSDL Type for getter without parameter

I try to write a wsdl file. And I start with defining in the element my future operations. So I need to define a method like getAllObjects. That's why I don't need to set any parameter to getAllObjectsRequest. Could anybody tell me how I must define my message and operations for a method which doesn't declare any inputparameters (like ID in getById).

At the moment I have the next code:

<type .....>
<xsd:element name="getAllObjectRequest">
                <xsd:complexType>
                    <xsd:sequence>
                    </xsd:sequence>
                </xsd:complexType>
</xsd:element>

        <xsd:element name="getAllObjectResponce">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="allObject" type="wsbean:ObjectADB"
                        minOccurs="0" maxOccurs="unbounded"></xsd:element>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

I think this is not corect.

Thanks.

like image 965
Oleksandr Avatar asked May 26 '11 06:05

Oleksandr


1 Answers

This syntax is correct. If you don't like it, I suggest creating special marker Void type for these kind of messages:

<xsd:element name="getAllObjectRequest" type="Void"/>

<xsd:complexType name="Void">
    <xsd:sequence>
    </xsd:sequence>
</xsd:complexType>

Note that valid request in SOAP message look like this:

<getAllObjectRequest/>
like image 184
Tomasz Nurkiewicz Avatar answered Sep 30 '22 15:09

Tomasz Nurkiewicz