Training Integration Broker PeopleTools 8.

51

Training Integration Broker

1.

OVERVIEW ........................................................................................................................... 4 1.1. 1.2. 1.3. 1.4. Environment ................................................................................................................ 4 Aim ............................................................................................................................... 4 Prerequisite Knowledge............................................................................................... 4 Project .......................................................................................................................... 4 Activate application server pub/sub processes........................................................... 5 Enable communication between application server and web server ......................... 9 Enable communication between web server and application server ......................... 9 Setup web service configuration ............................................................................... 14 Activate Integration Broker Domains ........................................................................ 15 Modify Internal Nodes ............................................................................................... 16 Component navigation .............................................................................................. 17 Generate Component Interface ................................................................................ 18 Component Interface Security................................................................................... 20 Generate CI Based Service ......................................................................................... 21 Provide CI Based Service............................................................................................ 26 Call CI Based Service via SoapUI ................................................................................ 28 Call PeopleSoft Service PeopleCode .......................................................................... 32 Mock Service.............................................................................................................. 38 Create Node ............................................................................................................... 41 Import WSDL.............................................................................................................. 43 PeopleCode ................................................................................................................ 49 Messages ................................................................................................................... 52 Service........................................................................................................................ 54 PeopleCode ................................................................................................................ 56 Routing and Handler .................................................................................................. 58 Deploy Service ........................................................................................................... 59 Service Operation Tester ........................................................................................... 61 Call from SoapUI ........................................................................................................ 63 PeopleCode call ......................................................................................................... 65
Page 2 of 84

2.

SETUP INTEGRATION BROKER............................................................................................. 5 2.1. 2.2. 2.3. 2.4. 2.5. 2.6.

3.

PROVIDE COMPONENT INTERFACE SERVICE .................................................................... 17 3.1. 3.2. 3.3. 3.4. 3.5. 3.6. 3.7.

4.

CALL EXTERNAL SERVICE ................................................................................................... 38 4.1. 4.2. 4.3. 4.4.

5.

CUSTOM PEOPLESOFT APPLICATION CLASS SERVICE ....................................................... 52 5.1. 5.2. 5.3. 5.4. 5.5. 5.6. 5.7. 5.8.

Training Integration Broker

6.

TRANSLATIONS .................................................................................................................. 67 6.1. 6.2. 6.3. 6.4. 6.5. 6.6. Setup Transform Message ......................................................................................... 67 Setup XSLT Application Engine .................................................................................. 68 Delete WSDL .............................................................................................................. 71 Add Transformation to Service .................................................................................. 72 Provide Service .......................................................................................................... 73 Call service using SoapUI ........................................................................................... 73 Activate Pub/Sub Servers .......................................................................................... 74 Activate Process Scheduler........................................................................................ 74 Create Application Engine ......................................................................................... 75 Application Engine Handler ....................................................................................... 76 Create Process ........................................................................................................... 78 Test Operation ........................................................................................................... 79

7.

APPLICATION ENGINE HANDLER ....................................................................................... 74 7.1. 7.2. 7.3. 7.4. 7.5. 7.6.

APPENDIX A PEOPLECODE CALL CI ........................................................................................... 81 APPENDIX B PEOPLECODE CALL EXTERNAL SERVICE ............................................................... 82 APPENDIX C PEOPLECODE CALL CUSTOM PS SERVICE ............................................................. 83 APPENDIX D APPLICATION CLASS CUSTOM PS SERVICE HANDLER.......................................... 84

Page 3 of 84

Training Integration Broker

1. OVERVIEW
1.1. Environment
This training • will give you an overview of the basics on Integration Broker. • is developed using a PeopleSoft HCM 9.1 with PeopleTools 8.51 environment.

1.2. Aim
Goal of this training is to provide an introduction to the Integration Broker and gaining basic knowledge and hands-on training on integration using web services. This training will also handle how to leverage from non-PeopleSoft tools like SoapUI and JDeveloper.

1.3. Prerequisite Knowledge
The trainees should have completed the following PeopleSoft trainings prior to this training. PeopleSoft training • PeopleTools 1 • PeopleTools 2 • PeopleCode SOA General Training • Web services & SOA • XML • XSLT • XSD • SOAP • WSDL

1.4. Project
Before you start copy from Project IBCOURSE_CUST using Application Designer and build the project! This projects contains sources that you will be using during this training.

Page 4 of 84

to be found in [PS_HOME]\appserv\psadmin Choose option 1) Application Server Choose option 1) Administer a domain Choose option 3) HCM (this name could be different in your environment) Page 5 of 84 . Activate application server pub/sub processes First you need to active the Publish & Subscribe processes in the application server.1.Training Integration Broker 2. SETUP INTEGRATION BROKER 2. Start PSADMIN. Note: For synchronous services these processes do not need to be running. These processes will enable asynchronous services to be processed.

Page 6 of 84 .Training Integration Broker Choose option 4) Configure this domain Type y to start configuring the application server.

Page 7 of 84 . Choose option 13 to save the changes in the configuration of the application server. Note option 25) JSL Port is the Jolt port configured that the web server communicates with the application server. Write down the number of this port.Training Integration Broker Choose option 1 to activate the Pub/Sub Servers. Pub/Sub servers are now activated and will start up when the application server starts. you will be needing it later on.

Training Integration Broker Choose option 1 to start the application server. Page 8 of 84 . You can see the Pub/Sub processes are running.

3. Enable communication unication between web web server and application server During this step you will tell the Integration Gateway which application server(s) it should communicate with. Page 9 of 84 .Training Integration Broker 2. Click on the Ping Gateway button to see if the Integration Gateway is up and running. The Integration Gateway URL is to be constructed as follows: http://[server:port]/PSIGW/PeopleSoftListeningConnector Substitute this URL with your server and port and tab click on Save.2. Enable communication between application application server and web server During this step you will configure which Integration Gateway will be used by the application server. Start PeopleSoft HCM by starting a browser session and login with user PS and password PS. Navigate via menu Main Menu > PeopleTools > Integration Broker > Integration Setup > Nodes On the search page. click on the search button to query all the nodes. The connectors will be loaded as shown in the screen above. The next screen will show in a new window 2. First we need to find the default local node of HCM. P Navigate via menu Main Menu > PeopleTools > Integration Broker > Configuration > Gateway. This is needed for inbound traffic. The default local node (PSFT_HR) will now be shown as the first node in the list. After that click on the Default Local Node header of the result grid. This is needed for outbound traffic.

Training Integration Broker Select node PSFT_HR. Select Authentication Option: Password. Page 10 of 84 .

Again for the sake of convenience during this training you will not do this. It is also a good custom to rename/copy the default local node to an unique node name for your environment.Training Integration Broker Provide an existing PeopleSoft user for Default User ID. Default User ID and Password are administrator/password. all processing of services will be aborted. For the sake of convenience during this training you will use the user PS. Supply these values and click on OK. The following screen will be shown. Page 11 of 84 . It is a good custom to assign a dedicated user for the Integration Broker. Navigate via menu Main Menu -> PeopleTools -> Integration Broker -> Configuration -> Gateway Click on the link Gateway Setup Properties. If you were to use an active PeopleSoft user and if this user would be locked for whatever reason.

51.properties file will now be shown. The integrationgateway.war\WEB-INF Page 12 of 84 . Click on Ping node for the node PSFT_HR.04 In the second section provide the default local node and corresponding application server that the Integration Gateway will use. This file can be found in directory [PS_HOME]\webserv\peoplesoft\ \applications\peoplesoft\PSIGW. The following screen will be shown. The Integration Gateway can now successfully communicate with the application server. Click on the Return button and click on the link Advanced Properties Page. Field App Server URL User ID Password Tools Release Value [appserv machine]:[JSL port appserver] PS PS 8.Training Integration Broker In the first section provide the default application server that the Integration Integration Gateway will use to handle messages.

The error log en message log og can be found in directory [PS_HOME]\webserv\peoplesoft peoplesoft\applications\peoplesoft\PSIGW.Training Integration Broker You can see that this file now contains the application servers that have been be configured in the PeopleSoft Node Configuration Page.html In this file scroll down to secureFileKeystorePasswd=password Using the password encrypting section encrypt the password and change this in the file. Page 13 of 84 .html http://<yourserver>:<port>/PSIGW/msgLog.level=5 With this setting you will enable logging messages and errors in the Integration Broker.html /PSIGW/errorLog.war These file can also be found online using the following URL’s File Error Log Message Log URL http://<yourserver>:<port>/PSIGW/errorLog.log. Scroll down in this file and set logging to value 5 ig.

These will be used in the XSD’s and WSDL’s as target namespace.4. The field target location refers to the endpoint that services will get. PeopleTools will use this information when setting up XSD’s and WSDL’s. The syntax for this is: http://<server>:<port>/PSIGW/PeopleSoftServiceListeningConnector/[<defaultlocalnode>] http://<server>:<port>/PSIGW/PeopleSoftServiceListeningConnector/[<defaultlocalnode>] Appending the default local node to the target location is not mandatory. Navigate via menu Main Menu > PeopleTools > Integration Broker > Configuration > Service Configuration Enter desired service and schema namespaces. Page 14 of 84 .Training Integration Broker 2. Setup web service configuration During this step you will setup the namespaces and target location. This will enable you to make changes to services without having ing to create new versions every time. You can keep them default as displayed. Change the field Service System Status to Development. Although this is highly recommended if you have multiple environments running on the same PIA PIA/Integration Gateway.

Navigate via Main Menu > PeopleTools > Integration Integration Broker > Configuration > Quick Configuration Click on the link Domain Status.Training Integration Broker 2. Page 15 of 84 . The following screen will be shown: Click on the button Purge Domain Status. Activate Integration Broker Domains The Pub/Sub processes we have to be activated activ in the Integration Broker.5.

Modify Internal Nodes The Integration Broker uses some internal nodes that need modification. Page 16 of 84 . You can choose to deactivate the Pub/Sub services in the configuration of the application server for performance reasons! 2.Training Integration Broker Now check checkbox All Domains Active and click on the button Update and click on the button Refresh.6. Do the same for the WSDL_NODE node. During the following chapters you will not be using asynchronous services. The Integration Broker is able to process asynchronous services. Navigate via menu Main Menu > PeopleTools > Integration Broker > Integration Setup > Nodes Search node ANONYMOUS Enter an existing PeopleSoft user in the Default User ID field.

The generated web service will in fact invoke the component interface as if you were to open the PeopleSoft component online. Navigate via Main Menu > Workforce Administration > Personal Information > Biographical > Modify a Person Search EMPLID KU0001 Click on the plus icon to add a new row. Before creating a component interface it is wise to open the component and enter a couple of transactions to understand the behaviour of the component. Page 17 of 84 . 3. All business logic and validations on the component will be triggered through the web service and all functional and technical warnings and errors will be passed back to the web service. The easiest way to provide a service from PeopleSoft. Let’s enter a Divorce on 01-01-2011 Enter 01/01/2011 as Effective Date. PROVIDE COMPONENT INTERFACE SERVICE The Integration Broker is now set up to provide and invoke services. Select Marital Status as Divorced and set As of to 01/01/2011 and click on the Save button.1. Component navigation You will provide the component PERSONAL_DATA as a web service.Training Integration Broker 3. is providing a service based on a component interface. navigate through the pages and enter or modify data.

You will have to create a component interface for this component first. Page 18 of 84 .2. Component name is PERSONAL_DATA. Open Application Designer and log in with user/password PS/PS. Generate Component Interface You will now generate a service for this component and invoke this service with the same sort of transactions as you did manually. Using CTRL+J you can find the component name for the component you are on. Choose New Definition -> Component Interface from the menu.Training Integration Broker 3.

you will need to provide access to this component interface. Save the component interface with a name like CI_PERSONAL_DATA_IBCOURSE. You have now generated a component interface for a component. Before you generate a web service based on this component interface. A component interface will be generated for the component PERSONAL_DATA.Training Integration Broker Search for component PERSONAL_DATA and click on Select. Page 19 of 84 .

You will now add the permission list to a new role. Navigate via Main Menu > PeopleTools > Security > Permissions & Roles > Roles and create a new role with name IBCOURSE. Click on Save to save the changes. Page 20 of 84 .3. Component Interface Security Navigate via Main Menu > PeopleTools > Security > Permissions & Roles > Permission Lists and open permission list IBCOURSE.Training Integration Broker 3. Select tab Component Interfaces and enter CI_PERSONAL_DATA_IBCOURSE. Click on the Full Access button to provide access to all the component interface method and click on the button OK. Click on the Edit link.

Navigate via Main Menu > PeopleTools > Security > User Profiles > User Profiles and add role IBCOURSE to user PS.Training Integration Broker Go to tab Permission Lists and add the permission list IBCOURSE.4. Generate CI Based Service Navigate via Main Menu -> PeopleTools-> Integration Broker -> Web Services -> CI-Based Services Page 21 of 84 . save the role. 3.

Page 22 of 84 . A service will now be generated with the name CI_CI_PERSONAL_DATA_IBCOU with 5 service operations corresponding to the component interface methods. Select the Component Interface and click on Review CI Status. Click on the button Perform Selected Actions. Click on the link Select All to select all the Component Interface methods and click on the button Display Selected Actions.Training Integration Broker Enter Component Interface Name CI_PERSONAL_DATA_IBCOURSE and click on Search.

Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Services to service CI_CI_PERSONAL_DATA_IBCOU. Page 23 of 84 .Training Integration Broker Take a look at the generated service.

3.Training Integration Broker You have a service with 5 operations. Page 24 of 84 . Search record Add new Search Record Find Existing Get level0 Change existing data Add new rows (level 1.4. etc) Click on the operation that ends with _G. The 5 operations invoke the 5 CI methods CI Method Create Find Get UpdataData Update Operation _C _F _G _UD _UP Description Create new level0.2.

Click on the Handlers tab and check if the handler is set to Active. Save the operation. Check the checkboxes Regenerate Any-to-Local and Generate Local-to-Local. Click on the link Service Operation Security. Page 25 of 84 . Save the changes. Add Permission List IBCOURSE and provide Full Access.Training Integration Broker You have to provide access to this service operation.

Page 26 of 84 .5. 3.Training Integration Broker Click on the Routings tab and check if the generated routings are active. The next screen will be shown. The service operation is now ready to be provided. Provide CI Based Service Go back to the service definition screen and click on the link Provide Web Service.

Click on Next and Finish.Training Integration Broker Select all operations and click on the button Next. Copy the WSDL URL and paste it in a new browser window. The next screen will be shown. The web service is now deployed and accessible. Have a closer look at the WSDL! Page 27 of 84 . Click on the link View WSDL to see the generated WSDL.

New SoapUI Project Enter the WSDL URL you copied in the previous paragraph and enter this at Initial WSDL/WADL and click on OK. Page 28 of 84 . Open operation ending with _G by expanding it and double click on Request 1. Start SoapUI and choose File . SoapUI will read the WSDL and create request messages for each operation. SoapUI generates the request message based on the WSDL and XSD’s and has taken the endpoint from the WSDL where the request will be send to.6.Training Integration Broker 3. Call CI Based Service via SoapUI You will now invoke the deployed web service via SoapUI. This is a freeware tool for testing web services.

V1"> <m47:EMPLID_0>KU0001</m47:EMPLID_0> <m47:PERS_DATA_EFFDT> <m47:EFFDT_1>2011-01-01</m47:EFFDT_1> <m47:MAR_STATUS>D</m47:MAR_STATUS> <m47:MAR_STATUS_DT>2011-0101</m47:MAR_STATUS_DT> <m47:SEX_0>M</m47:SEX_0> <m47:HIGHEST_EDUC_LVL_0>A</m47:HIGHEST_E D UC_LVL_0> <m47:FT_STUDENT>N</m47:FT_STUDENT> <m47:LANG_CD_0/> <m47:ALTER_EMPLID/> </m47:PERS_DATA_EFFDT> <m47:PERS_DATA_EFFDT> <m47:EFFDT_1>1980-01-01</m47:EFFDT_1> <m47:MAR_STATUS>M</m47:MAR_STATUS> <m47:MAR_STATUS_DT>1980-0101</m47:MAR_STATUS_DT> <m47:SEX_0>M</m47:SEX_0> <m47:HIGHEST_EDUC_LVL_0>A</m47:HIGHEST_E D UC_LVL_0> <m47:FT_STUDENT>N</m47:FT_STUDENT> <m47:LANG_CD_0/> <m47:ALTER_EMPLID/> </m47:PERS_DATA_EFFDT> </m47:Get__CompIntfc__CI_PERSONAL_DATA_I BCO URSEResponse> </soapenv:Body> </soapenv:Envelope> Congratulations.w3. Page 29 of 84 . you have successfully called a web service and retrieved data from PeopleSoft.or g/soap/ envelope/" xmlns:m47="http://xmlns. Request <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.oracle.xmlsoap.xmlsoap.w3.oracle.org/2001/XMLSch ema" xmlns:xsi="http://www.com/Enter prise/To ols/schemas/M1021932.Training Integration Broker Change ? in the request window for EMPLID to value KU0001 and click on the green start icon on the left top corner of the request screen.org/2001/XMLSch emainstance"> <soapenv:Body> <m47:Get__CompIntfc__CI_PERSONAL_DATA_IB CO URSEResponse xmlns:m47="http://xmlns.or g/soap/ encoding/" xmlns:xsd="http://www.or g/soap/ envelope/" xmlns:soapenc="http://schemas.com/Enter prise/To ols/schemas/M475651.V1"> <soapenv:Header/> <soapenv:Body> <m47:Get__CompIntfc__CI_PERSONAL_DATA_IB CO URSE> <m47:EMPLID>KU0001</m47:EMPLID> </m47:Get__CompIntfc__CI_PERSONAL_DATA_I BC OURSE> </soapenv:Body> </soapenv:Envelope> Response <soapenv:Envelope xmlns:soapenv="http://schemas.

xmlsoap.Training Integration Broker Now you can try to change the Marital Status back to Married again by adding a new row with a new Effective Date. Navigate via Main Menu > PeopleTools > Security > Permissions & Roles > Permission Lists and open permission list IBCOURSE.org/soap/envelope/" xmlns:m80="http://xmlns. you only provided access to the service operation _G and not for the operation _UP.xmlsoap. Double click on the operation ending with _UP Double click on Request 1 and SoapUI will generate a request message.org/soap/envelope/"> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>null</faultstring> <detail> <IBResponse type="error"> <DefaultTitle>Integration Broker Response</DefaultTitle> <StatusCode>20</StatusCode> <MessageID>536</MessageID> <DefaultMessage>User PS not authorized to invoke Service Operation CI_CI_PERSONAL_DATA_IBCOU_UP. (158.oracle.536)</DefaultMessage> <MessageParameters> <Parameter>PS</Parameter> <Parameter>CI_CI_PERSONAL_DATA_IBCOU_UP</Parameter> </MessageParameters> </IBResponse> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Remember. Change the request message to the one below and click on the green icon. Log in PeopleSoft. Page 30 of 84 .V1"> <soapenv:Header/> <soapenv:Body> <m80:Update__CompIntfc__CI_PERSONAL_DATA_IBCOURSE> <m80:EMPLID>KU0001</m80:EMPLID> <m80:PERS_DATA_EFFDT> <m80:EFFDT_1>2011-01-02</m80:EFFDT_1> <m80:MAR_STATUS>M</m80:MAR_STATUS> <m80:MAR_STATUS_DT>2011-01-02</m80:MAR_STATUS_DT> </m80:PERS_DATA_EFFDT> </m80:Update__CompIntfc__CI_PERSONAL_DATA_IBCOURSE> </soapenv:Body> </soapenv:Envelope> You will get following Error response: Response <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.com/Enterprise/Tools/schemas/M803237. Click on tab web services. Now add access to all the operations for this service. <soapenv:Envelope xmlns:soapenv="http://schemas.

w3.com/Enterprise/Tools/schemas/M473088.Training Integration Broker Click on the Edit link behind the service CI_CI_PERSONAL_DATA_IBCOU.org/2001/XMLSchemainstance"> <soapenv:Body> <m80:Update__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse xmlns:m80="http://xmlns. Click on Full Access (All) to provide access to all the operations and click on the button OK and finally Save.org/soap/encoding/" xmlns:xsd="http://www.V1"> <m80:notification>1</m80:notification> <m80:detail/> </m80:Update__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse> </soapenv:Body> </soapenv:Envelope> Page 31 of 84 .xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.org/2001/XMLSchema" xmlns:xsi="http://www.oracle. Response <soapenv:Envelope xmlns:soapenv="http://schemas. As you can see you only provided access to operation _G. Now go back to SoapUI and invoke the request again.w3.xmlsoap.

Call PeopleSoft Service PeopleCode In this paragraph you will write PeopleCode to invoke to Component Interface service.Training Integration Broker Check online if Marital Status has been changed. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup> Services and open service CI_CI_PERSONAL_DATA_IBCOU. Click on operation link CI_CI_PERSONAL_DTA_IBCOU_G. Page 32 of 84 . In the messages section click on the link View Message for the Request messages.V1.7. You can see that there are 3 rows for the section Biographical History and that the row you just added through the web service is the most current. First have a closer look at het service. 3.

xmlsoap.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.V1"> <EMPLID>XYZ</EMPLID> </Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE> </soapenv:Body> </soapenv:Envelope> The request consists of several parts • Soap-Envelope • Soap-Header • Soap-Body • XML content Page 33 of 84 .org/wss/2004/01/oasis-200401-wss-wssecuritysecext-1.org/soap/envelope/"> <Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE xmlns="http://xmlns. To see an example of the request that you have to construct in PeopleCode.oracle.Training Integration Broker You can see this message is a Nonrowset-based message type.org/ws/2003/03/addressing/" xmlns:xsd="http://www.org/soap/envelope/"> <wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas. In this case you have to create the request message using the XMLDoc API.xmlsoap.xsd"> <wsse:UsernameToken> <wsse:Username>PTDMO</wsse:Username> <wsse:Password>PTDMO</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.w3. Navigate via Main Menu > PeopleTools > Integration Broker > Service Utilities > Generate SOAP Template and choose service CI_CI_PERSONAL_DATA_IBCOU.xmlsoap.xmlsoap.0.w3.org/2001/XMLSchema/" xmlns:xsi="http://www.com/Enterprise/Tools/schemas/M475651.org/wsdl/soap/" xmlns:wsse="http://docs.org/2001/XMLSchemainstance/"> <soapenv:Header xmlns:soapenv="http://schemas.oasis-open.org/soap/envelope/" xmlns:wsa="http://schemas.0"?> <soapenv:Envelope xmlns:soapenc="http://schemas. In this screen you can see the structure of the request message that you have to construct <?xml version="1. If this where a Rowset-based message type you could write PeopleCode using the Record API. Choose operation CI_CI_PERSONAL_DATA_IBCOU_G.

/* Copy constructed request to screen */ &strxml = &XMLDoc. &childNode = &rootNode.CI_CI_PERSONAL_DATA_IBCOU_G. Open PeopleCode editor for record IBCOURSE_WS_DER field REQEUST_BTN event FieldChange. /* Set XMLDOC request to message */ &ReqMsg. This project contains a custom page that you will use to invoke and test the web services.Training Integration Broker Integration Broker will automatically generate the Soap parts upon sending the request. &rootNode = &XMLDoc. /* Create request message container from operation */ &ReqMsg = CreateMessage(Operation. Log in to PeopleSoft and Navigate via Main menu > IBCourse > IBCOURSE Call WS and click on the button Call Service. /* Create XMLDOC request */ &XMLDoc = CreateXmlDoc(). You only have to construct the soap-body using PeopleCode.SetXmlDoc(&XMLDoc).AddText("KU0001").0"?> <Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE> <EMPLID>KU0001</EMPLID> </Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE> Open Application Designer and project IBCOURSE_CUST.IB_SOAPREQ = &strxml. 1. /* Create request message container from operation */ 1 | &ReqMsg = CreateMessage(Operation.GenFormattedXmlString(). Take a closer look at the code. You can see what your code constructed. %IntBroker_Request).CI_CI_PERSONAL_DATA_IBCOU_G. &textNode = &childNode. Copy above code and save the event. IBCOURSE_WS_DER.CreateDocumentElement("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE"). First you created a message object based on the request message of operation CI_CI_DATA_IBCOU_G Page 34 of 84 . %IntBroker_Request). That leaves you with the following message: <?xml version="1.AddElement("EMPLID").

3 | &rootNode = &XMLDoc.CreateDocumentElement("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE").GenFormattedXmlString(). 4. The next step is to try to extract specific elements from the response message. 7. 5 | &textNode = &childNode. IBCOURSE_WS_DER. This code will send a synchronous request message through the Integration Broker and receive the response.IB_SOAPRESP = &strxml. Navigate again to your test page and click on the button Call Service. /* Copy response to screen */ &xml = &ResMsg. After this the message body will be extracted and formatted on the screen.IB_SOAPREQ = &strxml. 4 | &childNode = &rootNode. 8 | IBCOURSE_WS_DER.Training Integration Broker /* Create XMLDOC request */ 2 | &XMLDoc = CreateXmlDoc(). then the response looks like this: Page 35 of 84 . Copy below code and add this to the existing FieldChange event. 7. &strxml = &xml. First extract the name of the employee and all rows of the marital status that you added in the previous chapters.SyncRequest(&ReqMsg).SetXmlDoc(&XMLDoc). If you strip the response message from all information that you do not need.GetXmlDoc(). 3.AddElement("EMPLID"). 2.AddText("KU0001"). 8.GenFormattedXmlString(). 5. Create an empty xml object Set root element to Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE Add child element EMPLID under root element Assign element EMPLID the value KU0001 /* Set XMLDOC request to message */ 6 | &ReqMsg. Format the constructed xml to a readable xml format Print formatted xml to screen Now you will extend to code with actually sending the request message and receiving the response message. You can see that you now have a response. Copy constructed xml to request message /* Copy constructed request to screen */ 7 | &strxml = &XMLDoc. /* Send & receive message */ &ResMsg = %IntBroker.

GetElementsByTagName("PERS_DATA_EFFDT"). If &aEffDT. 0.Douglas</NAME> <PERS_DATA_EFFDT> <EFFDT_1>2011-01-02</EFFDT_1> <MAR_STATUS>M</MAR_STATUS> <MAR_STATUS_DT>2011-01-02</MAR_STATUS_DT> <SEX_0>M</SEX_0> <HIGHEST_EDUC_LVL_0>A</HIGHEST_EDUC_LVL_0> <FT_STUDENT>N</FT_STUDENT> <LANG_CD_0/> <ALTER_EMPLID/> </PERS_DATA_EFFDT> <PERS_DATA_EFFDT> <EFFDT_1>2011-01-01</EFFDT_1> <MAR_STATUS>D</MAR_STATUS> <MAR_STATUS_DT>2011-01-01</MAR_STATUS_DT> <SEX_0>M</SEX_0> <HIGHEST_EDUC_LVL_0>A</HIGHEST_EDUC_LVL_0> <FT_STUDENT>N</FT_STUDENT> <LANG_CD_0/> <ALTER_EMPLID/> </PERS_DATA_EFFDT> <PERS_DATA_EFFDT> <EFFDT_1>1980-01-01</EFFDT_1> <MAR_STATUS>M</MAR_STATUS> <MAR_STATUS_DT>1980-01-01</MAR_STATUS_DT> <SEX_0>M</SEX_0> <HIGHEST_EDUC_LVL_0>A</HIGHEST_EDUC_LVL_0> <FT_STUDENT>N</FT_STUDENT> <LANG_CD_0/> <ALTER_EMPLID/> </PERS_DATA_EFFDT> </Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse> You can see that there is 1 element NAME under the root node and that there is a repeating element PERS_DATA_EFFDT 3 times with the elements EFFDT_1 and MAR_STATUS. MessageBox(0.NodeValue.GetElementsByTagName("NAME").len <> 0 Then &strName = &aName [1].GetElementsByTagName("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse"). 0.NodeValue. /* read response */ &aPersonalData = &xml. End-If. 0.len <> 0 Then &strEffDT = &aEffDT [1]. 0. "". "EffDT: " | &strEffDT | " / Marital Status: " | &strMaritalStatus). If &aMaritalStatus. If &aPersonalData. "Name: " | &strName). End-For.len <> 0 Then /* Get Name */ &aName = &aPersonalData [1]. End-If. If &aName.GetElementsByTagName("MAR_STATUS"). &aEffDT = &aPERS_DATA_EFFDT [&i].len <> 0 Then &strMaritalStatus = &aMaritalStatus [1]. End-If.oracle. For &i = 1 To &aPERS_DATA_EFFDT. /* Get Marital Status */ &aPERS_DATA_EFFDT = &aPersonalData[1]. End-If. You will extract these elements.Training Integration Broker <?xml version="1. Append below code to the existing FieldChange. MessageBox(0.0"?> <Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse xmlns="http://xmlns.V1"> <NAME>Lewis.com/Enterprise/Tools/schemas/M1021932.GetElementsByTagName("EFFDT_1").len &strEffDT = "". "". Page 36 of 84 . &strMaritalStatus = "".NodeValue. &aMaritalStatus = &aPERS_DATA_EFFDT[&i].

The return value of this method is an array of nodes. 0. 0. 9. | End-If. 9 | For &i = 1 To &aPERS_DATA_EFFDT. 8. 16. 1. Page 37 of 84 . "". 12. With method GetElementsByTagName you retrieve the root element from the response message . 16 | &aMaritalStatus = &aPERS_DATA_EFFDT[&i].len <> 0 Then 18 | &strMaritalStatus = &aMaritalStatus [1]. 2. 3. 20. This array of nodes contains all elements of the response message 2 3 4 5 6 7 | If &aPersonalData. 17 | If &aMaritalStatus.GetElementsByTagName("PERS_DATA_EFFDT"). "EffDT: " | &strEffDT | " / Marital Status: " | &strMaritalStatus).len <> 0 Then | &aName = &aPersonalData [1]. You will see that the response message is now processed. 14. 5. "Name: " | &strName). 1 | &aPersonalData = &xml. 18.GetElementsByTagName("MAR_STATUS"). | MessageBox(0.Training Integration Broker Let’s examine the code. 13 | If &aEffDT. 13. 6.NodeValue. "". 4. | If &aName. 19 | End-If. 20 | MessageBox(0. Retrieve element PERS_DATA_EFFDT under root element by &aPersonalData [1] Loop through array van nodes (there are 3 indexes) Retrieve node EFFDT_1 under element PERS_DATA_EFFDT by &aPERS_DATA_EFFDT [&i] Check whether the array of nodes on EFFDT_1 is not empty Retrieve value for node EFFDT_1 Retrieve node MAR_STATUS under element PERS_DATA_EFFDT by &aPERS_DATA_EFFDT [&i] Check whether the array of nodes on MAR_STATUS is not empty Retrieve value for node MAR_STATUS Print value of Name to Messagebox Navigate again to your test page and click on the button Call Service. 11 | &strMaritalStatus = "". 12 | &aEffDT = &aPERS_DATA_EFFDT [&i]. 17.GetElementsByTagName("NAME").GetElementsByTagName("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse"). 0.NodeValue. 0.GetElementsByTagName("EFFDT_1").NodeValue. 15 | End-If.len <> 0 Then | &strName = &aName [1]. Check whether the array of nodes on the root is not empty Retrieve element NAME under root element by &aPersonalData[1] Check whether the array of nodes for NAME is not empty Retrieve value for element NAME Print value of Name to Messagebox 8 | &aPERS_DATA_EFFDT = &aPersonalData[1].len <> 0 Then 14 | &strEffDT = &aEffDT [1].len 10 | &strEffDT = "".

New SoapUI Project and enter GetPersonExt. CALL EXTERNAL SERVICE It often happens that you have to call an external service from PeopleSoft and that the development environment is not connected to the external system.wsdl as an example to create the Mock Service. To develop a proper call in PeopleSoft and to be able to test your code you can create a “stub” that will simulate the external system.1. 4. SoapUI has an option to expose the WSDL of the service of the external system as a Mock Service.wsdl and click on the button OK. Mock Service Start SoapUI and choose via File . With the right mouse button click on the porttype GetPersonPortType Page 38 of 84 . This Mock Service has the ability to host the WSDL as a service and respond to calls. You will be using the GetPersonExt. SoapUI will read the WSDL.Training Integration Broker 4.

Double click on the operation GetPerson on the right. Leave all options default and click on OK. Leave the name of the Mock Service default and click on OK.Training Integration Broker Select Generate Mock Service in the popup menu. A Mock Service is now created. Page 39 of 84 .

A default Response message will be created.Training Integration Broker Double click on Response 1. The next screen will be shown. Click on the icon SOAP on the left top corner to create a default request message and set the endpoint of the Mock Service. Change the question marks to your own name and userid. Page 40 of 84 . Click on OK.

You will now “run” the Mock Service. Click on the green run icon. You will create a new node that you will use for your routing. You will now import the WSDL of the external system in PeopleSoft and modify the endpoint of the external system to the endpoint of the Mock service. Page 41 of 84 . Now click on the green run icon to invoke the Mock Service and you will see it return a response. 4. Create Node By default all outbound routings in PeopleSoft will use the WSDL_NODE node. After that you will write PeopleCode to call the service.Training Integration Broker In the screen above you can see the that the default request and the endpoint of the Mock Service is setup. The Mock Service is now active.2. Click left in the screen on Request 1 and the request screen will show. Go to the Mock Service screen. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Nodes and choose tab Add New Value.

You will use this node in the following steps.Training Integration Broker Create a new node called IBCOURSE_EXT_NODE. Page 42 of 84 . Change the values a shown in above screenshot and Save.

Import WSDL Navigate via Main Menu > PeopleTools > Integration Broker > Web Services > Consume Web Service.Training Integration Broker 4.3. Page 43 of 84 . Select GetPersonExt. Select the service and click on Next on the second step. Select File and click on the button Load from File.wsdl and click on the button Next.

Leave the message names default and click on Next.Training Integration Broker Select the service operation and click on Next on the third step. Page 44 of 84 .

Click on View Consumed Service to have a closer look at the generated service definition. Click on the link GETPERSON.V1 to see the service operation. Click on Finish. The service definition of the external service is now imported in PeopleSoft.Training Integration Broker Select Use Existing Node and choose node IBCOURSE_EXT_NODE. Page 45 of 84 .

Training Integration Broker Click on the link Service Operation Security. Add permission list IBCOURSE. Page 46 of 84 . Click on tab Routings and select the routings link.

Training Integration Broker

Change the Log Detail to Header and Detail. This will enable logging of the messages and errors. Click on de tab Connector Properties.

Change property SOAPUpContent to N. If this property is set to Y, Integration Broker will generate a Soap-Envelope, Soap-Header and a Soap-Body wrapper for the XML message that you will send. In this case you want to create a Soap wrapper using PeopleCode and set the target namespace yourself.

Page 47 of 84

Training Integration Broker

Change the property URL to the endpoint of the Mock Service like this example: http://[domain]:8088/mockGetPersonPortType Note: You will call the endpoint of the Mock Service for test purposes only (on your development environment). On a production environment you will have to set the endpoint back to the endpoint provided in the WSDL of the external service. Save the changes. Before you start writing, let’s have a closer look at the generated messages. This will tell you which PeopleCode API’s you should use and how the XML message should be constructed. Go back to the Service Operation and go to section Message Information.

Click on the link View Message behind the Request Message.

The request message is a Nonrowset-based message. You will have to use the XMLDOC class.

Page 48 of 84

Training Integration Broker

Click on the link View Message behind the Response Message

You can see that the Response Message is of type Document. This is a new type introduced in PeopleTools 8.51. You will have to use the PeopleCode class Document for this type.

4.4. PeopleCode
Open Application Designer and the PeopleCode editor for record IBCOURSE_WS_DER field REQUEST_BTN event FieldChange. Add following line above the existing PeopleCode:
If IBCOURSE_WS_DER.IBCOURSE_CALL_TYPE = "C" Then

And following line under the existing PeopleCode:
End-if;

You will reuse this FieldChange to call the different types of call using the dropdown value of the field IBCOURSE_WS_DER.IBCOURSE_CALL_TYPE.

Page 49 of 84

Training Integration Broker

Copy below code under the existing PeopleCode.
If IBCOURSE_WS_DER.IBCOURSE_CALL_TYPE = "E" Then /* construct SOAP message */ &Sdoc = CreateSOAPDoc(); &Sdoc.AddEnvelope(0); &EnvNode = &Sdoc.EnvelopeNode; &AddEnvelopeAttribute = &EnvNode.AddAttribute("xmlns:get","http://ibcourse.com/getPerson.wsdl/"); &Sdoc.AddHeader(); &Sdoc.AddBody(); &Sdoc.AddMethod("get:PersonID", 1); &MethodNode = &Sdoc.MethodNode; &textNode = &MethodNode.AddText("12345"); /* copy SOAP message to input message of service */ &msg = CreateMessage(Operation.GETPERSON, %IntBroker_Request); &msg.SetXmlDoc(&Sdoc.XmlDoc); &strxml = &Sdoc.XmlDoc.GenFormattedXmlString(); IBCOURSE_WS_DER.IB_SOAPREQ = &strxml; /* Send & receive message */ &msg = %IntBroker.SyncRequest(&msg); &Doc = &msg.GetDocument( True); &strxml = &Doc.GenXmlString( False); &XMLDoc = CreateXmlDoc(&strxml); &strxml = &XMLDoc.GenFormattedXmlString(); IBCOURSE_WS_DER.IB_SOAPRESP = &strxml; &Compound = &Doc.DocumentElement; &Primative = &Compound.GetPropertyByName("FirstName"); MessageBox(0, "", 0, 0, &Primative.Value); &Primative = &Compound.GetPropertyByName("LastName"); MessageBox(0, "", 0, 0, &Primative.Value); &Primative = &Compound.GetPropertyByName("Userid"); MessageBox(0, "", 0, 0, &Primative.Value); End-If;

Login to PeopleSoft and Navigate to the IBCourse test page. Select External for Call WS Type and click on the button Call Service.

Page 50 of 84

| &msg. &Sdoc. 19. 18. | IBCOURSE_WS_DER.MethodNode. | &strxml = &Sdoc. & Primitive. %IntBroker_Request). | &XMLDoc = CreateXmlDoc(&strxml).GenFormattedXmlString().com/getPerson. 6. 20.IB_SOAPRESP = &strxml. The Mock Service returned the response you have set.GetDocument( True).Value). 9. &EnvNode = &Sdoc. 5.GenXmlString( False). 11. 16. 2. 12. &MethodNode = &Sdoc. Create request message for Operation GETPERSON Copy soap message to request message Format XML Print formatted XML to screen You now have a filled request message. Send request message and receive the response message Copy Document from response Copy XML from Document Create a XMLDOC from XML Format XML Print formatted XML to screen Read root node from response Get node Firstname Print value Firstname to screen Page 51 of 84 .XmlDoc. &textNode = &MethodNode.GenFormattedXmlString(). /* 14 15 16 17 18 19 20 21 22 Send & receive message */ | &msg = %IntBroker. Create a Soap wrapper Add soap-Envelope to the wrapper Get a reference to the envelope node Add custom namespace to envelope Add soap-Header Add soap-body Add root node to soap-body Get a reference to the root node Set vale to root node You have now constructed a soap message. | MessageBox(0. 17. 1. | &strxml = &XMLDoc.IB_SOAPREQ = &strxml. 0. &Sdoc. &Sdoc. &Sdoc. 0.XmlDoc). 22. 13. /* 10 11 12 13 copy SOAP message to input message of service */ | &msg = CreateMessage(Operation.GetPropertyByName("FirstName"). | &Primitive = &Compound.AddHeader(). 15.DocumentElement.Training Integration Broker You can see that the request is being constructed and send. | &Compound = &Doc.AddText("12345"). | &strxml = &Doc. | &Doc = &msg. 8. &AddEnvelopeAttribute = &EnvNode.AddEnvelope(0). Let’s have a closer look at the code. You will now send the request through the Integration Broker and read the response message. 7. "". | IBCOURSE_WS_DER.wsdl/"). You will now copy the soap message to the request message. 10.AddBody(). 4. 1). 14."http://ibcourse.AddAttribute("xmlns:get". 1 2 3 4 5 6 7 8 9 | | | | | | | | | &Sdoc = CreateSOAPDoc().SyncRequest(&msg).AddMethod("get:PersonID".SetXmlDoc(&Sdoc.EnvelopeNode.GETPERSON. 3. 21.

Most of the time you want to control what happens instead of using the full business logic of the component. Click on Add. CUSTOM PEOPLESOFT APPLICATION CLASS SERVICE During assignment 2 you had exposed a Component Interface as a service. For this you are going to create a service with an Application Class Handler. You will create a synchronous service that will return Job Data for a specific Employee. Page 52 of 84 . Choose Rowset for Type and give the message the name IBCOURSE_WS_REQ with Version V1.1.Training Integration Broker 5. 5. Messages First you need to create a request and response message. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Messages and choose Add New Value. Click on the link Add Record to Root.

You can see the message is based on the record IBCOURSE_WS_REQ. Page 53 of 84 . Now create a response message in the same manor but with the name IBCOURSE_WS_RES with record IBCOURSE_WS_RES.Training Integration Broker Choose record IBCOURSE_WS_REQ and click on the button OK. Save the message.

Training Integration Broker 5.2. In the section Service Operation create a new operation with name IBCOURSE_SYNC_WS with operation Type Synchronous and click on the button Add. Service Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Service and choose Add New Value. Add a description for the service. Page 54 of 84 . After that you will create an Operation for this service. Create a Service with name IBCOURSE_CUST_WS and click on the button Add.

Select this and add Permission List IBCOURSE.V1 as request message.Training Integration Broker Add a description for the Operation. Select IBCOURSE_WS_REQ. Save the operation. Select IBCOURSE_WS_RES. Page 55 of 84 . The Service Operation Security link is now visible.V1 as response message. Check the checkboxes Generate Any-to-Local and Generate Local-to-Local.

Class IBCOURSE_SYNC_WS implements PS_PT:Integration:IRequestHandler method OnRequest(&MSG As Message) Returns Message. Open Application Designer and choose New Application Package. Double click on the Application Class and the Class Editor will be opened. Method OnRequest /+ &MSG as Message +/ /+ Returns Message +/ /+ Extends/implements PS_PT:Integration:IRequestHandler. Give the Application Class the name IBCOURSE_SYNC_WS. Right click on the package and select Insert App Class.3.OnRequest +/ Local Rowset &RSReq. &RSRes. Page 56 of 84 . PeopleCode You have now created a service and an operation. Local Message &Response. Copy the code below in the Editor and save the code: Import PS_PT:Integration:IRequestHandler. Save the Application Package as IBCOURSE_WS_PCK. method OnError(&MSG As Message) Returns string. End-Class.Training Integration Broker 5. You can now create the service operation handler code.

Training Integration Broker Local string &Emplid. /* Copy like named fields and records to Response */ &Response. Class IBCOURSE_SYNC_WS implements PS_PT:Integration:IRequestHandler method OnRequest(&MSG As Message) Returns Message.IBException. &msgNumber = &MSG.OnRequest +/ Local Rowset &RSReq. &MSG. The OnRequest method will handle the incoming message and return a response message. If &MSG. Record.IBCOURSE_SYNC_WS. /* Read Request */ &RSReq = &MSG. &RSRes. Page 57 of 84 .IsEditError Then Exit (1). All synchronous service handlers will have to extend this class. Import PS_PT:Integration:IRequestHandler. It starts off with importing the base class PS_PT:Integration:IRequestHandler. Return &errText. End-Method.GetRecord(1). &Emplid = &RSReq(1). Method OnError /+ &MSG as Message +/ /+ Returns String +/ /+ Extends/implements PS_PT:Integration:IRequestHandler. Record. Then you create your own class with the mandatory two methods OnRequest and OnError.GetRowset().JOB). &msgSetNumber. /* Get Response */ &Response = CreateMessage(Operation. &errText = &errText | " " | &msgNumber | " " | &msgSetNumber.IBException. Local string &errText.JOB. &RSRes.IBException.ToString( False). End-Method. /* Get Rowset for response */ &RSRes = CreateRowset(Record.MessageNumber. End-Class. Let’s have a closer look at the code.IBCOURSE_WS_RES). Return &Response.ExecuteEdits().CopyRowset(&RSRes.Fill("where EMPLID =:1". method OnError(&MSG As Message) Returns string. The OnError method will be called if the processing of the OnRequest encounters any errors and a Fault message will be returned.OnError +/ Local integer &msgNumber.EMPLID. End-If.Value. %IntBroker_Response). &Emplid). Method OnRequest /+ &MSG as Message +/ /+ Returns Message +/ /+ Extends/implements PS_PT:Integration:IRequestHandler.MessageSetNumber. &msgSetNumber = &MSG. &errText = &MSG.

End-Method.IBCOURSE_SYNC_WS. End-If. &MSG. If &MSG. First you will validate the request message using ExecuteEdits. Now you can read the rowset just as you would when reading the component buffer. With this method you can validate all PeopleSoft system edits. Give the handler a name like CustomHandler. then the OnError method of this class is triggered with Error(1). 5.JOB). &Emplid = &RSReq(1). With MSG. Because your service operation has a request message of type Rowset-based. Finally you can create a rowset that you will use for the response message.Fill("where EMPLID =:1". Record. Record. […] Return &Response. /* Get Response */ &Response = CreateMessage(Operation.Training Integration Broker Local Message &Response.4. Select Implementation Application Class. you can make full use of the PeopleSoft Rowset/Record classes and methods. The processing stops and the default response is constructed. XLAT values or Prompts. Local string &Emplid.CopyRowset(&RSRes. like Required Fields.GetRowset you can read the rowset from the message in a Rowset object. /* Read Request */ &RSReq = &MSG.GetRecord(1). &Emplid). /* Copy like named fields and records to Response */ &Response. You do not have to explicitly code these validations.IsEditError Then Exit (1). &RSRes.EMPLID. If the ExecuteEdits faults. Select Type On Request.JOB. Page 58 of 84 . Routing and Handler Open Operation IBCOURSE_SYNC_WS and click on the tab Handlers.ExecuteEdits().GetRowset().IBCOURSE_WS_RES). /* Get Rowset for response */ &RSRes = CreateRowset(Record.Value. Click on link Details. After this you can create the Response message object based on the Response message of the operation. %IntBroker_Response).

5. You can now deploy the Service. In the Handler screen click on Save to save the changes.Training Integration Broker Add Handler details as shown in the screen above and click on OK. Now click on the link Return to Service. Deploy Service Page 59 of 84 . 5.

Select the Service Operation and click on Next. Click on Next in the View WSDL screen. Page 60 of 84 .Training Integration Broker Click on the link Provide Web Service to start the Deploy wizard. Click on Finish.

Training Integration Broker The result screen will show the generated WSDL URL of the deployed service. Page 61 of 84 . But first you want to test the service from PeopleSoft. Service Operation Tester Navigate via Main Menu > PeopleTools > Integration Broker > Service Utilities > Service Operation Tester. Choose Operation IBCOURSE_SYNC_WS. You will use this WSDL later on and import it in SoapUI to test the service from outside of PeopleSoft. 5.6.

Training Integration Broker Click in above screen on the link EMPLID. On the next screen click on Invoke Operation and you can see the response is being returned. Page 62 of 84 . Add KU0001 as value and click on OK.

1. Open SoapUI and choose File .New Project.Training Integration Broker 5. Supply the WSDL and click on OK. http://<yourserver>:<port>/PSIGW/PeopleSoftServiceListeningConnector/PSFT_HR/IBCO URSE_CUST_WS. Call from SoapUI Now let’s try to call the service from outside of PeopleSoft.7.wsdl Page 63 of 84 .

com/Enterprise/Tools/schemas/IBCOURSE_WS_REQ. Modify the request to a simplified request like shown on the next page and click on the green Run button.V1"> <soapenv:Header/> <soapenv:Body> <ibc:IBCOURSE_WS_REQ> <ibc:MsgData> <ibc:Transaction> <ibc:IBCOURSE_WS_REQ class="R"> cl <ibc:EMPLID IsChanged="N">KU0001</ibc:EMPLID> </ibc:IBCOURSE_WS_REQ> </ibc:Transaction> </ibc:MsgData> </ibc:IBCOURSE_WS_REQ> </soapenv:Body> </soapenv:Envelope> Page 64 of 84 . <soapenv:Envelope xmlns:soapenv="http://schemas.org/soap/envelope/" xmlns:soapenv="http://schemas.xmlsoap.xmlsoap.oracle.org/soap/envelope/" xmlns:ibc="http://xmlns.Training Integration Broker Double click onReqeuest 1 You can see that the default request is constructed based on the definition in the WSDL.

Page 65 of 84 . &RS = CreateRowset(Record. Now let’s write some PeopleCode to call this service from PeopleSoft. /*Copy the rows from the rowset to the message object */ &msgReq. Copy below code beneath the existing PeopleCode. End-If.IBCOURSE_WS_REQ.IB_SOAPRESP = &strxml. /* Send & receive message */ &msgRes = %IntBroker.IBCOURSE_WS_REQ. strxml). &RS(1).Training Integration Broker The service is now also successfully invoked from outside of PeopleSoft. IBCOURSE_WS_DER.IBCOURSE_CALL_TYPE = "P" Then Local Message &msgReq. &strxml rxml = &XMLDoc. IBCOURSE_WS_DER.GenFormattedXmlString(). &XMLDoc = CreateXmlDoc(&strxml). &strxml = &msgReq. Open PeopleCode editor for record IBCOURSE_WS_DER field REQEUST_BTN event FieldChange.EMPL &RS(1).GenFormattedXmlString(). %IntBroker_Request).GenXMLString(). &msgReq = CreateMessage(Operation. &strxml = &XMLDoc.Value = "KU0001". If IBCOURSE_WS_DER.IBCOURSE_SYNC_WS. &XMLDoc = CreateXmlDoc(&strxml). &strxml = &msgRes.8.SyncRequest(&msgReq).CopyRowset(&RS). Local Rowset &RS. PeopleCode call Open Application Designer.EMPLID.GenXMLString(). 5.IBCOURSE_WS_REQ). &msgRes.IB_SOAPREQ = &strxml.

Select Custom PeopleSoft WS and click on Call Service You can see the request and response.based services.Training Integration Broker You can notice right away the coding rowset based services is a lot simpler than nonrowset. Page 66 of 84 . Log in to PeopleSoft and navigate to the IBCourse test page.

Training Integration Broker 6. Setup Transform Message You will start with creating an XSD. 6. Make a new message like shown in above screenshot and click on Add. <?xml version="1. The downside of using Rowset-based messages is that the messages have a lot of unnecessary overhead for non-PeopleSoft systems. In this assignment you will transform the response message using XSLT to a more simplified format.oracle.com/Enterprise/Tools/schemas/IBCOURSE_TRANSFOR M_RES. Also you can simply use record validations like required fields.w3.oracle.V1" xmlns:xs="http://www.0"?> <xs:schema targetNamespace="http://xmlns. prompts or XLAT values without writing additional code. TRANSLATIONS In the previous assignment you have created a service with Rowset-based messages. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Messages and choose Add a New Value. Page 67 of 84 .1.com/Enterprise/Tools/schemas/IBCOURSE_TRANSFORM_RES. Instead of recreating the service. you can make use of translations.V1" xmlns="http://xmlns. The use of Rowset-based messages enables you to use PeopleCode objects like Records and Rowsets. Translations can be used to transform XML layout and XML values. Click on the tab Schema.org/2001/XMLSchema"> <xs:element name="Person"> <xs:complexType> <xs:sequence> <xs:element name="EmployeeID" type="xs:string"/> <xs:element name="StartDate" type="xs:string"/> <xs:element name="FunctionCode" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> You will now create a message based on this XSD.

Enter the XSD and click on Save. 6. You will now create an XLST Application Engine.Training Integration Broker Click on the button Add Schema. Go to tab Advanced.New . Page 68 of 84 . Add the values as shown above and click on OK.Application Engine.2. Setup XSLT Application Engine Open Application Designer and choose File .

Page 69 of 84 .Training Integration Broker Right click on Step01 and choose Insert Action. Double click on the action XSLT. Select Action type XSLT and set Graphical Mapper to Yes and save the Application Engine. JDeveloper will start and the XSL Mapper will be shown.

0645) AT [MON JAN 17 20:20:24 GMT 2011].com/Enterprise/Tools/schemas/IBCOURSE_TRANSFORM_RES. The XSLT will automatically be saved in the Application Engine Action. DO NOT MODIFY.3.0"?> <?oracle-xsl-mapper <!-. V1"/> </target> </mapTargets> <!-.org/ws/2003/03/business-process/ Page 70 of 84 .V1.GENERATED BY ORACLE XSL MAPPER 10.oracle.xsd"/> <rootElement name="Person" namespace="http://xmlns.xmlsoap.0(build 080718.. You can now map the fields. <?xml version="1.4. -> <mapSources> <source type="XSD"> <schema location="http://<yourserver>:<port>/PSIGW/PeopleSoftServiceListeningConnector/PSFT _HR/IBCOURSE_WS_RES. Click on the source tab in JDeveloper XSL and have a closer looks at the XSL that has been created. --> ?> <xsl:stylesheet exclude-result-prefixes="xsl xs ns0 xref xp20 bpws ora ehdr orcl ids hwf" version="1. Save the XSL in JDeveloper.Training Integration Broker On the left you will see the PeopleSoft Rowset-based message and on the right the new Nonrowsetbased message.V1.1.0" xmlns:bpws=http://schemas.xsd"/> <rootElement name="IBCOURSE_WS_RES" namespace=""/> </source> </mapSources> <mapTargets> <target type="XSD"> <schema location="http://<yourserver>:<port>/PSIGW/PeopleSoftServiceListeningConnector/PSFT _HR/IBCOURSE_TRANSFORM_RES.SPECIFICATION OF MAP SOURCES AND TARGETS. Create the mapping by dragging and dropping the fields from left to right.

com/XSL/Transform/java/oracle.ExtFunc" xmlns:xp20="http://www.com/Enterprise/Tools/schemas/IBCOURSE_TRANSFORM_RES. Navigate via Main Menu > PeopleTools > Integration Broker > Service Utilities > Service Administration.functio ns. Delete WSDL To modify the routing you need to delete the WSDL first.oracle.com/XSL/Transform/java/oracle.w3.xref.Training Integration Broker xmlns:ehdr="http://www.com/bpel/workflow/xpath" xmlns:ids="http://xmlns.oracle.XRefXPat hFunctions" xmlns:xs="http://www.org/1999/XSL/Transform"> <xsl:template match="/"> <ns0:Person> <EmployeeID> <xsl:value-of select="/IBCOURSE_WS_RES/MsgData/Transaction/IBCOURSE_WS_RES/EMPLID"/> </EmployeeID> <StartDate> <xsl:value-of select="/IBCOURSE_WS_RES/MsgData/Transaction/IBCOURSE_WS_RES/EFFDT"/> </StartDate> <FunctionCode> <xsl:value-of select="/IBCOURSE_WS_RES/MsgData/Transaction/IBCOURSE_WS_RES/JOBCODE"/> </FunctionCode> </ns0:Person> </xsl:template> </xsl:stylesheet> 6.oracle.services.tip.services.tip.oracle. ESBHeaderFunctions" xmlns:hwf="http://xmlns.tip.Xpath20" xmlns:xref="http://www.functio ns. Page 71 of 84 .w3.server.com/XSL/Transform/java/oracle.pc.com/XSL/Transform/java/oracle.com/bpel/services/IdentityService/xpath" xmlns:ns0="http://xmlns.oracle.oracle.3.com/xpath/extension" xmlns:orcl="http://www.esb.tip.org/2001/XMLSchema" xmlns:xsl="http://www.headers.oracle.oracle. V1" xmlns:ora="http://schemas.pc.xpath.

Select routing Any-to-PSFT_HR.4. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Services and open service IBCOURSE_CUST_WS. Select operation IBCOURSE_SYNC_WS and go to the Routing tab. Add Transformation to Service You will now add the Transform Application Engine to the service.Training Integration Broker 6. Add Transform to field Program 1 and Save the Routing. Page 72 of 84 .

5. 6. Navigate via Main Menu > PeopleTools > Integration Broker > Integration Setup > Services and save service IBCOURSE_CUST_WS. since the response message definition has been changed. Invoke the request and you will see that the response is now returned in the translated simplified response.Training Integration Broker 6. Page 73 of 84 . without having to change your service handler logic. Provide Service You will have to deploy the service again. Call service using SoapUI Open SoapUI and open project IBCOURSE_CUST_WS. Click on the link Provide Web Service and walk through h all the steps of the Wizard.6.

If the process scheduler is not running yet. Activate Pub/Sub Servers In this step you will create an Application Engine and a Handler.50 and beyond it is possible to create an Application Engine Handler for operations. After activating the Pub/Sub Servers. For this the Pub/Sub processes and the Process Scheduler need to be running.1.Training Integration Broker 7. start it now. The Application Engine initiated via the Integration Broker will be processed by the Process Scheduler. Activate Process Scheduler The Application Engine will be processes by the Process Scheduler. Start psadmin and activate the Pub/Sub servers. Using this handler it is possible to initiate Application Engines via the Integration Broker. APPLICATION ENGINE HANDLER From PeopleTools 8.2. Page 74 of 84 . start the application server. Initiating an Application Engine via the Integration Broker has a few advantages: • No scheduling. the Integration Broker • Application Engines can become part of business processes 7. 7. less maintenance • Initiation by the requester • No more FTP files (security wise) • Single point of entry of data.

GetRowset(). MessageBox(0. &Emplid). IBCOURSE_AET. "". Local Message &MSG.EMPLID. Select File .IBCOURSE_WS_REQ. Right click on Step 01 and choose Insert Action Select PeopleCode as type. %IntBroker_SUB). MessageBox(0.Application Engine. &Emplid = &RS(1). 0. 0. 0.RUN_CNTL_ID). Click on the properties button. You will now assign this Application Engine as a Handler to the service IBCOURSE_CUST_WS.Value. Create Application Engine Open Application Designer. /* Get Transaction ID from Integration Gateway which invoked this AE */ &StrTransaction = %IntBroker.RUN_CNTL_ID). 0. Save the Application Engine as IBCOURSE_AEH. "".GetIBTransactionIDforAE(IBCOURSE_AET. Go to tab State Records and select state record IBCOURSE_AET and finally click on Add. /* do processing */ Save the Application Engine. IBCOURSE_AET.Training Integration Broker 7. 0.OPRID.OPRID). MessageBox(0. /* Get message from Integration Gateway belonging to Transaction ID */ &MSG = %IntBroker. "". Double click on the PeopleCode Action to open the PeopleCode Editor.3.New . &RS = &MSG. Copy the PeopleCode below: Local Rowset &RS.GetMessage(&StrTransaction. 0. Page 75 of 84 . IBCOURSE_AET.

In the Service Operations section add a new operation like shown in screen above and click on Add. Provide access to the operation. Application Engine Handler Open PeopleSoft and navigate to Service IBCOURSE_CUST_WS. Check the checkboxes Generate Any-To-Local and Generate Local-To-Local. In the Message Information add the request message and queue as shown above.Training Integration Broker 7.4. Page 76 of 84 .

Go back to the Service screen. Click on Provide Web Service. Page 77 of 84 . Enter the Application Engine as the Program Name and click on OK.Training Integration Broker Go to tab Handlers Enter the handler like shown above and click on link Details.

Navigate via Main Menu > PeopleTools > Process Scheduler > Processes and click on tab Add New Value.Training Integration Broker Select both operations and walk through the Deploy Wizard.5. For this you need to create a process definition first. 7. Save the process. Page 78 of 84 . Create Process When invoking the service the Application Engine will be run through the Process Scheduler. Click on tab Process Definition Options and select Process Group TLSALL.

Page 79 of 84 . Navigate via Main Menu > PeopleTools > Integration Broker > Service Operation Monitor > Monitoring > Asynchronous Services.6. Enter value KU0001 for field Emplid and click on Invoke Operation. Test Operation You will now test the service operation.Training Integration Broker 7. Select Service Operation IBCOURSE_ASYNC_AE. Navigate via Main Menu > PeopleTools > Integration Broker > Service Utilities > Service Operation Tester.

Open the stdout file and you can see that Emplid KU0001 is retrieved from the message.01.51.0) Application Engine program IBCOURSE_AEH ended normally PSAESRV completed service request at 10.01. All Rights Reserved PSAESRV started service request at 10. Click on link Details and click on link View Log/Trace in the next page. Navigate via Main Menu > PeopleTools > Process Scheduler > Process Monitor.19 2011-01-19 PS (0.04 . You can see the status of the Handler is Done. PeopleTools 8.0) KU0001 (0. Let’s check if the Application Engine really was initiated.0) ~GEN~71494795 (0.Application Engine Server Copyright (c) 1988-2011 Oracle and/or its affiliates.Training Integration Broker Click on the link Details.20 2011-01-19 Page 80 of 84 .

NodeValue. MessageBox(0.len <> 0 Then /* Get Name */ &aName = &aPersonalData [1].NodeValue.IB_SOAPRESP = &strxml. /* Read response */ &aPersonalData = &xml. /* Copy constructed request to screen */ &strxml = &XMLDoc.IBCOURSE_CALL_TYPE = "C" Then /* Create request message container from operation */ &ReqMsg = CreateMessage(Operation. /* Set XMLDOC request to message */ &ReqMsg. &XMLDoc = CreateXmlDoc(). "". End-If. If &aPersonalData.len <> 0 Then &strEffDT = &aEffDT [1].len <> 0 Then &strMaritalStatus = &aMaritalStatus [1]. For &i = 1 To &aPERS_DATA_EFFDT.GetElementsByTagName("EFFDT_1"). IBCOURSE_WS_DER.Training Integration Broker APPENDIX A PEOPLECODE CALL CI If IBCOURSE_WS_DER. Page 81 of 84 . /* Send & receive message */ &ResMsg = %IntBroker. &strxml = &xml. End-If.GetElementsByTagName("MAR_STATUS").CreateDocumentElement("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE").GetXmlDoc(). &aEffDT = &aPERS_DATA_EFFDT [&i]. If &aEffDT. 0. "EffDT: " | &strEffDT | " / Marital Status: " | &strMaritalStatus).SyncRequest(&ReqMsg).GenFormattedXmlString().IB_SOAPREQ = &strxml. /* Create XMLDOC request */ rem &inXMLDoc = CreateXmlDoc("<?xml version='1. &rootNode = &XMLDoc. &strMaritalStatus = "". 0.GetElementsByTagName("Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSEResponse").GetElementsByTagName("PERS_DATA_EFFDT"). 0. If &aMaritalStatus.CI_CI_PERSONAL_DATA_IBCOU_G. End-If. "". If &aName.len &strEffDT = "". /* Copy response to screen */ &xml = &ResMsg. End-If. "Name: " | &strName). %IntBroker_Request).GenFormattedXmlString(). IBCOURSE_WS_DER. &textNode = &childNode.AddElement("EMPLID").0'?> <Get__CompIntfc__CI_PERSONAL_DATA_IBCOURSE/>").len <> 0 Then &strName = &aName [1].AddText("KU0001").SetXmlDoc(&XMLDoc). /* Get Marital Status */ &aPERS_DATA_EFFDT = &aPersonalData[1]. MessageBox(0.NodeValue. 0. End-If. &aMaritalStatus = &aPERS_DATA_EFFDT [&i].GetElementsByTagName("NAME"). &childNode = &rootNode. End-For.

AddEnvelope(0).0. Page 82 of 84 .MethodNode. MessageBox(0.0.GetPropertyByName("LastName").IB_SOAPRESP = &strxml. &strxml = &Sdoc.IB_SOAPREQ = &strxml. &strxml = &XMLDoc.GenFormattedXmlString(). &strxml = &Doc.XmlDoc.AddHeader().SetXmlDoc(&Sdoc.IBCOURSE_CALL_TYPE = "E" Then /* construct SOAP message */ &Sdoc = CreateSOAPDoc().Value). %IntBroker_Request). &XMLDoc = CreateXmlDoc(&strxml). &Primitive = &Compound. /* copy SOAP message to input message of service */ &msg = CreateMessage(Operation.Value)."". IBCOURSE_WS_DER."http://ibcourse. &Sdoc. 1).AddBody(). &Sdoc.0.0. &msg.com/getPerson.GETPERSON.wsdl/"). &Compound = &Doc. &Primitive = &Compound.GenXmlString(False). /* Send & receive message */ &msg = %IntBroker. End-If. &EnvNode = &Sdoc.SyncRequest(&msg).GetDocument(True).GetPropertyByName("Userid").EnvelopeNode. &MethodNode = &Sdoc. &Doc = &msg.0. &Primitive = &Compound.GenFormattedXmlString().DocumentElement."".&Primitive.&Primitive.Value).AddText("12345"). &Sdoc."". MessageBox(0.AddMethod("get:PersonID". MessageBox(0.&Primitive. &textNode = &MethodNode. &AddEnvelopeAttribute = &EnvNode.0.XmlDoc).AddAttribute("xmlns:get".GetPropertyByName("FirstName").Training Integration Broker APPENDIX B PEOPLECODE CALL EXTERNAL SERVICE If IBCOURSE_WS_DER. IBCOURSE_WS_DER. &Sdoc.

Page 83 of 84 .IBCOURSE_SYNC_WS. &strxml = &XMLDoc.GenXMLString(). &msgRes.Training Integration Broker APPENDIX C PEOPLECODE CALL CUSTOM PS SERVICE If IBCOURSE_WS_DER. IBCOURSE_WS_DER. %IntBroker_Request).GenFormattedXmlString(). &RS = CreateRowset(Record.IB_SOAPREQ = &strxml. &XMLDoc = CreateXmlDoc(&strxml). /* Copy the rows from the rowset to the message object */ &msgReq.IB_SOAPRESP = &strxml.GenXMLString(). &XMLDoc = CreateXmlDoc(&strxml). &strxml = &XMLDoc.SyncRequest(&msgReq).IBCOURSE_WS_REQ). IBCOURSE_WS_DER. &msgReq = CreateMessage(Operation. End-If.GenFormattedXmlString(). &RS(1). &strxml = &msgRes.Value = "KU0001".CopyRowset(&RS). /* Send & receive message */ &msgRes = %IntBroker.IBCOURSE_WS_REQ.EMPLID. &strxml = &msgReq.IBCOURSE_CALL_TYPE = "P" Then Local Message &msgReq. Local Rowset &RS.

IBException. &MSG. /* Get Rowset for response */ &RSRes = CreateRowset(Record. Page 84 of 84 .IBException. &RSRes. End-If.ToString( False). method OnRequest /+ &MSG as Message +/ /+ Returns Message +/ /+ Extends/implements PS_PT:Integration:IRequestHandler. method OnError(&MSG As Message) Returns string.IBException.GetRecord(1).MessageSetNumber.IsEditError Then Exit (1). &RSRes. &msgNumber = &MSG.Value. &Emplid).IBCOURSE_WS_RES). &errText = &errText | " " | &msgNumber | " " | &msgSetNumber. end-method. /* Get Response */ &Response = CreateMessage(Operation. Record.GetRowset().EMPLID. Local string &Emplid.IBCOURSE_SYNC_WS.Training Integration Broker APPENDIX D APPLICATION CLASS CUSTOM PS SERVICE HANDLER import PS_PT:Integration:IRequestHandler. %IntBroker_Response).ExecuteEdits(). Local Message &Response.OnError +/ Local integer &msgNumber. method OnError /+ &MSG as Message +/ /+ Returns String +/ /+ Extends/implements PS_PT:Integration:IRequestHandler. Return &Response.Fill("where EMPLID =:1". /* Read Request */ &RSReq = &MSG. &errText = &MSG. &msgSetNumber = &MSG. /* Copy likenamed fields and records to Response */ &Response. &msgSetNumber. end-method. &Emplid = &RSReq(1).CopyRowset(&RSRes. Local string &errText.MessageNumber. end-class.JOB.JOB). class IBCOURSE_SYNC_WS implements PS_PT:Integration:IRequestHandler method OnRequest(&MSG As Message) Returns Message. Return &errText. If &MSG.OnRequest +/ Local Rowset &RSReq. Record.

Sign up to vote on this title
UsefulNot useful