Java Reference
In-Depth Information
In fact, what's written in the XML schema associated with this operation's response type is an
empty sequence:
<xs:element name="updateResponse" type="tns:updateResponse" />
<xs:complexType name="updateResponse">
<xs:sequence />
</xs:complexType>
A cleaner and more interoperable way to do this is just to add the javax.jws.Oneway annota-
tion to any service method that has a void return type. Let's modify the method and see what
the new WSDL says:
@Oneway
@WebMethod(operationName="update")
public void update(int status) {
System.out.println("The new status is: " + status);
}
Now there is nothing in the XML schema to represent the void response (which is as it should
be). The WSDL no longer contains a message for the void response:
<message name="update">
<part name="parameters" element="tns:update" />
</message>
and the SOAP operation is fixed to just include an input:
<operation name="update">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" />
</input>
</operation>
Search WWH ::




Custom Search