Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 6. JAX-WS in Java Application Se... > Integrating an Interactive Website a...

6.3. Integrating an Interactive Website and a Web Service

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); }
}


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial