Welcome!

Microservices Expo Authors: Automic Blog, Elizabeth White, Pat Romanski, Jason Bloomberg, Christoph Schell

Related Topics: Microservices Expo

Microservices Expo: Article

WASP: Taking the Sting Out of Web Services Development

WASP: Taking the Sting Out of Web Services Development

In the October issue of Web Services Journal (Vol. 2, issue 10), I wrote an article on how to assemble a free C# .NET development environment by combining Eclipse, the Java 2 platform, Microsoft's .NET SDK, and a C# Eclipse plug-in from Improve Technologies. This time, I'm going to extend the Eclipse workbench to provide a Java Web services development environment by adding a free plug-in from Systinet (www.systinet.com).

Java Web Services Development with Eclipse
By way of review, IBM released the Eclipse project (www.eclipse.org) to the open source community in November 2001. Eclipse is an open source platform that provides a core, extensible infrastructure for building software development environments. It provides a basic user interface, and an open API that supports the extension of the product through its plug-in mechanism.

WASP Server for Java is a complete platform for development, deployment, and management of Web service-based applications. A set of command-line tools is provided to allow developers to build Web service- based applications and application clients in Java. For those that prefer a friendlier interface WASP Developer is available as a self-contained module that plugs into your IDE (Sun ONE Studio/Forte/NetBeans, JBuilder, Eclipse/WSAD). It enables developers to develop, test, deploy, and manage Web service-based applications via the standard features and mechanisms available with their IDE. WASP Developer is built on top of WASP Server for Java, containing a complete WASP Server for Java installation, and using its interfaces to accomplish required tasks.

Thanks to Eclipse's plug-in mechanism, it's possible for us to extend it to produce a free Java Web services development, testing, and deployment environment. By combining Eclipse (open source IDE) with the Java platform (free) and the Web services plug-in from Systinet (free developer license), you have a comprehensive Java Web services application development platform that costs no money, and uses less than 150MB of hard disk space!

This article will walk you through the process of setting up this environment on a Windows 2000 machine (the recommended platform) and deploying a simple Java Web service and a client for that service. This combination of tools will also work on Windows 98/ME/NT/XP, Linux, Solaris, QNX, AIX, and HP-UX.

Environment Setup
Before you start, check Table 1 to be sure that your system has the appropriate resources for this configuration.

Although the minimum and recommended values in Table 1 are accurate, you'll be much happier if you have more horsepower available. I'm running this configuration on a P4 1.6 GHZ Dell Inspiron with 512 MB and plenty of free HD space.

 

Assuming that your system has the appropriate resources, you will need to download three components:
1.   Eclipse 2.0 SDK (www.eclipse.org/downloads/index.php): Select the appropriate OS.
2.   Java Runtime Environment 1.3.1 or 1.4.x (http://java.sun.com/j2se/downloads.html): The SDK is considerably larger than the JRE. Since the Eclipse SDK has a built-in Java compiler, you will still be able to do Java development without downloading the Java SDK.
3.   WASP Developer for Eclipse (www.systinet.com/products/wasp_developer/ download/license-ec40): You'll need to register and then log in to download this software. It's free for commercial development or noncommercial development and production deployment. Systinet also offers a "Single-CPU Production License" for its WASP Server product.

Once you have downloaded the three files, you can install the software. To install Eclipse, simply extract the zip file in the parent directory where you would like to store Eclipse (it will create a new directory called 'Eclipse' to store the software). To install the JRE or JDK, double-click on the self-install executable. A wizard will walk you through the necessary steps. At this point, you have the basic Eclipse platform installed (the Eclipse SDK comes with a suite of Java development tools and plug-in development tools). We'll look at installing the WASP Developer plug-in in just a moment.

Eclipse Review
The Eclipse IDE is divided into two basic levels: the Workspace and the Workbench:

  • Workspace: Files, packages, projects, and source control connections
  • Workbench: Editors, views, and perspectives

This division is not readily apparent, and is not labeled within the IDE, but it is an important distinction to understand when working with Eclipse or an Eclipse-based tool.

The Workspace is very team-centric, focusing on projects and file resources, as well as providing integrated source control capabilities for these resources. The Workspace also consists of the Workbench elements that are currently active (explained below). When you close Eclipse, it saves the current state of the local Workspace, allowing developers to pick right back up where they left off when Eclipse is restarted.

The Workbench consists of the visual artifacts that sit atop the Workspace resources and provide distinct views and role-based perspectives of the underlying projects and resources. The user interface paradigm is based on editors, views, and perspectives. An editor is a component that allows a developer to interact with and modify the contents of a file (source code, XML file, properties file, etc.). Views provide metadata about the currently selected resource. This data is pertinent to, but not directly related to, the actual contents of the resource (the contents would be accessed via an editor). Finally, a perspective represents a configuration of related editors and views as well as customized menu options, and compile settings. When we install the WASP plug-in in the next section, two new perspectives will be added to Eclipse: WASP Management and Web Service.

Installing the WASP Developer Plug-in
As of the writing of this article, the latest version of WASP Developer is 4.0.1, and the latest version of Eclipse is 2.0.2. By the time you read this article, these versions will probably have been updated. Consequently, the installation procedure may have changed. You should verify the installation procedure online (http://dev.systinet.com/documentation/index -> "WASP Developer for Eclipse"->"Installation"). Assuming WASP Developer 4.0.1, Eclipse 2.0.2, and JDK 1.4, the installation procedure is as follows:
1.   Unzip the WASP zip file into the parent directory for Eclipse (the WASP zip contains a folder named Eclipse, and subfolders that all assume the Eclipse 2.0.x directory structure).
2.   Create a script (or batch file) to invoke Eclipse with. The script requires only one line, and it passes important parameters into the tool that allow WASP to use some important security capabilities built into JRE 1.4 (JAAS and JCE). You can see the script contents in Listing 1.
3.   Launch Eclipse using this new startup script, rather than the usual executable (Eclipse.exe).

These simple instructions work only if you have JRE 1.4, which has JAAS, JSSE, and JCE embedded. If you have an older JDK, the process is as follows:
1.   Unzip the WASP zip file into the parent directory for Eclipse (the WASP zip contains a folder named Eclipse, and subfolders that all assume the Eclipse 2.0.x directory structure).
2.   In the Eclipse home directory, rename startup.jar to startup.jar.old. Next, rename wd-startup.jar to startup.jar.
3.   Open the ECLIPSE_HOME/plugins/com.syst inet.wasp_4.0.0/lib folder. Copy the file named security-ng.jar from this directory into the JAVA_HOME/jre/lib/ext directory.
4.   Launch Eclipse using the standard executable, Eclipse.exe.
5.   If you have JRE 1.3.1 and you want to utilize the security features built into WASP, you'll need to follow additional instructions included in the online documentation under the heading "Installing Java Security."

The second method will work for both JRE 1.3.1 and 1.4.x. I prefer the first method, as it requires that no actual changes be made to any JAR files. The second version will work fine until you decide to install an updated version of Eclipse. Then the startup.jar file could be overwritten with a pure Eclipse version, rendering the Systinet-specific launcher files unavailable. Now that you know that, however, you can be sure to save an archived copy of the WASP Developer startup JAR file in a safe place in case you need to reapply it after an upgrade.

Once you've opened the WASP zip file, you can access a local copy of the documentation if you prefer. Launch the following HTML file: ECLIPSE_HOME/plugins/com.systinet.waspdeveloper. eclipse.help_4.0.1/index0.html. This is the index to the WASP Developer for Eclipse documentation. It provides detailed installation instructions, as well as tutorials, a developer's guide, and links to additional resources.

WASP Developer Features
WASP Developer 4.0.1 comes with an impressive list of features, including:

  • Exposing any Java class as a Web service: Develop Java classes in Eclipse, or import existing ones and deploy them as Web services by right-clicking on the class name and selecting one of two Web service creation wizards.
  • Automatic generation of client-side stubs: Building a client to access a local service in development or a remote service in production is easy. A simple wizard walks you through the process of generating the client-side stubs and creates a client Java class for you to complete.
  • Map between Java and WSDL: You can produce a WSDL document for any service, and generate skeleton Java code from a WSDL document.
  • Inspect SOAP traffic: SOAPSpy allows you to inspect the raw SOAP traffic being exchanged between client and service. It is even possible to directly manipulate the SOAP message and resend it for testing purposes.
  • Full integration with UDDI: WASP Developer includes wizards to assist in publishing your Web services to a UDDI registry and getting information back from a UDDI registry to create Web services and their clients, or just to generate the WSDL for your project. No knowledge of UDDI is required.
  • Extensive Web services security capabilities: You can create Web services using authentication, authorization, and message integrity checks. WASP Developer ships with support for three security providers (WASP Security API for SSL, GSS-API/ SPKM and GSS-API/Kerberos, and HTTP Basic and Digest Authentication). It also supports the utilization of other security provider technologies via pluggable JAAS modules.
  • Local and remote debugging of services: Eclipse comes with built-in debugging capabilities for local applications, including breakpoints and access to the JVM stack. WASP Developer for Eclipse expands on these basic capabilities, and can debug remote WASP servers as well as the WASP server that is embedded with Eclipse via the plug-in. So long as the remote server has been started in debug mode (a command-line option), then the WASP Management console within Eclipse can attach to that remote server and debug it at runtime.

    Building, Deploying, and Testing a WASP Web Service
    Now we're ready to walk through the construction, deployment, and testing of a simple WASP Web service. We won't have the opportunity to explore every feature listed above, but we will get a solid sense of WASP Developer's capabilities as a Web service application development platform.

    Step 1: Transform a Java Class into a Web Service
    1.   Open the Web Service perspective (Win dow -> Open Perspective -> Other -> Web Service.
    2.   Create a Web Service project (New -> Project -> Select Systinet Web Services on the left, and Web Service Project on the right [see Figure 1]).

     


    3.   Click "Next."
    4.   Supply a project name and click "Finish."
    5.   Create a simple Java class with an instance field of type String, and a single business method, public String getMessage(), that returns the value of the instance field in the body of the method. See Listing 2 if you are unsure of how to do this.
    6.   Save and compile this class (compilation happens by default in Eclipse when you save). Resolve any errors that appear in the Task view.
    7.   Repeat the previous step until you get a clean build.
    8.   Start the WASP Server. In the WASP Server view (bottom left), find the Default WASP server, right-click on it, and select Start (see Figure 2).

     


    9.   In the Package Explorer view, right-click on the Java class that you have created, and select "Quickly Deploy as a Web Service" from the context menu (see Figure 3).

     


    10.   When the dialog box appears, select the default embedded WASP Server running on port 6060. Click the "Finish" button.
    11.   Verify the successful deployment of the service by expanding the Package Manager node underneath the Default server in the WASP Servers view. If you can't locate the service, attempt to redeploy it.

    Step 2: Generate a Java Client for Your Web Service
    1.   In the WASP Servers view, expand the Package Manager node underneath the Default server and locate your deployed service. An icon of a wrench and globe indicates the specific service. The text description should begin with '{urn:'. Right-click on this line and select "Create Client" from the context menu (see Figure 4).

     


    2.   When the dialog box appears, browse and select the package your class is a member of. Provide a name for the client in the third text field.
    3.   Click the "Finish" button.
    4.   A template class will be generated for you, along with local proxy classes that abstract the low-level SOAP messaging details from you.
    5.   Add a line after the last comment to invoke the getMessage() method on the service object and pass the resulting String object into a System.out.println() command. See Listing 3 for the complete client code.

    Step 3: Testing the Client and Service
    1.   Launch the client by selecting the client class and then clicking the running man icon in the toolbar, or through the menu system: Run -> Run...
    2.   When the Launch Configurations window comes up, click on the WASP Java Application configuration and click the "New" button.
    3.   Supply a name for the configuration at the top on the right-hand side.
    4.   Make sure that the correct project is selected. If not, then click the "browse..." button and select the correct project.
    5.   Verify that the correct class is displayed in the "Main Class" text field. Locate it through the "Search..." button if necessary.
    6.   Click the "Run" button to load the launcher configuration and execute the Web service client. In the future, you won't have to go through these steps again, you'll simply "run" the client class and these launcher settings will be used.
    7.   Watch the console output and verify that the client successfully invoked the service. The string message sent back by the service should be displayed in blue in the console output.

    Step 4: Inspecting SOAP with SOAPSpy
    1.   In the Web Services perspective, look for a tab labeled SOAPSpy in the same window area as the Package Explorer view. Select that tab and the SOAPSpy view will be pulled to the front.
    2.   According to the documentation, all you need to do to use SOAPSpy is to click the left-most SOAPSpy button at the top of the view (the bar of SOAP with sunglasses). This turns SOAPSpy on. Then you simply run the client application again. However, if you do this, nothing will happen.
    3.   After digging through several forums on Systinet's Web site, I discovered that the client code needs to be modified so that it uses your computer's actual name rather than localhost. Update both the serviceURI and the wsdlURI in the client source code. Save the changes and rerun the client. This time, you should see one or two entries appear in the SOAPSpy view.
    4.   By clicking on the entries in the SOAPSpy view, a SOAP editor is opened in the editor pane, allowing you to inspect the SOAP messages exchanged between client and service (see Figure 5). You can even modify the SOAP message and click the "Resend" button that appears at the bottom of the editor. This will circumvent the client and send the SOAP message directly to the targeted service.

     

    Avoiding the Sting of Web Services with WASP
    The WASP Server for Java and WASP Developer for Eclipse are mature tools that attempt to take the sting out of developing, deploying, and testing Web service-enabled applications. In this article we've just scraped the surface of what Eclipse and Systinet's WASP Developer can offer Web services developers. With the documentation and the developer resources available on Systinet's Web site (http://dev.systinet.com), you should be well on your way to using these tools to build powerful Web services with relative ease. Enjoy!

  • More Stories By Kyle Gabhart

    Kyle Gabhart is a subject matter expert specializing in strategic planning and tactical delivery of enterprise technology solutions, blending EA, BPM, SOA, Cloud Computing, and other emerging technologies. Kyle currently serves as a director for Web Age Solutions, a premier provider of technology education and mentoring. Since 2001 he has contributed extensively to the IT community as an author, speaker, consultant, and open source contributor.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @MicroservicesExpo Stories
    With continuous delivery (CD) almost always in the spotlight, continuous integration (CI) is often left out in the cold. Indeed, it's been in use for so long and so widely, we often take the model for granted. So what is CI and how can you make the most of it? This blog is intended to answer those questions. Before we step into examining CI, we need to look back. Software developers often work in small teams and modularity, and need to integrate their changes with the rest of the project code b...
    There is a huge demand for responsive, real-time mobile and web experiences, but current architectural patterns do not easily accommodate applications that respond to events in real time. Common solutions using message queues or HTTP long-polling quickly lead to resiliency, scalability and development velocity challenges. In his session at 21st Cloud Expo, Ryland Degnan, a Senior Software Engineer on the Netflix Edge Platform team, will discuss how by leveraging a reactive stream-based protocol,...
    In his session at 20th Cloud Expo, Mike Johnston, an infrastructure engineer at Supergiant.io, discussed how to use Kubernetes to set up a SaaS infrastructure for your business. Mike Johnston is an infrastructure engineer at Supergiant.io with over 12 years of experience designing, deploying, and maintaining server and workstation infrastructure at all scales. He has experience with brick and mortar data centers as well as cloud providers like Digital Ocean, Amazon Web Services, and Rackspace. H...
    SYS-CON Events announced today that Calligo has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Calligo is an innovative cloud service provider offering mid-sized companies the highest levels of data privacy. Calligo offers unparalleled application performance guarantees, commercial flexibility and a personalized support service from its globally located cloud platfor...
    Many organizations are now looking to DevOps maturity models to gauge their DevOps adoption and compare their maturity to their peers. However, as enterprise organizations rush to adopt DevOps, moving past experimentation to embrace it at scale, they are in danger of falling into the trap that they have fallen into time and time again. Unfortunately, we've seen this movie before, and we know how it ends: badly.
    "Outscale was founded in 2010, is based in France, is a strategic partner to Dassault Systémes and has done quite a bit of work with divisions of Dassault," explained Jackie Funk, Digital Marketing exec at Outscale, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    From personal care products to groceries and movies on demand, cloud-based subscriptions are fulfilling the needs of consumers across an array of market sectors. Nowhere is this shift to subscription services more evident than in the technology sector. By adopting an Everything-as-a-Service (XaaS) delivery model, companies are able to tailor their computing environments to shape the experiences they want for customers as well as their workforce.
    If you read a lot of business and technology publications, you might think public clouds are universally preferred over all other cloud options. To be sure, the numbers posted by Amazon Web Services (AWS) and Microsoft’s Azure platform are nothing short of impressive. Statistics reveal that public clouds are growing faster than private clouds and analysts at IDC predict that public cloud growth will be 3 times that of private clouds by 2019.
    "DivvyCloud as a company set out to help customers automate solutions to the most common cloud problems," noted Jeremy Snyder, VP of Business Development at DivvyCloud, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    "We focus on SAP workloads because they are among the most powerful but somewhat challenging workloads out there to take into public cloud," explained Swen Conrad, CEO of Ocean9, Inc., in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    "As we've gone out into the public cloud we've seen that over time we may have lost a few things - we've lost control, we've given up cost to a certain extent, and then security, flexibility," explained Steve Conner, VP of Sales at Cloudistics,in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    "Peak 10 is a hybrid infrastructure provider across the nation. We are in the thick of things when it comes to hybrid IT," explained , Chief Technology Officer at Peak 10, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    "I think DevOps is now a rambunctious teenager – it’s starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    "I will be talking about ChatOps and ChatOps as a way to solve some problems in the DevOps space," explained Himanshu Chhetri, CTO of Addteq, in this SYS-CON.tv interview at @DevOpsSummit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking questions to analyze and troubleshoot your infrastructure, to provisioning storage with snapshots, recovery and replication, your wildest sci-fi dream has come true. In his session at @DevOpsSummit at 20th Cloud Expo, Dan Florea, Director of Product Management at Tintri, provided a ChatOps demo where you can talk to your storage and manage it from anywhere, through Slack and similar services with...
    If you are thinking about moving applications off a mainframe and over to open systems and the cloud, consider these guidelines to prioritize what to move and what to eliminate. On the surface, mainframe architecture seems relatively simple: A centrally located computer processes data through an input/output subsystem and stores its computations in memory. At the other end of the mainframe are printers and terminals that communicate with the mainframe through protocols. For all of its apparen...
    DevOps at Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to w...
    "At the keynote this morning we spoke about the value proposition of Nutanix, of having a DevOps culture and a mindset, and the business outcomes of achieving agility and scale, which everybody here is trying to accomplish," noted Mark Lavi, DevOps Solution Architect at Nutanix, in this SYS-CON.tv interview at @DevOpsSummit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    For over a decade, Application Programming Interface or APIs have been used to exchange data between multiple platforms. From social media to news and media sites, most websites depend on APIs to provide a dynamic and real-time digital experience. APIs have made its way into almost every device and service available today and it continues to spur innovations in every field of technology. There are multiple programming languages used to build and run applications in the online world. And just li...
    Data reduction delivers compelling cost reduction that substantially improves the business case in every cloud deployment model. No matter which cloud approach you choose, the cost savings benefits from data reduction should not be ignored and must be a component of your cloud strategy. IT professionals are finding that the future of IT infrastructure lies in the cloud. Data reduction technologies enable clouds — public, private, and hybrid — to deliver business agility and elasticity at the lo...