web services in tibco

23
WEB Servies using TIBCO BusinessWorks -Pavan Kumar Kashi

Upload: bangaru-rao-chaparala

Post on 06-Jul-2016

19 views

Category:

Documents


5 download

DESCRIPTION

Web Services in TIBCO

TRANSCRIPT

Page 1: Web Services in TIBCO

WEB Servies using TIBCO BusinessWorks

-Pavan Kumar Kashi

Page 2: Web Services in TIBCO

Contents• Introduction• Components and Terminology• Starting TIBCO Designer• Configuring an adapter instance• Global Variables• Import and Export

Page 3: Web Services in TIBCO

Introduction• TIBCO BW and TIBCO IM can be used to host as

well as invoke Web Services• BW has WSDL and SOAP palettes which are used

for Web Service deployment and invocation• TIBCO BW internally uses Tomcat as the Web

Server to host the service• TIBCO BW allows easy integration of an external

Web Service into the business process• Any BW process can be exposed as a Web Service

without much effort

Page 4: Web Services in TIBCO

WSDL Palette• WSDL palette allows creation of a WSDL

from scratch. • WSDL can be fetched by giving the WSDL

URL of the service• WSDL can be imported as from local file

system as well

Page 5: Web Services in TIBCO

Activities in the SOAP palette

Page 6: Web Services in TIBCO

Invoking a Web Service from TIBCO BW

• SOAP Request Reply activity is used for invocation of Web Services

• Associate the WSDL fetched with this activity• Select the operation that this activity invokes

(target Service may support more than one operation)

• Give/map the values for input parameters• Map the output parameter to the next activity

Page 7: Web Services in TIBCO

Invoking a Web Service from TIBCO BW• Drag and drop the WSDL component to the designer palette.• In the configuration palette for WSDL there is a tab for getting the wsdl file. Click

Copy from URL after giving the URL of the WSDL we want to fetch.

Give URL here

Page 8: Web Services in TIBCO

Invoking a Web Service from TIBCO BW• Drag and drop a process definition and add the request reply mechanism. • SOAP request reply is the one that we can use for invoking web service. So

drag and drop this activity to the design palette.

Page 9: Web Services in TIBCO

Invoking a Web Service from TIBCO BW• In the configuration tab of SOAP Request Reply, click on the service browse

button and get the details of the service from the WSDL document.• Once we get the service selected, the port type, the operation name and the

target endpoint address will come automatically as shown below.

Page 10: Web Services in TIBCO

Invoking a Web Service from TIBCO BW

• Map or hard code the values for the input arguments under input tab of SOAPRequestReply.

• Map output to a file.• Verify the result of invocation by running the process

Page 11: Web Services in TIBCO

Deploying a Web Service in TIBCO BW• Create XSDs to define the input, output, and fault messages for the

web service. • Configure an HTTP Connection resource• Use SOAP Event Source process starter as the first activity in the

process• Associate this activity with the WSDL and the HTTP Connection• Implement business logic using a set of activities from different

palettes• Use SOAP Send Reply as the last activity in sequence to send the

reply to the client who invokes this service• Use SOAP Send Fault activity to send a SOAP fault to the client if an

error occurs during processing of a SOAP request.• If your machine name is blrkec1234 , port used for HTTP Connection

resource is 8000 and if the process name is SOAPService then your service can be accessed using the URL

http:// blrkec1234:8000/ SOAPService

Page 12: Web Services in TIBCO

Deploying a Web Service in TIBCO BW

• Select WSDL from the Activity Palettes and drag and drop the WSDL component to the designer palette.

• Configure WSDL components like message, port type and operation as shown below.

Page 13: Web Services in TIBCO

Deploying a Web Service in TIBCO BW

• Create the input and output messages format for each operation that is part of the service

• Add parameters to the message using the Part table field in the Configuration tab of Message.

Page 14: Web Services in TIBCO

Deploying a Web Service in TIBCO BW

• Add required operations to the port type• Associate the pre-configured messages for each operation using the Message

Table• The WSDL created in this way is abstract since it doesnt contain the binding

information.

Page 15: Web Services in TIBCO

Deploying a Web Service in TIBCO BW• Create the process definition for implementing the web service.• SOAP Event Source which is a process starter is used to receive the incoming

SOAP requests from the client• Associate SOAP Event Source with pre-configured WSDL and HTTP

Connection resources

Page 16: Web Services in TIBCO

Deploying a Web Service in TIBCO BW• After SOAP Event Source use a set of activities to implement the business logic• Use SOAP Send Reply to reply to the client which invoked the service as shown

below.

Page 17: Web Services in TIBCO

Invoking TIBCO BW Web Service• From TIBCO BW

– Save the associated WSDL with a different name (can be copied from WSDL Source tab of SOAP Event Source) to local file system

– Import the saved WSDL and associate it with the SOAP Request Reply Activity

• From outside TIBCO BW– Save the WSDL of the TIBCO BW Web Service– Use a stub/proxy generator tool (e.g. WSDL.exe in .NET,

WSDL2JAVA for AXIS) to convert the WSDL to client code

Page 18: Web Services in TIBCO

Sending SOAP fault• Define a fault schema for each operation specified in WSDL• While designing the WSDL, associate the fault schema to the corresponding

fault message of the operation using Message Table• Use Send SOAP Fault as shown below after associating with the corresponding

Fault Details

Page 19: Web Services in TIBCO

Dynamically Retrieving the WSDL of BW Web Service

• Create a Process Definition with the Retrieve Resource activity of the SOAP palette

• An HTTP Receiver is configured which receives the client request for retrieving the WSDL .

• Retrieve Resources activity is used to retrieve the WSDL for the corresponding target address and the WSDL is send back to the client using the Send HTTP Response activity.

• If your BW Web Service URL is http://mngktr39618:8080/Add use the following HTML to retrieve the WSDL

<html><body>

<form name="frm1" action="http://mngktr39618:8080/Add?wsdl " method="post">

<input type="submit" value="RETRIEVE"></form>

</body></html>

Page 20: Web Services in TIBCO

Dynamically Retrieving the WSDL of BW Web Service

Page 21: Web Services in TIBCO

BW Web Service Inspection• To know about all the services that are running at a

particular server use “inspection.wsil” which will retrieve the target addresses of all the services that are configured at the server.

• The HTML page for retrieving all the service definitions using INSPECTION.WSIL can be written in simple form as shown below.

<html><body>

<form name="frm1" action="http://mngktr39618:8080/inspection.wsil " method="post">

<input type="submit" value="RETRIEVE"></form>

</body></html>

Page 22: Web Services in TIBCO

Exposing Existing BW Process as a Web Service• Analyze functionality offered by your BW process to determine

whether it can be an independent component in the integration scenario

• Determine the process input and output• If input and output are complex, use XSDs to define them• Create WSDL using WSDL palette and define input and output

message formats (associate with predefined XSDs if required)• Use a SOAP Event Source as the first activity, followed by

business logic and then use a SOAP Send Reply to expose the process as a service

• Associate WSDL to SOAP Event Source and SOAP Send Reply to SOAP Event Source

• Handle possible exceptions and use SOAP Send Fault for sending exceptions to the service client

Page 23: Web Services in TIBCO

Thank You