Welcome!

Microservices Expo Authors: LeanTaaS Blog, Derek Weeks, Don MacVittie, Karthick Viswanathan, Gopala Krishna Behara

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
    The notion of improving operational efficiency is conspicuously absent from the healthcare debate - neither Obamacare nor the newly proposed GOP plan discusses the impact that a step-function improvement in efficiency could have on access to healthcare (through more capacity), quality of healthcare services (through reduced wait times for patients) or cost (through better utilization of scarce, expensive assets).
    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...
    Our work, both with clients and with tools, has lead us to wonder how it is that organizations are handling compliance issues in the cloud. The big cloud vendors offer compliance for their infrastructure, but the shared responsibility model requires that you take certain steps to meet compliance requirements. Which lead us to start poking around a little more. We wanted to get a picture of what was available, and how it was being used. There is a lot of fluidity in this space, as in all things c...
    Gone are the days when application development was the daunting task of the highly skilled developers backed with strong IT skills, low code application development has democratized app development and empowered a new generation of citizen developers. There was a time when app development was in the domain of people with complex coding and technical skills. We called these people by various names like programmers, coders, techies, and they usually worked in a world oblivious of the everyday pri...
    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 “Digital Era” is forcing us to engage with new methods to build, operate and maintain applications. This transformation also implies an evolution to more and more intelligent applications to better engage with the customers, while creating significant market differentiators. In both cases, the cloud has become a key enabler to embrace this digital revolution. So, moving to the cloud is no longer the question; the new questions are HOW and WHEN. To make this equation even more complex, most ...
    Some journey to cloud on a mission, others, a deadline. Change management is useful when migrating to public, private or hybrid cloud environments in either case. For most, stakeholder engagement peaks during the planning and post migration phases of a project. Legacy engagements are fairly direct: projects follow a linear progression of activities (the “waterfall” approach) – change managers and application coders work from the same functional and technical requirements. Enablement and develo...
    Admiral Calcote - also known as Lee Calcote (@lcalcote) or the Ginger Geek to his friends - gave a presentation entitled Characterizing and Contrasting Container Orchestrators at the 2016 All Day DevOps conference. Okay, he isn't really an admiral - nor does anyone call him that - but he used the title admiral to describe what container orchestrators do, relating it to an admiral directing a fleet of container ships. You could also say that they are like the conductor of an orchestra, directing...
    The past few years have brought a sea change in the way applications are architected, developed, and consumed—increasing both the complexity of testing and the business impact of software failures. How can software testing professionals keep pace with modern application delivery, given the trends that impact both architectures (cloud, microservices, and APIs) and processes (DevOps, agile, and continuous delivery)? This is where continuous testing comes in. D
    Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
    The dynamic nature of the cloud means that change is a constant when it comes to modern cloud-based infrastructure. Delivering modern applications to end users, therefore, is a constantly shifting challenge. Delivery automation helps IT Ops teams ensure that apps are providing an optimal end user experience over hybrid-cloud and multi-cloud environments, no matter what the current state of the infrastructure is. To employ a delivery automation strategy that reflects your business rules, making r...
    Gaining visibility in today’s sprawling cloud infrastructure is complex and laborious, involving drilling down into tools offered by various cloud services providers. Enterprise IT organizations need smarter and effective tools at their disposal in order to address this pertinent problem. Gaining a 360 - degree view of the cloud costs requires collection and analysis of the cost data across all cloud infrastructures used inside an enterprise.
    SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone in...
    Kubernetes is an open source system for automating deployment, scaling, and management of containerized applications. Kubernetes was originally built by Google, leveraging years of experience with managing container workloads, and is now a Cloud Native Compute Foundation (CNCF) project. Kubernetes has been widely adopted by the community, supported on all major public and private cloud providers, and is gaining rapid adoption in enterprises. However, Kubernetes may seem intimidating and complex ...
    You know you need the cloud, but you’re hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You’re looking at private cloud solutions based on hyperconverged infrastructure, but you’re concerned with the limits inherent in those technologies.
    For DevOps teams, the concepts behind service-oriented architecture (SOA) are nothing new. A style of software design initially made popular in the 1990s, SOA was an alternative to a monolithic application; essentially a collection of coarse-grained components that communicated with each other. Communication would involve either simple data passing or two or more services coordinating some activity. SOA served as a valid approach to solving many architectural problems faced by businesses, as app...
    Many IT organizations have come to learn that leveraging cloud infrastructure is not just unavoidable, it’s one of the most effective paths for IT organizations to become more responsive to business needs. Yet with the cloud comes new challenges, including minimizing downtime, decreasing the cost of operations, and preventing employee burnout to name a few. As companies migrate their processes and procedures to their new reality of a cloud-based infrastructure, an incident management solution...
    Cloud Governance means many things to many people. Heck, just the word cloud means different things depending on who you are talking to. While definitions can vary, controlling access to cloud resources is invariably a central piece of any governance program. Enterprise cloud computing has transformed IT. Cloud computing decreases time-to-market, improves agility by allowing businesses to adapt quickly to changing market demands, and, ultimately, drives down costs.
    Recent survey done across top 500 fortune companies shows almost 70% of the CIO have either heard about IAC from their infrastructure head or they are on their way to implement IAC. Yet if you look under the hood while some level of automation has been done, most of the infrastructure is still managed in much tradition/legacy way. So, what is Infrastructure as Code? how do you determine if your IT infrastructure is truly automated?
    Every few years, a disruptive force comes along that prompts us to reframe our understanding of what something means, or how it works. For years, the notion of what a computer is and how you make one went pretty much unchallenged. Then virtualization came along, followed by cloud computing, and most recently containers. Suddenly the old rules no longer seemed to apply, or at least they didn’t always apply. These disruptors made us reconsider our IT worldview.