login button

How do I reflect a "void" return type in the WSDL?

Forums :

I'm writing a function (operation) that takes a single integer parameter, performs some task but does not return any value (I would think this is different from returning a value of xs:anyType). What parameter do I need to set in the JavaScript file to achieve this?

<types>
<schema>
<element name="myMethod">
<complexType>
<sequence>
<element name="myParam" type="xsd:integer"/>
</sequence>
</complexType>
</element>
<element name="myMethodResponse">
<complexType/>
</element>
</schema>
</types>

I can do it for the input parameter using

myMethod.inputTypes = { "myParam" : "xs:integer" };

But I'm not sure how to do it for the output parameter.

On a related note, I heard from someone that Axis2 does not allow one to define void operations. You have to return some value. Is this true?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It can be done as follows

You need to set

myMethod.inputType = "none"; or myMethod.inputType = {};
 to define a void return.

Well Axis2 can define void operation they are not in-out operations, they are in-only operations and hence return a 200 ok on success.

 

Thanks,

Keith.

Thanks

Keith,

I guess you mean "outputType". I set myFunction.outputType = "none" and it worked. I had previously tried "void" but it hadn't worked.

Thanks and regards,

Ganesh

Yes I did mean outputType

Hi Ganesh,

Yes I did mean outputType. It was atypo :).

Thanks,

Keith.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.