Contents


Automate project deployment using the Management API for WebSphere Cast Iron Cloud integration

WebSphere Cast Iron (hereafter called Cast Iron) provides a platform to integrate cloud-based applications from leading SaaS providers with on-premise applications from IBM® and other companies. Cast Iron allows you to develop interfaces with little programming experience. You can easily use it as a drag and drop development tool to build complex integration flows in days.

Cast Iron provides the following implementation models:

  • Appliance model: The appliance can be either a physical hardware or a virtual machine. The Integration Appliance is installed on-premise behind the firewall.
  • SaaS model (Cast Iron Live): Each of the three form factors (physical, virtual, or Cast Iron Live) allows for cloud-to-cloud, cloud to on-premise, and on-premise to on-premise integration. Each form factor allows for real-time, near real-time, and batch integrations.

Overview of WebSphere Cast Iron Studio

You can build integration flows in Cast Iron Studio (hereafter called Studio), which is a graphical development environment that is installed to a personal computer. With Studio, you create an integration project that contains one or more orchestrations. Each orchestration is built with a number of activities that define the flow of data. You can define the details of an activity from the configuration panes within Studio. A project contains all of the assets that are required for the orchestrations to run, including any file schemas, WSDL files, and functions. The project also defines connectivity to the sources of data, such as the endpoints. Cast Iron contains many built-in connectors to applications (for example SAP®, JD Edwards®, PeopleSoft®, Siebel®), databases, and Web services that make connecting to these endpoints straightforward.

Using the Management API

The management of the Cast Iron runtime involves administration tasks, such as orchestration management, appliance upgrades, and problem identification. You can manage the Cast Iron runtime using any of the three different interfaces:

  • Management API (Web services)
  • Command line interface (CLI)
  • Web management console (WMC)

The Management API is a Web service layer that allows administration of the Cast Iron runtime using Web service calls to perform tasks, such as configuration management, security configuration, and other areas. You can use the Management API for the following tasks:

  • Build scripts for automation.
  • Create your own client application for management.

The following WSDL files are available in both the Integration Appliance and in Cast Iron Live:

  • Security.wsdl
  • Staging.wsdl
  • Deployment.wsdl
  • System.wsdl
  • Orcmon.wsdl
  • Lognotif.wsdl

Automating project deployment to the appliance

In this section, you will learn how to build a simple orchestration that publishes a project to an appliance using a configuration and a "no coding" approach. You will publish a project that is stored in a secure FTP server. The file is retrieved using the FTP connector. The Web service connector is configured to work with the Security and Deployment WSDL. You can use the webservice connector to publish and start the project.

The orchestration receives the following parameters through an HTTP Receive Request activity. These are the credentials of the appliance that you need to publish the project and also the file name of the project to be published. The location of the WSDLs and the FTP server details are stored as configuration properties as shown in Table 1. You can customize and modify the project according to your needs.

Table 1. Configuration properties
NameTypeDescription
SecurityWsdlURLPasswordURL of the security webservice endpoint
DeploymentWsdlURLstringURL of the deployment webservice endpoint
FTPHostNamestringHost name of the FTP server
FTPPasswordstringPassword of the FTP user account
FTPPortstringPort of the host server that the FTP service is listening on
FTPInDirectorystringTarget directory on the FTP server where the projects will be stored
FTPUsernamestringUsername of the FTP user account
HTTPReceiverPortstringPort of the appliance to listen for HTTP requests

The deployment WSDL contains information that works with the configuration, rules, and projects. The security WSDL contains a login operation that is used to establish a Management API session. The deployment WSDL contains a publish project, which is used to deploy the project to the appliance or cloud. The first step is to download the WSDL that you want to work with, which is the Security and Deployment WSDL. To download the Security and WSDL, point your Web browser to its location on your appliance at https://appliance-management-port/ws/security?wsdl and save the XML-encoded response to a file. Similarly, download the Deployment WSDL by pointing to https://appliance-management-port/ws/deployment?wsdl.

After you have downloaded the WSDLs, you need to import them in Studio as described below:

  1. Download the Deployment and Security WSDL.
  2. Import the WSDL to Studio.
  3. Use the webservice connector Invoke activity to invoke the service. You will use the Invoke activity to invoke the login method in the Security WSDL to get the session, one more invoke to call the deploy and start method, and the logoff method in the Deployment WSDL.
    Figure 1. Automate the deployment of the project viewed in Cast Iron Studio
    Automate the deployment of project viewed in Castiron Studio
    Automate the deployment of project viewed in Castiron Studio

    Figure 1 shows the orchestration flow that we used to automate the project:

    • Use the Receive request as the starter activity to receive user inputs on the appliance credentials (user name, password) and the name of the project that needs to be deployed.
    • Read the input received from the Receive request using the Read XML to parse the data. This activity takes a single string as its input parameter and returns a variable containing the parsed XML structure.
    • Use the Map variable (Figure 2) to copy the file name to the string and pass that string to the FTP Get File activity.
    Figure 2. Map variable
    Map variable
    Map variable
  4. Use the FTP GetFile activity (Figure 3) to get the project file, which you need to deploy to the appliance.
    Figure 3. FTP GET activity
    FTP GET activity
    FTP GET activity
  5. Use the Webservice Invoke activity with the Security WSDL to login to the appliance and get the session ID (Figure 4), which is required to deploy the project and start the project in subsequent calls.
    Figure 4. Web service Invoke getting Session ID
    Webservice Invoke getting Session ID
    Webservice Invoke getting Session ID
  6. Configure a Webservice Invoke activity, which is configured with the Deployment WSDL. Select the PublishProject service call (Figure 5) to deploy the project. This call requires the session ID and content to be passed. The content from the GetFile activity and session ID is populated.
    Figure 5. Webservice Invoke for publishing the project
    Webservice                     Invoke for publishing the project
    Webservice Invoke for publishing the project
  7. Configure a Webservice Invoke activity (Figure 6), which is configured with the Deployment WSDL. Select the Start service call to start the project. This activity requires the session ID, projectName, configName, and version. The default values are provided for the configName and for the version as 1.0. The file name is being passed as a value to the ProjectName.
    Figure 6. Webservice Invoke to start the deployed project
    Webservice Invoke to start the deployed project
    Webservice Invoke to start the deployed project
  8. Configure a Webservice Invoke activity, which is configured with the security WSDL. Select the Logout service call (Figure 7) to log out from the appliance. This activity requires the Session ID. The Session ID is obtained from the Security WSDL login.
    Figure 7. Webservice invoke for performing logout operation from appliance
    Webservice Invoke for performing logout operation from appliance
    Webservice Invoke for performing logout operation from appliance

You have now configured the orchestration to automate the deployment of the project. You can verify the project in Studio before publishing it to the appliance.

Conclusion

If you need a more flexible way to manage and monitor your Cast Iron appliances and orchestrations that goes beyond what the WMC and CLI interfaces provide, the WebSphere Cast Iron Management API is the answer. In this article, we have demonstrated the process of automating a project deployment, which can be further extended to perform other administrative tasks.


Downloadable resources


Related topics

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Middleware
ArticleID=1024313
ArticleTitle=Automate project deployment using the Management API for WebSphere Cast Iron Cloud integration
publish-date=12162015