1000 Java Tips ebook
Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!.
Use a Java Applet to access remote Web services
JavaFAQ Home » Java Applets
In this article, I show you how to create a system that uses your browser to
request and interact with Web service data from an arbitrary source. First, I
into the Web page. Finally, I create a servlet that acts as a proxy for
This article assumes that you are familiar with Java technology and (to a
lesser extent) with XML. In addition to a Java development environment such as
J2SE 1.4 or above, you'll need several pieces of software for this article. To
send and receive the SOAP messages, you'll need the SOAP with Attachments
Application Program Interface (API) for Java, or SAAJ (see "Send
and receive SOAP messages with SAAJ" for help in setting it up) and
you'll need a servlet engine such as IBM® WebSphere® Application Server or
Apache Tomcat to run the servlet. See Resources
for links to the various software packages you'll need.
A simple request
Applets have always been designed to play in a "sandbox" in which they
can't hurt anything on a user's system, so their security is tighter than that
of their server-based application counterparts. But what if you want an applet
that can make arbitrary Web requests? This article shows you how
to work around this problem by building a server-based proxy. It also shows
First, take a look at the request you're ultimately going to make from the
applet. Although this technique works for any kind of data you can pass through
a URL, this article focuses on Web services, so I'll start with the simple SOAP
message in Listing 1.
Printer Friendly Page
Send to a Friend
Search here again if you need more info!