SOAP Event Source Tutorial: How to Expose a Process as Web Service in TIBCO

By | October 6, 2014

After writing complete step by step tutorials on developing SOAP Over HTTP and SOAP over JMS web services in TIBCO; I am now going to write this step by step tutorial in which I will explain how to expose a TIBCO BW process as a web service operation using SOAP Palette activities like SOAP Event Source, SOAP Send Reply and SOAP Send Fault.

Example Scenario:

For explaining the usage of SOAP Palette activities, I am going to take a simple scenario for this step by step tutorial. In this example, I will create a web service operation GetPayInfo which will be taking EmployeeID as an input and will return Payroll details (PayStatus and PayDate) as a response. To keep the things simple, I am not implementing any database part and the response will be sent by hard coding the values in the process instead.

Let’s now proceed step by step with the tutorial on using SOAP Event Source to expose a process as web service:

Step 1: Create HTTP Connection in your TIBCO Project

The web service that we are going to develop will use HTTP as a transport. So the first thing that we need to do is to create a new HTTP Connection by using HTTP Palette. Drag HTTP Connection resource in your project and configure it by specifying host and port. The configurations made by me for the HTTP Connection are shown in below screenshot:

soap event source http connection

 

 

Step 2: Create XML Schema for Input and Output of the Web Service Operation

Before we create an abstract WSDL, we need to have a Schema in which all input and output parameters will be specified. In our case, the schema is simple having EmployeeID as an input while PayStatus and PayDate as output. Schema can be seen in the screenshot below:

soap event source schema

Step 3: Create Abstract WSDL

Abstract WSDL contains all details about a web service including Its operations, WSDL messages and their parameters. For our example scenario, we create a WSDL by dragging WSDL resource into our project. I named it as PayrollAbstractWSDL.

Double click on the WSDL and then add WSDL Messages for Request, Response and Fault. These WSDL messages will refer to the XSD Elements that we created in previous step. We also add PortType for our web service here.

WSDL Messages and PortType will look like below (I am showing configuration part of only one message. Follow the same to configure other two messages):

 

soap event source wsdl messages and porttype

 

Double Click on the PayrollPortType and then add Operation. I named the operation as GetPayInfo. In the configuration of the operation, add Input, Output and Fault Messages in the Message Table as shown below:

soap event source operation

 

Now we are done with this step of creating Abstract WSDL for our web service.

 

Step 4: Create a BW Process using SOAP Palette and Expose as a Web Service

Create a new process in your project. In the proess, drag SOAPEventSource so that It becomes your process starter activity. In the configuration of SOAP Event Source activity, choose the Abstract WSDL, Its operation and the HTTP transport as you can see in the screenshot below:

soap event source configuration

 

Now if you go to WSDL Source tab, you will find Concrete WSDL which has all the details of the service including its transport. Save this concrete WSDL as it will be used by the client to consume the web service.

In order to send a reply back to the consumer from the web service operation, add SOAPSendReply activity in the process. In the configuration tab of this activity, choose SOAPEventSource in the Reply To drop down.

In the Input tab of this activity, I am just hard coding the response values. In real time scenarios, this information will be fetched from database or some other source.

The input tab in my case is shown in the screenshot below:

soap send reply input

 

To cater for exception scenarios and to send a Fault Message as a response, I have added a Catch activity which will catch all types of exceptions. Then next to catch activity, I have used SOAPSendFault activity which is used to send back a Fault response from a web service operation.

Input mapping of SOAP Send Fault activity is shown in below screenshot:

soap send fault configuration tibco

 

 

Now we are done with all the development steps of our web service. Let’s proceed with the testing part of the tutorial.

 

Step 5: Test SOAP Web Service using SOAP UI

You can consume your web service with any SOAP client. I am going to use SOAP UI tool for testing my web service.

By using the Concrete WSDL that was saved in previous step, I have sent a request to the web service and you can see in below screenshot that I have received back a response:

test soap event source web service using soap ui

 

 

 

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

16 thoughts on “SOAP Event Source Tutorial: How to Expose a Process as Web Service in TIBCO

  1. Tariq

    Dear Ajmal

    I would like to thank you for this Tutorial
    but i have problem in SOAPSendFault , it’s give below error
    Job-124000 Error in [Proccess/Test1.process/SOAPSendFault]
    java.lang.NullPointerException

    could you please show me the configuration in WSDL Source for SOAPSendFault

    thank you

    Reply
  2. Pingback: TIBCO Tutorial: Retrieve Concrerte WSDL Using RetrieveResources and Save To a File | TutorialsPedia

  3. Jalil

    Thanks for the tutorial.

    I am unable to open the web service URL “description The requested resource () is not available.”

    I didn’t find the root cause of this error yet, any idea why it’s not working?

    Reply
  4. Madhuri

    I executed above tutorial successfully…

    But I have 1 query while executing the ws in soap UI if i am not providing Employee_ID then also its showing successfully processed…it should through error according to my knowledge ?correct me if I am wrong pls

    if I am right pls provide solution for this

    Thanks in advance

    Reply
  5. Pratik

    Please Write a Post for Debugging.Write to File Activity In Designer and Administrator

    Reply
    1. Ajmal Abbasi Post author

      Hi Murali,

      SOAP UI is not the requirement. You can use any client tool or language to consume the web service. You can even test consuming the service by designing a TIBCO process and using SOAP Request Reply activity in that process.

      Reply
  6. venugopal

    Hi ajmal,

    While practicing the above example(Send HTTP request),Iam getting the Error:”The Http Server replied with a 5XX status code”..So How can I resolve this error.?
    Please Respond with brief explanation.

    Thanks and Regards
    K.Venu

    Reply
  7. Rani Usman

    Thanks, for sharing. I have and issue when try to consume the the WSDL using Oracle Apex. When create Web service reference in Apex it always error “The URL provided did not return a valid WSDL document.”. But when tested using SoapUI it works.

    Reply
    1. Ajmal Abbasi Post author

      Dear Usman,

      I am not much into Oracle but one possibility might be that Oracle is expecting wsdl to be in text/xml format while the one returned here is in text/html format.

      I am aware of same issue while consuming TIBCO web service from .Net as .net failed to add the web reference with text/html wsdl exposed.

      Solution: Create a process that accepts a HTTP request and then sends a http request internally to the SOAP service wsdl url to get the wsdl in text/html format. After that; the process should send the WSDL to the calling party in text/xml format through Send HTTP Response activity (type is specified in header/content-type in the input tab of Send HTTP Response).

      Hope this will help you. Thanks

      Reply
      1. Rani Usman

        Thanks for the reply. After much try and error I decided to use REST adapter instead, since creating web reference manually (copy wsdl request) also not working.

        Reply
  8. sanjib behera

    Nice post and thanks for sharing. I have a question. How can I remove namespace prefix with the response generated by soapsendreply.

    Snippet example of the issue:-

    2015-11-17T15:02:53.789Z
    1000

    what I want is:-

    2015-11-17T15:02:53.789Z
    1000

    can you please let me know what should I do to get the above output?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *