WSDL - no input - best practice
Asked Answered
P

2

12

I'm developing a SOAP web service. One of the functions is isAlive(). It has no input parameters. What's best practice for the WSDL? I tried...

<wsdl:operation name="isAlive">
    <wsdl:output message="tns1:isAliveMessage"/>
</wsdl:operation>

...but got a parse error in one of my tools because of the missing input. I found a couple of examples where an input and a message was defined and the corresponding type definition was empty, i.e. <xsd:complexType name="somename"/>. Is this better?

Thanks!

Phantom answered 10/7, 2009 at 10:5 Comment(1)
I know it's been 13 years, but do you mind providing the working code for this?Ripple
N
6

You definitely need an input message - how else could the server tell what operation you want to call.

If you use document style (which you should), the input message should be a single element with no content.

Nonperformance answered 10/7, 2009 at 12:13 Comment(0)
C
1

It's good practise to define input and output documents for every operation, even if they turn out to be empty. These "empty" operations have a habit of turning out to be not so empty in the long run, and defining a placeholder document type up front can save you hassle.

For example, consider that the isAlive request might end up containing some indication of what it is you're asking about. It keeps your options open, and as a side effect generates valid WSDL :)

Condensate answered 10/7, 2009 at 10:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.