X

Geertjan's Blog

  • August 2, 2005

Forget Coding. Integrate Web Services Instead!

Geertjan Wielenga
Product Manager
I've come across a pretty interesting web service. It extracts all the URLs from a given web page. This is where I found it:

http://www.atomic-x.com/xmlservices/HyperlinkExtractor.asmx

It's implemented in exactly the same way as yesterday's web service. This is the interesting part of the servlet's processRequest method:

String url = request.getParameter("url");
out.println("<b>URL:</b>");
out.println(url);
out.println("<p><b>Extracted URLs:</b>");
String[] s = getHyperlinkExtractorSoap().extractUrl(url).getString();
out.println(Arrays.asList(s));

All the rest of the servlet's code is provided by the IDE! So, the lookup code, for example, is generated when the client is created (via a wizard). When I deploy the client, I get a web page that prompt me to specify the URL of a web page:

Here, as shown above, I just typed http://www.netbeans.org (the NetBeans home page) and then clicked the button. Et voila, here are all the URLs on the NetBeans home page:

Not bad, huh. You really don't need to do much programming anymore -- so long as someone else has done all the hard work for you and has made it available as a web service, just use the IDE's web service client wizard to quickly integrate the functionality into your own web application. (And, in the next release, wizards that generate clients for J2SE applications -- i.e., desktop or stand-alone or, simply, 'non web applications' -- will be provided too!)

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha