Welcome!

Microservices Expo Authors: Stackify Blog, Aruna Ravichandran, Dalibor Siroky, Kevin Jackson, PagerDuty Blog

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
    How is DevOps going within your organization? If you need some help measuring just how well it is going, we have prepared a list of some key DevOps metrics to track. These metrics can help you understand how your team is doing over time. The word DevOps means different things to different people. Some say it a culture and every vendor in the industry claims that their tools help with DevOps. Depending on how you define DevOps, some of these metrics may matter more or less to you and your team.
    For many of us laboring in the fields of digital transformation, 2017 was a year of high-intensity work and high-reward achievement. So we’re looking forward to a little breather over the end-of-year holiday season. But we’re going to have to get right back on the Continuous Delivery bullet train in 2018. Markets move too fast and customer expectations elevate too precipitously for businesses to rest on their laurels. Here’s a DevOps “to-do list” for 2018 that should be priorities for anyone w...
    If testing environments are constantly unavailable and affected by outages, release timelines will be affected. You can use three metrics to measure stability events for specific environments and plan around events that will affect your critical path to release.
    In a recent post, titled “10 Surprising Facts About Cloud Computing and What It Really Is”, Zac Johnson highlighted some interesting facts about cloud computing in the SMB marketplace: Cloud Computing is up to 40 times more cost-effective for an SMB, compared to running its own IT system. 94% of SMBs have experienced security benefits in the cloud that they didn’t have with their on-premises service
    DevOps failure is a touchy subject with some, because DevOps is typically perceived as a way to avoid failure. As a result, when you fail in a DevOps practice, the situation can seem almost hopeless. However, just as a fail-fast business approach, or the “fail and adjust sooner” methodology of Agile often proves, DevOps failures are actually a step in the right direction. They’re the first step toward learning from failures and turning your DevOps practice into one that will lead you toward even...
    DevOps is under attack because developers don’t want to mess with infrastructure. They will happily own their code into production, but want to use platforms instead of raw automation. That’s changing the landscape that we understand as DevOps with both architecture concepts (CloudNative) and process redefinition (SRE). Rob Hirschfeld’s recent work in Kubernetes operations has led to the conclusion that containers and related platforms have changed the way we should be thinking about DevOps and...
    While walking around the office I happened upon a relatively new employee dragging emails from his inbox into folders. I asked why and was told, “I’m just answering emails and getting stuff off my desk.” An empty inbox may be emotionally satisfying to look at, but in practice, you should never do it. Here’s why. I recently wrote a piece arguing that from a mathematical perspective, Messy Desks Are Perfectly Optimized. While it validated the genius of my friends with messy desks, it also gener...
    The goal of Microservices is to improve software delivery speed and increase system safety as scale increases. Microservices being modular these are faster to change and enables an evolutionary architecture where systems can change, as the business needs change. Microservices can scale elastically and by being service oriented can enable APIs natively. Microservices also reduce implementation and release cycle time and enables continuous delivery. This paper provides a logical overview of the Mi...
    The next XaaS is CICDaaS. Why? Because CICD saves developers a huge amount of time. CD is an especially great option for projects that require multiple and frequent contributions to be integrated. But… securing CICD best practices is an emerging, essential, yet little understood practice for DevOps teams and their Cloud Service Providers. The only way to get CICD to work in a highly secure environment takes collaboration, patience and persistence. Building CICD in the cloud requires rigorous ar...
    The enterprise data storage marketplace is poised to become a battlefield. No longer the quiet backwater of cloud computing services, the focus of this global transition is now going from compute to storage. An overview of recent storage market history is needed to understand why this transition is important. Before 2007 and the birth of the cloud computing market we are witnessing today, the on-premise model hosted in large local data centers dominated enterprise storage. Key marketplace play...
    The cloud revolution in enterprises has very clearly crossed the phase of proof-of-concepts into a truly mainstream adoption. One of most popular enterprise-wide initiatives currently going on are “cloud migration” programs of some kind or another. Finding business value for these programs is not hard to fathom – they include hyperelasticity in infrastructure consumption, subscription based models, and agility derived from rapid speed of deployment of applications. These factors will continue to...
    Some people are directors, managers, and administrators. Others are disrupters. Eddie Webb (@edwardawebb) is an IT Disrupter for Software Development Platforms at Liberty Mutual and was a presenter at the 2016 All Day DevOps conference. His talk, Organically DevOps: Building Quality and Security into the Software Supply Chain at Liberty Mutual, looked at Liberty Mutual's transformation to Continuous Integration, Continuous Delivery, and DevOps. For a large, heavily regulated industry, this task ...
    Following a tradition dating back to 2002 at ZapThink and continuing at Intellyx since 2014, it’s time for Intellyx’s annual predictions for the coming year. If you’re a long-time fan, you know we have a twist to the typical annual prediction post: we actually critique our predictions from the previous year. To make things even more interesting, Charlie and I switch off, judging the other’s predictions. And now that he’s been with Intellyx for more than a year, this Cortex represents my first ...
    "Grape Up leverages Cloud Native technologies and helps companies build software using microservices, and work the DevOps agile way. We've been doing digital innovation for the last 12 years," explained Daniel Heckman, of Grape Up in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    The Toyota Production System, a world-renowned production system is based on the "complete elimination of all waste". The "Toyota Way", grounded on continuous improvement dates to the 1860s. The methodology is widely proven to be successful yet there are still industries within and tangential to manufacturing struggling to adopt its core principles: Jidoka: a process should stop when an issue is identified prevents releasing defective products
    We seem to run this cycle with every new technology that comes along. A good idea with practical applications is born, then both marketers and over-excited users start to declare it is the solution for all or our problems. Compliments of Gartner, we know it generally as “The Hype Cycle”, but each iteration is a little different. 2018’s flavor will be serverless computing, and by 2018, I mean starting now, but going most of next year, you’ll be sick of it. We are already seeing people write such...
    Defining the term ‘monitoring’ is a difficult task considering the performance space has evolved significantly over the years. Lately, there has been a shift in the monitoring world, sparking a healthy debate regarding the definition and purpose of monitoring, through which a new term has emerged: observability. Some of that debate can be found in blogs by Charity Majors and Cindy Sridharan.
    It’s “time to move on from DevOps and continuous delivery.” This was the provocative title of a recent article in ZDNet, in which Kelsey Hightower, staff developer advocate at Google Cloud Platform, suggested that “software shops should have put these concepts into action years ago.” Reading articles like this or listening to talks at most DevOps conferences might make you think that we’re entering a post-DevOps world. But vast numbers of organizations still struggle to start and drive transfo...
    Let's do a visualization exercise. Imagine it's December 31, 2018, and you're ringing in the New Year with your friends and family. You think back on everything that you accomplished in the last year: your company's revenue is through the roof thanks to the success of your product, and you were promoted to Lead Developer. 2019 is poised to be an even bigger year for your company because you have the tools and insight to scale as quickly as demand requires. You're a happy human, and it's not just...
    "Opsani helps the enterprise adopt containers, help them move their infrastructure into this modern world of DevOps, accelerate the delivery of new features into production, and really get them going on the container path," explained Ross Schibler, CEO of Opsani, and Peter Nickolov, CTO of Opsani, in this SYS-CON.tv interview at DevOps Summit at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.