Welcome!

Microservices Expo Authors: Yeshim Deniz, Pat Romanski, Todd Matters, Mark Leake, Stefana Muller

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
    Cloud Expo, Inc. has announced today that Andi Mann and Aruna Ravichandran have been named Co-Chairs of @DevOpsSummit at Cloud Expo Silicon Valley which will take place Oct. 31-Nov. 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. "DevOps is at the intersection of technology and business-optimizing tools, organizations and processes to bring measurable improvements in productivity and profitability," said Aruna Ravichandran, vice president, DevOps product and solutions marketing...
    "When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
    For most organizations, the move to hybrid cloud is now a question of when, not if. Fully 82% of enterprises plan to have a hybrid cloud strategy this year, according to Infoholic Research. The worldwide hybrid cloud computing market is expected to grow about 34% annually over the next five years, reaching $241.13 billion by 2022. Companies are embracing hybrid cloud because of the many advantages it offers compared to relying on a single provider for all of their cloud needs. Hybrid offers bala...
    A common misconception about the cloud is that one size fits all. Companies expecting to run all of their operations using one cloud solution or service must realize that doing so is akin to forcing the totality of their business functionality into a straightjacket. Unlocking the full potential of the cloud means embracing the multi-cloud future where businesses use their own cloud, and/or clouds from different vendors, to support separate functions or product groups. There is no single cloud so...
    Containers, microservices and DevOps are all the rage lately. You can read about how great they are and how they’ll change your life and the industry everywhere. So naturally when we started a new company and were deciding how to architect our app, we went with microservices, containers and DevOps. About now you’re expecting a story of how everything went so smoothly, we’re now pushing out code ten times a day, but the reality is quite different.
    "We are a monitoring company. We work with Salesforce, BBC, and quite a few other big logos. We basically provide monitoring for them, structure for their cloud services and we fit into the DevOps world" explained David Gildeh, Co-founder and CEO of Outlyer, 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.
    21st International Cloud Expo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Me...
    If you cannot explicitly articulate how investing in a new technology, changing the approach or re-engineering the business process will help you achieve your customer-centric vision of the future in direct and measurable ways, you probably shouldn’t be doing it. At Intellyx, we spend a lot of time talking to technology vendors. In our conversations, we explore emerging new technologies that are either disrupting the way enterprise organizations work or that help enable those organizations to ...
    In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, Doug Vanderweide, an instructor at Linux Academy, discussed why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers wit...
    The taxi industry never saw Uber coming. Startups are a threat to incumbents like never before, and a major enabler for startups is that they are instantly “cloud ready.” If innovation moves at the pace of IT, then your company is in trouble. Why? Because your data center will not keep up with frenetic pace AWS, Microsoft and Google are rolling out new capabilities. In his session at 20th Cloud Expo, Don Browning, VP of Cloud Architecture at Turner, posited that disruption is inevitable for comp...
    For organizations that have amassed large sums of software complexity, taking a microservices approach is the first step toward DevOps and continuous improvement / development. Integrating system-level analysis with microservices makes it easier to change and add functionality to applications at any time without the increase of risk. Before you start big transformation projects or a cloud migration, make sure these changes won’t take down your entire organization.
    There's a lot to gain from cloud computing, but success requires a thoughtful and enterprise focused approach. Cloud computing decouples data and information from the infrastructure on which it lies. A process that is a LOT more involved than dragging some folders from your desktop to a shared drive. Cloud computing as a mission transformation activity, not a technological one. As an organization moves from local information hosting to the cloud, one of the most important challenges is addressi...
    What's the role of an IT self-service portal when you get to continuous delivery and Infrastructure as Code? This general session showed how to create the continuous delivery culture and eight accelerators for leading the change. Don Demcsak is a DevOps and Cloud Native Modernization Principal for Dell EMC based out of New Jersey. He is a former, long time, Microsoft Most Valuable Professional, specializing in building and architecting Application Delivery Pipelines for hybrid legacy, and cloud ...
    Companies have always been concerned that traditional enterprise software is slow and complex to install, often disrupting critical and time-sensitive operations during roll-out. With the growing need to integrate new digital technologies into the enterprise to transform business processes, this concern has become even more pressing. A 2016 Panorama Consulting Solutions study revealed that enterprise resource planning (ERP) projects took an average of 21 months to install, with 57 percent of t...
    Microservices are increasingly used in the development world as developers work to create larger, more complex applications that are better developed and managed as a combination of smaller services that work cohesively together for larger, application-wide functionality. Tools such as Service Fabric are rising to meet the need to think about and build apps using a piece-by-piece methodology that is, frankly, less mind-boggling than considering the whole of the application at once. Today, we'll ...
    In his session at Cloud Expo, Alan Winters, an entertainment executive/TV producer turned serial entrepreneur, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to ma...
    Hybrid IT is today’s reality, and while its implementation may seem daunting at times, more and more organizations are migrating to the cloud. In fact, according to SolarWinds 2017 IT Trends Index: Portrait of a Hybrid IT Organization 95 percent of organizations have migrated crucial applications to the cloud in the past year. As such, it’s in every IT professional’s best interest to know what to expect.
    Both SaaS vendors and SaaS buyers are going “all-in” to hyperscale IaaS platforms such as AWS, which is disrupting the SaaS value proposition. Why should the enterprise SaaS consumer pay for the SaaS service if their data is resident in adjacent AWS S3 buckets? If both SaaS sellers and buyers are using the same cloud tools, automation and pay-per-transaction model offered by IaaS platforms, then why not host the “shrink-wrapped” software in the customers’ cloud? Further, serverless computing, cl...
    In the decade following his article, cloud computing further cemented Carr’s perspective. Compute, storage, and network resources have become simple utilities, available at the proverbial turn of the faucet. The value they provide is immense, but the cloud playing field is amazingly level. Carr’s quote above presaged the cloud to a T. Today, however, we’re in the digital era. Mark Andreesen’s ‘software is eating the world’ prognostication is coming to pass, as enterprises realize they must be...
    Colocation is a central pillar of modern enterprise infrastructure planning because it provides greater control, insight, and performance than managed platforms. In spite of the inexorable rise of the cloud, most businesses with extensive IT hardware requirements choose to host their infrastructure in colocation data centers. According to a recent IDC survey, more than half of the businesses questioned use colocation services, and the number is even higher among established businesses and busin...