30
Integrating your enterprise applications with IBM Maximo Asset Management V7.1 Integrating your applications using Web services Skill Level: Intermediate Pandian Mariadoss ([email protected]) Senior IT Certified Specialist IBM 13 Jan 2010 This article explains the Web services capabilities of the IBM® Maximo® Asset Management's Integration Framework and shows you how to integrate it with WebSphere® Process Server. Introduction The IBM Maximo V7.1 Asset Management System manages an organization’s assets throughout its life cycle - from requisition to retirement. Maximo V7.1 uses the Integration Framework to integrate with an external system to exchange information. What is the Integration Framework? The Integration Framework: Is an essential component of Maximo service-oriented architecture (SOA). Provides an XML interface for all Maximo business objects. Provides support for bi-directional integration with external applications and middleware products. Supports standard protocols such as HTTP/HTTPS, Web services, JMS, flat files, and database tables. Integrating your enterprise applications with IBM Maximo Asset Management V7.1 © Copyright IBM Corporation 2010. All rights reserved. Page 1 of 30

Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Integrating your enterprise applications with IBMMaximo Asset Management V7.1Integrating your applications using Web services

Skill Level: Intermediate

Pandian Mariadoss ([email protected])Senior IT Certified SpecialistIBM

13 Jan 2010

This article explains the Web services capabilities of the IBM® Maximo® AssetManagement's Integration Framework and shows you how to integrate it withWebSphere® Process Server.

Introduction

The IBM Maximo V7.1 Asset Management System manages an organization’sassets throughout its life cycle - from requisition to retirement. Maximo V7.1 uses theIntegration Framework to integrate with an external system to exchange information.

What is the Integration Framework?

The Integration Framework:

• Is an essential component of Maximo service-oriented architecture (SOA).

• Provides an XML interface for all Maximo business objects.

• Provides support for bi-directional integration with external applicationsand middleware products.

• Supports standard protocols such as HTTP/HTTPS, Web services, JMS,flat files, and database tables.

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 1 of 30

Page 2: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

• Supports message exchange in a synchronous and asynchronous model.

This article will help you integrate the Maximo application with an external systemlike WebSphere Process Server (hereafter called Process Server) using Webservices technology. It focuses on implementing Web services for the followingscenarios in Maximo:

• Inbound transaction: Process Server detects an equipment failurenotification and sends a work order creation for the failed equipment toMaximo.

• Outbound transaction: On an event (create, update, delete, and so on)in the Maximo’s work order application, a message with the work orderinformation is sent to Process Server.

Requirements

This article assumes that the IBM Maximo Asset Management System V7.1 isalready installed, configured, and running in your environment. Also, WebSphereProcess Server V6.0.2 is installed and running in the same environment. Theartifacts to be deployed in Process Server are built using WebSphere IntegrationDeveloper V6.0.2 (hereafter called Integration Developer) and require an IntegrationDeveloper environment.

Downloads

This article provides the following zip files that you can download:

• The MaximoArtifacts.zip file contains the necessary Maximo files that youcan import onto the Process Server to invoke or process the Maximo’sWork order Web service.

• The Outbound_PI.zip file is the Process Server Interchange file toimplement the Maximo Work Order outbound's scenario.

• The Inbound_PI.zip file is the Process Server Interchange file toimplement the Maximo Work Order inbound's scenario.

Maximo message flow of inbound and outbound transactions

This section discusses how Maximo exchanges information with an external systemusing Web services. Figure 1 shows Maximo components involved in processing aWeb service request from Process Server.

Figure 1. Maximo inbound Web service message flow

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 2 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 3: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

1. Process Server receives an equipment failure notification from an externalsystem. For this article, the external system is a form-based JSP clientapplication, which sends the equipment information when the userpresses the Submit button. (The equipment information, such as the assetnumber, asset location, and asset owner, matches the Maximo assetinformation.)

2. Process Server maps this information to the Maximo’s Worker Orderbusiness object and invokes the work order Web service using the ExportSCA Web service binding.

3. A direct connection is established between Process Server and Maximo’sIntegration Framework (IFW). The IFW containing the deployed workorder Web service returns a response to Process Server that confirmssuccess or failure of the processed message. (The IFW expects all XMLmessages to be encoded in a Unicode format.)

Figure 2 shows Maximo components involved in publishing a Web service request toProcess server.

Figure 2. Maximo outbound Web service message flow

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 3 of 30

Page 4: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

1. On a work order event (create, update, and delete), the IFW identifies thecomponent business object associated with the event and constructs thework order (MXWO) object structure.

2. The publish channel associated with the object structure is invoked if anyrules or pre-processing is applied and a XML message is constructed.

3. The IFW sends the message to a JMS queue (jms/sqout). A cron task(out-of-the box process) defined in the Maximo application server extractsand sends the message to a message router, which identifies the Webservice handler associated with the publish channel.

4. The Web service handler uses the properties endpoint URL and servicename to invoke the Web service deployed in Process Server.

5. The Export Web service SCA binding receives the SOAP message andconstructs the business object for further processing.

Implementing the Maximo inbound work order creationscenario

The inbound work order (equipment failure notification) scenario involves two steps:

1. Setting up Maximo for the work order Web service.

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 4 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 5: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

2. Setting up Process Server to invoke the work order Web service.

Setting up Maximo for the work order Web service

To enable the Web service in Maximo, complete the following steps:

1. There are two important properties that need to be set before deploying aWeb service in Maximo. You can access the System properties from theMaximo application: GoTo -> System Configuration -> PlatformConfiguration -> System Properties.

• mxw.int.globaldir: This property specifies the root folder where allthe integration configuration files are located. If this value is null, thefolders are created under the directory from which the applicationserver is started, or from the current working directory of theapplication server for example:C:\IBM\WebSphere\AppServer\profiles\AppSrv01).

• mxe.int.webappurl: This specifies the integration Web applicationURL. The syntax is http://<Maximohostname>:port#/meaweb. "port#" points to default_host underthe Ports option in the WebSphere Application Server admin consolefor Maximo (Figure 3).Figure 3. mxe.int.webappurl system property

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 5 of 30

Page 6: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

2. Next, you need to define the object structure. The inbound work ordercreation scenario uses the work order object structure (MXWO) toprocess its business events. The work order object structure comes as aMaximo out-of-the-box feature and it defines the business object for theinbound scenario. To see the list of object structures defined or to createnew object structure, use the Maximo application. Click GoTo and selectthe menu option Integration -> Object Structures (Figure 4).Figure 4. Work order object structure

3. Now create the work order Web service. In Maximo, there are threedifferent types of Web services: object structure, enterprise, and standard

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 6 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 7: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Web services.

• The object structures are synchronous services, easy to use, andsupport five different operations (create, update, query, delete, andsync).

• The enterprise Web service supports additional exit processing,business rules, and transformations not available to the objectstructure Web services. The enterprise services can be eithersynchronous or asynchronous (JMS queues).

• The standard services are created from methods that are annotatedin the application services.

This article focuses on the object structure Web services. To create a newWeb service from the object structure (MXWO), use the Maximoapplication. Click GoTo and select the menu option Integration -> WebServices Library. From the Web Service Library page, click the selectAction drop-down list box to select the Create WS from ObjectStructure menu option. From the Create Web Service from an ObjectStructure Definition dialog box (Figure 5), select the object structure forwhich you want to create the Web service.Figure 5. Create Web service from MXWO object structure

4. To generate XSD files (data types, operation type) for the newly createdMXWO Web service, use the Maximo application. Click GoTo and selectthe menu option Integration -> Web Services Library. In the WebService Library page, search for the Web service created in Step 3 andselect it. The schema for the selected Web service can be generated byclicking the Generate schema / view XML button (Figure 6) and clickingOK.The schema files are generated under the directory defined in the

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 7 of 30

Page 8: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

mxe.int.golabdir system property. If no value is defined for thisproperty, the schema gets generated under <WebSphere installeddirectory>\AppServer\profiles\AppSrv01\schema, as shownin Figure 7.Figure 6. Generate schema for MXWO Web service

Figure 7. Schema directory under Maximo application server

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 8 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 9: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

5. The newly created MXWO Web service needs to be deployed and theWeb service definition language (WSDL) has to be defined. To deploy theWeb service, use the Maximo application. Click GoTo and select themenu option Integration -> Web Services Library. From the WebService Library page, click the select Action drop-down list box to selectDeploy Web Services (Figure 8). On successful deployment, the WSDLfiles are generated under the directory defined in mxe.int.globadir. Ifno value is defined for this property, the WSDL gets generated under<WebSphere installeddirectory>\AppServer\profiles\AppSrv01\wsdl>.Figure 8. Deployed MXWO Web service

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 9 of 30

Page 10: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Note: The "Is Deployed?" check box is enabled automatically on successfuldeployment.

Setting up Process Server to invoke the work order Web service

This article focuses on WebSphere Integration Developer V6.0.2 to develop theProcess Server artifacts. The following steps invoke the Maximo's Work Order Webservice from Process Server:

1. First, create a Business Integration (BI) module. From the IntegrationDeveloper environment select File -> New -> Project -> BusinessIntegration -> Module, which creates a new module and opens theAssembly diagram.

2. Prepare the Maximo artifacts before importing them into the BI module.Move all the Maximo MXWO Web service artifacts (MXMeta.xsd,MXWO.xsd, workorder.xsd, MXWOService.xsd, and MXWO.wsdl) to acommon directory. This action ensures that all the artifacts are foundunder one single directory after the import.

3. Open all the artifacts and edit the schema location wherever possible.From:

SchemaLocation="http://localhost:9080/meaweb/schema/service/MXWOService.xsd"http://localhost:9080/meaweb/schema/service/MXWOService.xsd"schemaLocation="http://localhost:9080/meaweb/schema/common/meta/MXMeta.xsd"schemaLocation="http://localhost:9080/meaweb/schema/common/mos/MXWO.xsd"schemaLocation="http://localhost:9080/meaweb/schema/common/mbo/workorder.xsd"

To:

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 10 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 11: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

schemaLocation="MXWOService.xsd"schemaLocation= "MXMeta.xsd.xsd"schemaLocation="MXWO.xsd"schemaLocation="workorder.xsd"

This ensures that the references to the artifacts are resolved correctlyafter the import.

4. Import the edited artifacts into the BI module. Select all the artifacts andimport them to the newly created BI module. On successful import,Integration Developer creates the Maximo business objects and Webservice port to invoke the MXWO Web service. To import the artifacts intoIntegration Developer, right-click the BI module, then Import -> FileSystem -> Browse to the artifacts directory (Figure 9 and Figure 10).Note: The MaximoArtifacts.zip file contains all the necessary Maximo filesthat you can import to the Process Server to invoke the Maximo’s Workorder Web service.Figure 9. Import Maximo's inbound artifacts into Process Server

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 11 of 30

Page 12: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Figure 10. MXWO artifacts after the import

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 12 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 13: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

5. Create an import SCA Web service binding. Process Server uses theimport SCA component to invoke the external service. This article focuseson creating an import SCA component with SOAP/HTTP Web servicebinding. Expand the Web service ports from the BI module and drag anddrop the service port MXWOSOAP11Port onto the Assembly diagram.Integration Developer invokes the user with the option of “export with webservice binding” or “import web service binding”. Select the import optionwith soap/http web service binding and Integration Developer createsan import WSDL that invokes the Maximo’s MXWO Web service (Figure11).Figure 11. Import type SCA component with Web service binding

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 13 of 30

Page 14: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Note: Make sure the address property in the import Web service bindingis pointing to the Maximo server.

6. Now test the import SCA Web service component. Integration Developerprovides a test component to test the SCA artifacts. To test the WorkOrder Import SCA component, right-click MXWOPortTypeImport1 andyou can input values to the work order Web service, and then clickContinue (Figure 12). Integration Developer invokes the Maximo MXWOWeb service and returns a response on successful completion of the test.Figure 12. Test component for import SCA component

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 14 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 15: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

7. Deploy the BI module onto the Process Server runtime.

Implementing the Maximo outbound work order notificationscenario

To notify work order changes in Maximo, complete the following steps:

• Set up Maximo to notify the work order changes.

• Set up the work order Web service in Process Server.

• Set up Maximo to invoke the Process Server Web service.

Setting up Maximo to notify work order changes to Process Server

1. First, define the object structure. The outbound work order notificationscenario uses the work order object structure (MXWO) to notify itsbusiness events. The work order object structure comes as a Maximoout-of-the-box feature and it defines the business object for the outboundscenario. To see the list of object structures defined or to create a newstructure, use the Maximo application and GoTo -> Integration-> ObjectStructures. Figure 13 shows the Object Structures page.Figure 13. Work order object structure

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 15 of 30

Page 16: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

2. Define a publish channel. Maximo can send events to the external systemusing either a asynchronous publish channel or synchronous invocationchannel. This article will focus on sending the work order eventnotification in a asynchronous fashion. The publish channel defines whatkind of event it will process based on the object structure and appliesprocessing rules, if any, after the event has happened and sends the finalmessage to a message queue. Maximo comes with the MXWOInterfacepublish channels as an out-of-the-box feature, which captures the workorder events. To access a publish channel, use the Maximo applicationand select GoTo -> Integration-> Publish Channels and filter onMXWOInterface to get the work order publish channel (Figure 14).Figure 14. Work order publish channel

3. Enable the Publish channel event listener. The event listener is used tocapture events from the object structure associated with the publishchannel. To enable the listener in the MXWOInterface publish channel, goto the drop-down list and click Select Action -> Enable Event Listeners,

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 16 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 17: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

and the “Enable Listener” check box is enabled (Figure 15).Figure 15. Enable publish channel's event listener

4. Generate the schema for the publish channel. The schema generatedfrom the publish channel will be used by Process Server to define thedata type for the notification request. To generate the schema from theMXWOInterface publish channel, Select Action -> Generate Schema /View XML and the schema for work order data type is generated underthe Global directory defined in the mxe.int.golabdir system property.If no value is defined for this property, the schema gets generated under<WebSphere installeddirectory>\AppServer\profiles\AppSrv01\schema.

5. Activate the JMS cron task. Maximo uses the JMS cron task to extract thework order event message from the message queue and sends it to themessage router. The message router then invokes the specific eventhandler to send the message to an external system. To activate the JMScron task, use the Maximo application and GoTo -> SystemConfiguration -> Platform Configuration -> Cron Task Setup, filter onJMSQSEQCONSUMER, select the the SEQQOUT cron task instancename, click Active, and save the record (Figure 16).Figure 16. Activate the JMS cron task

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 17 of 30

Page 18: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Setting up the work order Web service in Process Server

The following steps describe how to accept a work order Web service request fromMaximo:

1. Create a Business Integration (BI) module. From the IntegrationDeveloper environment, select File -> New -> Project-> BusinessIntegration -> Module, which creates a new module and opens theAssembly diagram.

2. Prepare the Maximo artifacts before importing them into the module.Move the Maximo’s MXWOInterface publish channel data type artifacts(MXMeta.xsd, and MXWO.xsd) onto a common directory. This actionensures that all the artifacts are found under a single directory after theimport.

3. Edit the schema location. The schema location for the artifact MXWO.xsdgenerated from the Maximo’s MXWOInterface publish channel needs toedited fromschemaLocation="http://localhost:9080/meaweb/schema/common/meta/MXMeta.xsd"to schemaLocation="MXMeta.xsd". This ensures that the referencesto the artifacts are resolved correctly after the import.Note: The MaximoArtifacts.zip file contains all the necessary Maximo filesthat you can import to Process Server to process the Maximo’s Workorder Web service request.

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 18 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 19: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

4. Import the Maximo artifact to the BI module (Figure 17).Figure 17. Import Maximo outbound artifacts into Process Server

5. Create a business object specific for the work order request. The inputdata type for the Maximo notification request is defined using the Maximoartifact MXWO.xsd. Create a new business object with a name(Publish<Maximo Object structure name>), such asPublishMXWO, and define the namespace ashttp://www.ibm.com/maximo. The object contains just one attribute,<Maximo Object Structure Name>Set of type <MaximoObject Structure Name>SetType (for example, MXWOSet of typeMXWOSetType). To create it, go to BI module -> Data Types -> New ->Business Object, set the name as PublishMXWO, and the namespaceas http://www.ibm.com/maximo (Figure 18).

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 19 of 30

Page 20: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Figure 18. Business object for the work order notification

6. Create a Web service interface for the work order request. The Webservice interface contains an operation specific for accepting the Maximonotification request. The syntax for the operation name isPublish<Maximo Object structure name>, such asPublishMXWO, to accept the work order request. To create it, go to the BImodule -> Interfaces -> New -> Interface. In the interface wizard,uncheck the Default namespace and provide a new namespace(http://www.ibm.com/maximo), (Figure 19) and click Finish. In theinterface window, click Add Request Response Operation and providethe operation name PublishMXWO and the data type created in Step 5.Figure 19. Web service interface for the work order notification

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 20 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 21: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Note: The response data type can be any type.

7. Create an export SCA Web service binding. Process Server uses anexport SCA component to accept requests from an external system. Tocreate, go to BI Module -> Assembly Diagram (Figure 20), drag anddrop the component Export and add the interface created in Step 6. Togenerate a Web service binding for the newly created export component,right-click it and select Generate Binding and select soap/http webservice binding.Figure 20. Export SCA Web service binding

Note: Right-click the component to add an interface.

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 21 of 30

Page 22: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

8. Create a Web service JAX-RPC handler. The SOAP message thatMaximo sends to Process Server requires some pre-processing before itcan be processed. You can achieve pre-processing either by a Webservice exit in the Maximo event handler, or a Web service server handlerin Process Server. This article will focus on the Web service serverhandler in Process Server.The work order SOAP message from Maximo does not contain theoperation name and the target namespace to reference the right object inProcess Server. Process Server uses the Web service handler to handlethe incoming SOAP message and to process it correctly. The Webservice handler does the following:

• Change the SOAP envelope.

• Change the SOAP body to insert the operation name.

• Log the changed SOAP message on to the Process Server systemout log.

To create a server side Web service handler, refer to Support for J2EEWeb services in WebSphere Studio Application Developer.

Listing 1 shows the code for the Web service handler (server-side), whichmodifies the incoming SOAP request from Maximo.Listing 1. Code for ServiceHandler.java

public boolean handleRequest(MessageContext msgContext) {System.out.println("** MaximoWebServiceHandler **");try {

SOAPMessageContext smc = (SOAPMessageContext)msgContext;SOAPMessage msg = smc.getMessage();SOAPPart soapPart = msg.getSOAPPart();SOAPEnvelope envelope = soapPart.getEnvelope();SOAPBody body = envelope.getBody();Iterator it = body.getChildElements();Object node = null;String OperationName = null;while( it.hasNext()){

node = it.next();if (node instanceof SOAPBodyElement){SOAPBodyElement element = (SOAPBodyElement)node;System.out.println("Parent elemnt["+element.getLocalName()+ "]");if (element.getLocalName().indexOf("Publish") != -1){

OperationName = element.getLocalName();break;}

}}

if (OperationName != null){SOAPBodyElement oldelement = (SOAPBodyElement)node;String oldelemStr = oldelement.toString();int endpos = oldelemStr.indexOf('>'); //replace the first elementStringBuffer soapContentBuff = new StringBuffer();soapContentBuff.append("<SOAP-ENV:Envelope ");soapContentBuff.append("xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" ");

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 22 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 23: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

soapContentBuff.append("xmlns:q0=\"http://www.ibm.com/maximo\" ");soapContentBuff.append("xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ");soapContentBuff.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");

soapContentBuff.append("<SOAP-ENV:Body>");soapContentBuff.append("<q0:" + OperationName +"xmlns:q0=\"http://www.ibm.com/maximo\">");

soapContentBuff.append('<' + OperationName + '>');soapContentBuff.append(processContentString(oldelemStr.substring(endpos+1)));

soapContentBuff.append("</q0:" + OperationName + '>');soapContentBuff.append("</SOAP-ENV:Body>" +"</SOAP-ENV:Envelope>");

StreamSource source = new StreamSource(newStringReader(soapContentBuff.toString()));

msg.getSOAPPart().setContent(source);msg.saveChanges();}msg.writeTo(System.out);

System.out.println();}catch (Exception e) {// TODO Auto-generated catch block

e.printStackTrace();}return true;

}

public String processContentString(String elementStr){//This function is to add the namespaces for the first Child Object//after the Set Object typeString result ="";//Shift from MXWOSet Objectresult = elementStr.substring(0, elementStr.indexOf('>')+1);elementStr = elementStr.substring((elementStr.indexOf('>')+1));result = result + elementStr.substring(0,(elementStr.indexOf('>')));

result = result + " xmlns=\"http://www.ibm.com/maximo\">";result = result + elementStr.substring(elementStr.indexOf('>') + 1);return result;}

9. Add the service handler to the Export SCA Web service port. The ExportSCA uses the service handler to pre-process the incoming SOAPmessage. To associate a handler to an export SCA Web servicecomponent, open the project in J2EE perspective and select EJBProjects -> BI modeuleName -> ejbModule -> META-INF ->webservices.xml. In the Handlers tab (Figure 21), associate the newlycreated service handler to the export SCA Web service component’s port.Save the setting.Figure 21. Associate a service handler to a Web service

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 23 of 30

Page 24: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

10. Build and deploy the BI module onto the Process Server runtime.

Setting up Maximo to invoke the Process Server Web service

For Maximo to invoke the Web service running Process Server, complete thefollowing steps:

1. Set up the Web service event handler. The message router in Maximoroutes the event message to the appropriate event handler. For the WorkOrder notification scenario, the message needs to be sent to an externalsystem using SOAP/HTTP. To achieve this, use the Maximo applicationand GoTo -> Integration -> Endpoint (Figure 22), select the newEndpoint, and provide the name MXWOENDPOINT. In the Handler type,provide WEBSERVICE and populate the EndPointURL and ServiceNamewith the following and save the record:

EndPointURL = Web service address

For example: http://<WPShostname>:9080/MxToWPSWorkOrderWeb/sca/MXToWPSWO_Export).

ServiceName = Web service name

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 24 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 25: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

For example:MXToWPSWO_Export_PublishWOInterfaceHttpService.Figure 22. Maximo EndPoint with Web service handler

2. Associate the handler to the work order publish channel. The final step isto associate the event handler to the MXWOInterface publish channel,which is listening for work order events. From the Maximo application,GoTo -> Integration -> External Systems, filter on EXTSYS1(out-of-the-box), and go to Publish channels filter and search forMXWOInterface. If not found, select new Row, enter the PublishChannel Name (MXWOInterface) and the EndPoint (MXWOENDPOINT).Enable the MXWOInterface for the external system EXTSYS1 byselecting Enabled?, and then activate the external system (EXTSYS1) byselecting Enabled? (Figure 23 and Figure 24).Figure 23. Associate event handler to a publish channel

Figure 24. Enabling IFW's external system

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 25 of 30

Page 26: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Note: The out-of-the-box Maximo comes with JMS queues configured. To configureMaximo’s JMS queues, refer to Manually configuring JMS queues.

Testing the Maximo inbound work order creation

1. Deploy the Inbound_PI.zip file (sample code) on to the Process Serverruntime.

2. Submit the equipment failure Notification Form (Figure 25) using thefollowing link:http://<WPShostname>:9080/WPSToMaximoWorkOrderWeb/AlertGenerator.jsp.Figure 25. Equipment Failure Notification form

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 26 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 27: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

3. The work order number is returned to the client upon successful workorder creation.

Testing the Maximo outbound work order notification

1. Deploy the Outbound_PI.zip file (sample code) on to the Process Serverruntime.

2. Change the status of the existing Maximo Work Order. This sends a workorder change notification message (Figure 26).Figure 26. Maximo Work Order tracking application

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 27 of 30

Page 28: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

3. Process Server receives the notification and logs the message to theSystemOut.log file.

Conclusion

This article described the integration capability of the IBM Maximo AssetManagement System with WebSphere Process Server by using Web servicestechnology. It also showed you how to set up Maximo to send and receive workorder information to an external system.

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 28 of 30 © Copyright IBM Corporation 2010. All rights reserved.

Page 29: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Downloads

Description Name Size Downloadmethod

Maximo files MaximoArtifactszip 9KB HTTP

PI files Inbound_PI.zip 29KB HTTP

PI files Outbound_PI.zip 16KB HTTP

Information about download methods

ibm.com/developerWorks developerWorks®

Integrating your enterprise applications with IBM Maximo Asset Management V7.1© Copyright IBM Corporation 2010. All rights reserved. Page 29 of 30

Page 30: Integrating your enterprise applications with IBM …public.dhe.ibm.com/software/dw/wes/1001_mariadoss/1001...This article assumes that the IBM Maximo Asset Management System V7.1

Resources

Learn

• JAX-RPC Web service handlers

• Maximo V7.1 Installation Guide

• Maximo V7.1 Integration Guide

• IBM Maximo Asset Management product page

• deloperWorks WebSphere Process Server and WebSphere IntegrationDeveloper zone

• WebSphere Process Server product page

Discuss

• WebSphere Process Server discussion forum

• WebSphere Integration Developer discussion forum

About the author

Pandian MariadossPandian Mariadoss is an Integration IT Specialist who works on integrationarchitecture, design, implementation for multiple projects at the IBM Global SolutionCenter, U.S.A. His area of focus is integrating WebSphere products using Webtechnology.

developerWorks® ibm.com/developerWorks

Integrating your enterprise applications with IBM Maximo Asset Management V7.1Page 30 of 30 © Copyright IBM Corporation 2010. All rights reserved.