June 2002
If you want to get a competitive advantage in the unpredictable e-commerce world, you must quickly bring new features to the market. New enterprise applications ("New New Human") usually use the original programs, these original programs are used in various languages ("Old Seniors" such as C and COBOL), they are in the enterprise information system (Enterprise Information) System (e.) (such as CICS, IMS) or various ERP systems run. Web services provide mechanisms that utilize these programs in a unified, open manner. This article describes how to create a web service using tools and capabilities provided by WebSphere Studio Application Developer Integration Edition, V4.1. The author includes an example in this article, which describes how two companies integrate their procedures and access existing CICS programs.
Introduction IBM WebSphere Studio Application Developer Integration Edition, V4.1 (Application Developer Integration Edition) provides an open standard tool, such an open standard has a simple object access protocol (SIMPLE Object Access Protocol (SOAP)), Web Service Description Language (Web Services Description Language (WSDL)) and Web Service Invocation Framework (WSIF)). These tools also support the J2EE Connector Architecture (J2EE Connector Architecture (JCA), JCA is important for accessing existing non-relational EIS systems.
In this article, we describe how to create a web service using the Application Developer Integration Edition component. This article uses an example, which describes how two companies need to integrate their procedures, and we demonstrate a web-based enterprise-based enterprise (B2B) integration method and demonstrate how to access existing CICS programs.
WebSphere Studio Application Developer Integration Edition WebSphere Studio Application Developer has two versions: Basic versions with tools for basic development work and Integration Edition for creating larger enterprise applications.
Basic version
Includes everything you need to build a standard J2EE application, such as tools for the following purposes:
Writing, debugging, and testing Java code development web applications (including HTML, JavaServer Pages (JSP) technology and servlets) Develop Enterprise JavaBeans (EJB) to write and use XML documents
Application Developer Integration Edition
Includes all basic functions and adds tools for web services for B2B-based enterprise intensity Web services. Enterprise Services Toolkit offers innovative tools to maximize the production efficiency of developers, these tools are:
High-level, serving-centric programming models (constructed above the EJB component), the model liberates the developer from the complexity of EJB programming. Tools for service discovery and transaction metadata capture. Treat a special editor for the WSDL file. Tools for creating a Java implementation framework from Java Enterprise Services. Compliance with the JCA resource adapter for transaction-based access to the EIS system. An extension, you can add it to your own resource adapter so that the adapter is compatible with the Application Developer Integration Edition tool. Special perspective in IDE - Enterprise Services perspective, used to support corporate application developers activities. The service generated by this perspective is a reusable component. Let you use multiple services and create an editor of business logic between them. A wizard for automated service packaging and deployment. Tools for creating a Java agent to call Java companies. Application Developer Integration Edition provides the following JCA resource adapters:
CICS ECI resource adapter for accessing a program on a CICS server is used to access the 3270 program of the 3270 program on the CICS server for accessing the HOD 3270 resource adapter for host systems with 3270 screens for accessing IMS programs on the IMS server. IMS resource adapter
You can use these development resource adapters to develop and test enterprise services, but when you deploy services to the production environment, you need to license for the runtime resource adapter.
Assume that you have a resource adapter not listed above. Application Developer Integration Edition has some extensions, which is known as JCA plugins. Extensions can be added to any existing resource adapter that meets JCA. Once an extension is added, your resource adapter is compatible with the Application Developer Integration Edition development tool. The article "Enabling A J2EE Resource Adapter" provides more information about these extensions.
Figure 1 shows the relationship between Application Developer and the Application Developer Integration Edition component.
Figure 1. Relationship between Application Developer and Application Developer Integration Edition
Integrating an EIS system in the service typically, to integrate programs on the EIS system (you often find this in the old application), you must take these steps:
Import the program source file (eg, COBOL COPYBOOK) and generate metadata that describes the program input and output. The generated WSDL code is serialized. Generate EJB-based deployment code for services, including code acting as an old program agent. Create a WSDL service definition to describe the service that will call the transaction. Service definition will allow you to be deployed from a unit test or a production environment. This service is tested and then deployed to the production environment.
In the next section, we will use a case study involving B2B and enterprise integration to discuss in these areas.
Case Study: Travel SimplifiedTravel Simplified is a fictional travel agency that hopes to develop a website for its customers. Any Internet user using a browser can access the site. This site must support the following cases:
The user is logged in and browsing the services available on the site. The site generates a tourism option based on the departure and destination provided by the user. Users book aircraft, cars and train tickets. The user completes the transaction by providing a credit card number.
Figure 2 shows a collection of services (provided by other organizations) and the EIS system to support the necessary use cases to be accessed and integrated (provided by other organizations) and the EIS system. Figure 2. Collection of EIS systems and services to integrate
For developers of Travel Simplified Websites, the main goals and challenges are seamless views from the user's angle. Customers using the site do not have to know the service from other organizations that are running from different EIS systems. Web services provide an ideal and unified B2B integration solution.
Figure 3 shows the Travel Simplified website architecture.
Figure 3. Site architecture: Travel Simplified
Build Suppliers: Simplified Airlines must have other agencies to provide this service before Travel Simplified provides flight booking services to customers. Simplified Airlines is one of the suppliers, this is a fictional airline that decides to provide its reservation system through the Internet. Figure 4 shows the SIMPLIPIED Airlines website architecture. The application written by the company's business partners can access the Simplified Airlines service through the SOAP and HTTP protocols.
Figure 4. Site Architecture: Simplified Airlines
The Simplified Airlines IT infrastructure is built around large agencies that run the COBOL program under CICS. These programs provide the company to make its business partners, such as:
Look for booking information Booking information (Date, time, flight number)
These functions constitute the basis of the Simplified Airline service interface. In the following sections, we will focus on how to integrate a single feature - a function that allows the subscription query by the subscription identifier. The steps of combining other functions are the same. The transaction name is RESBYID. We will use the CICS ECI protocol to access this feature. We will also ensure that we can use the SOAP protocol to access our new services through the Internet.
The following is the steps taken when we use Application Developer Integration Edition to build and test services. In-depth explanation of each step when we gradually perform an example:
Create a CICS ECI service
Creating a Service Project Importing COBOL or CF Create a CICS ECI Service Definition Generating an Inbound Channel for Services and Deployed Codes Using SOAP Agents Test your service
Create a SOAP proxy client code test service for service
Creating the first batch of tasks in CICS ECI Services Enterprise Services includes definition services. Defining services means a WSDL file for it creates an item and creates a detailed description (such as namespace and port type (interface) name). You also need to determine the connection factory information because it is to be used to establish a connection between WSDL services and CICS servers. You can then populate the operation in the WSDL file by importing CICS COBOL or C programs that contains input or output structures on the CICS server.
Creating a Service Project Start Application Developer Integration Edition Launch Enterprise Services perspective. The perspective is similar to the reference frame. In the service navigation, three folders are displayed:
Service Projects - You have created a list of business services. Deployed Services - Your deployed service list. Resource Adapters - You can use to access the list of resource adapters of different Eis.
To start creating a service, launch the Service Project Wizard and provide a project name. Once this wizard is completed, start the Service Providers Browser tool (as shown in Figure 5 below). This tool is the starting point for the service creation task. For example, selecting a CICS ECI link will navigate to a tool to create a service that accesses the CICS ECI program. Figure 5. Creating a Service Project and Opens Service Providers Browser
Importing a COBOL or C file When you define an operation of a CICS ECI program, you import COBOL or C files to define the inputs and outputs of the WSDL format. Before you try to define your operation, you must import the COBOL or C file from the local file system into the workbench.
Application Developer Integration Edition makes it easy. Select your newly created item, then click the Create a Java Package icon on the Application Developer Integration Edition toolbar. Once you have created a package, use the import function to import your COBOL or C files. After importing your COBOL file into the workbench, you can develop a service definition.
Creating a CICS ECI Services Definition Creating a CICS ECI Service Definition is the core in the development of enterprise service, and Application Developer Integration Edition has a tool that makes this work as simple as possible.
You start from selecting CICS ECI from the service provider list, as shown in Figure 5 above. The service defines the WSDL file description generated by Application Developer Integration Edition. (For more information about WSDL, see the WSDL specification in the reference.) In short, it uses XML to define services. The service definition created in WSDL format describes a system request format that is not related to the runtime implementation. Service definitions describe the location of the service to deploy the service and the operations available to the application using the service.
Selecting the CICS ECI as the service provider will open a connection feature page. Enter the connection value of a particular CICS server, as shown in Figure 6.
Figure 6. Connection features of CICS ECI services
Choosing Add Service will guide you to fill out the name of the WSDL, such as namespace (which is unique), your service logical namespace and port type (which groups related operations). Namespaces are used to generate Java packages. For example, if the namespace you specify is http://sample.ibm.com/, the name of the Java package of the generated code is reversed: com.ibm.sample.
Use tools will bring you some flexibility. For example, you can choose to make the generated XSD mode inline - in the created WSDL file or separated from it. When using a COBOL or C import tool, the type of XSD mode is always inline. Figure 7 shows a page with a folder and a name of your service.
Figure 7. Name Space and Port Type of Defining Service
After completing the Add Service feature, a WSDL implementation (service) and interface file are created. Open the implementation WSDL file on the Binding page of the WSDL editor. Usually you can use the port type to group related operations (for example, combining all operations for performing queries and update bank accounts). In the Binding page, you can define the operation of each CICS ECI program you want to access. You can implement this by creating a new action (this will fill in the interface with the port type and message, XSD type, and the XSD type, and the matching operation of the matching operation, and each type of group information) WSDL).
When an operation is created, the first step is to specify an ECI operation binding feature. These features are mapped to the ECIINTERACTIONSPEC, and the details you need to know in order to exchange input and output information in order to and CICS servers (declaration function name, which identifies the CICS program called on the CICS server). Then you need to create an input and output message in WSDL format, which will map to the input and output operations of the CICS program. The combination of these steps will create methods we use to call CICS transactions. In terms of service definition, Application Developer Integration Edition has a tool that allows you to associate WSDL to the COBOL structure you previously imported. First, by using the tool to identify the function name, as shown in Figure 8.
Figure 8. Bind the characteristics with the function name
Continue to create a service operation to specify a name for the operation. Name usually reflects the operation of the function. We use GetReServationInfo because you want to use this function to query your subscription data. You can define input and output messages by using the import function and select the file you previously imported into the table; it contains the input and output type of the function. After identifying the COBOL or C file, the tool gives you an opportunity to specify any platform-specific features (such as code pages, floating point formats, tail numbers, etc.), as shown in Figure 9.
Figure 9. Platform-specific features
Once the platform features are specified, you select your service to communicate from the COBOL Level 1 or C structure communication area used in the COBOL or C file. Your service definition is almost completed, but the tool still gives you a few options. For example, you can choose to use the input message as an output message. In the case where the CICS program can return to different output data, you can create multiple possible outputs for your own operations.
In the last step, the tool fills the operation, input, and output messages, and the type of types to implement and interface WSDL files. Application Developer Integration Edition displays the code in a Visual format, as shown in Figure 10; you can also use the WSDL source code to view it. Note: Application Developer Integration Edition is obviously (in you do not think) to process the group code. At runtime, the data from the CICS server will be placed in the stream suitable for transferring on the network, which can be dispersed if necessary.
Figure 10. Service definition of audible format
There are two aspects of deploying services to test environment: Pack your service file into the Enterprise Compressed Document (EAR) file and place the EAR file on the application server. Both aspects are usually called deployed to the application server. Application Developer Integration Edition has a simplified deployment tool. You start deploying by creating Enterprise Application Project, which defines the structure of the EAR file. You can put some deployed code into the EJB section, partially put into the web section, and partially put it on the client code section. In large EAR files, this division helps you manage your own files.
Once you define the structure of your EAR file, select the previously created binding file, then click Deployment Wizard from the Toolbar. When your file is packaged into EAR, Application Developer Integration Edition provides most of the information you need to default, but allow you to overwrite them if necessary. For example, because we also want to provide the CICS service as a SOAP service, select SOAP as an inbound bind type (shown in Figure 11).
Figure 11. Map the service file into an EAR structure, you also need to specify the Java Naming and Directory Interface (JAVA Naming and Directory Interface (JNDI) name, when the application server is connected to the CICS server, Know it. Also, you may want to adjust SOAP-specific binding features. Usually, the default value will be used.
Once all functions are integrated in this way, the work to create a Simplified Airlines site is basically completed. The remaining work is to deploy services to test or production environments. We said that the test environment is because Application Developer Integration Edition provides a complete test environment for analog application servers. It is a good idea to use WebSphere Test Environment before deploying to a production environment. After testing, you put the EAR file in the production environment. No matter whether the test environment is still a production environment, you will need to create an application to indirect access to your service.
Integrate Simplified Airlines with Travel Simplified Site Now, we have a flight booking service and need to integrate it into a holistic travel agency; we are creating another service in a service. We create a proxy to represent the service on the client.
Creating a SOAP proxy agent for service provides a remote procedure call interface for the service of interest. Application calls the proxy local method. Proxy handling communication with the server. As you may guess, Application Developer Integration Edition provides a tool for building a proxy. To integrate the SIMPLIFIED Airlines service into the Travel Simplified site, you need to get the WSDL file that defines the interface and SOAP binding information of the service. You can use unified description, discovery, and integrated protocol (UNIVERSAL DESCOVERY AND INTEGRATION (UDDI) registry, which makes these files available. This can also be done by establishing direct contact with interested organization. The above deployment steps generates a WSDL file in the Services_SoAP web project of Enterprise Application Project. The next step is just to run a proxy wizard.
Similar to the Deployment Wizard, the Proxy Wizard has completed many input domains, as shown in Figure 12. The domain you might want to change is Destination Folder because it determines the location of the agent. In this example we chose the ClientSample folder because the folder contains the client code that calls the service.
Figure 12. Specify agency information
A key part of proxy information is of course, of course, the operation you will call on the server. Your service may provide a lot of operations; in the agent, you select the operations that will provide access to the application. If you need to select one or more operations, you need to use the "Client Stub" style agent, which is the generated preferred style. If you need access to binding operation features (such as Interactspec), you should select the Command Bean style, as shown in Figure 13.
Figure 13. Select the operation provided in the agent
Test Simplified Airlines Services at this point you will write some client code to call the SOAP proxy and run it on WebSphere Test Environment. As shown below, a name is retrieved from the CICS server and then output it to the console (standard output). First, write such a simple program first, because I only want to confirm that you can get some data from the server. If your application does not make a transaction, then you can't talk more about thousands of transactions.
Call the code of the SOAP agent
Package sample.cics;
Public class testcustomersoap {
Public static void main (String [] args) {
Try {
Customer Record = New Customer ();
Record.SetCustomernumber ("44444");
CustomerinfosoApproxy Proxy = New CustomerinfosoApproxy ();
Proxy.setCustomerPart (Record);
Proxy.execute ();
RECORD = proxy.getcustomerpart ();
System.out.println (Record.getCustomerNumber ());
System.out.println (Record.GetFirstName ());
System.out.println (Record.getlastName ());
} catch (exception e) {
E.PrintStackTrace ();
}
}
}
Once you are satisfied with the proxy method call back, you can quickly integrate this bean to the rest of your application, in our examples are the entire Travel Simplified website.
Conclusion In this article, we demonstrate how to quickly integrate existing CICS programs to complex B2B applications using Web services, SOAP, and XML. We studied IBM WebSphere Studio Application Developer Integration Edition, which is a product designed for creating web services, businesses and B2B integration applications. We studied its components and then studied a case study that demonstrates how the Application Developer Integration Edition tool is applied to actual B2B issues. "Old Seniors" and "new new human beings" work well.
Reference
Read "JCA Tool Plugin supports J2EE resource adapter - Part 1: Introduction Architecture" (WebSphere Developer Garden, May 2002). Check between two good articles in the Web Services area: "Web Services Invocation Sans Soap" and "The Architecture Of Web Service Invocation Framework" (DeveloperWorks, Sep 2001). Check the Web Service Description Language (WSDL) specification. Check out our reference: written Steve Graham, Simeon Simeonov, Toufic Boubez, Doug Davis, Glen Daniels, Yuichi Nakamura and Ryo Neyama Building Web Services with Java (Sams Publishing, 2002) and Rahul Sharma, Beth Stearns and Tony Ng write J2EE Connector Architecture and Enterprise Application Integration (Addison-Wesley, 2001). Visit the WebSphere Studio Application Developer Integration Edition website. Download the Basic Edition (Trial Edition) Windows or Linux version. You can download information, sample code, and trial product download from WebSphere developer gardens to developers using WebSphere developers.