Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A Web service client is usually not interactive and, in particular, not a browser. This section illustrates, as proof of concept, how a browser-based client might be used with a SOAP-based web service. The @WebService is simple and familiar:
package ch06.tc;
import javax.jws.WebService;
import javax.jws.WebMethod;
@WebService
public class TempConvert {
@WebMethod
public float c2f(float t) { return 32.0F + (t * 9.0F / 5.0F); }
@WebMethod
public float f2c(float t) { return (5.0F / 9.0F) * (t - 32.0F); }
}