Step By Step: Developing SOAP Web Service In TIBCO

By | November 6, 2013

Web Service Development in TIBCO is one of the basic thing that almost every TIBCO developer has to do. Integrating applications through Web Service Interfaces is a common practice in almost every organization in order to comply with SOA standards.

Developing SOAP Web Service in TIBCO is not a tough job. TIBCO Designer tools make it easy to expose or consume web services in a convenient way without going into the hassle of writing complex code.

This tutorial will guide you step by step how to develop a SOAP web service in TIBCO designer. Web service that we will be developing in this tutorial will expose one function employeeDetails. This function will be exposed in a WSDL and users will be able to get all details about an employee based on employee code.

Step 1: Create New Project:

Create a new project in TIBCO designer. Name it whatever you like. I named it as SOAPTest in the example

create project

Step 2: Create Folders For Proper Organization:

In order to organize components better, create separate folders for Processes, Connections, Schemas, Services etc as shown below:

create folders

Step 3:Create JBDC and HTTP Connections

Our web service operation will be fetching all details about employee from Oracle database. So we need to create a JDBC Connection in our Connections folder. Specify, host, IP, SID, User, Password, driver etc for the connection. Once you are sure all required information is populated, use Test Connection button to test the JDBC connection.

create jdbc connection

We also need to create a HTTP Connection in the same directory which will be used in Endpoint URL of our web service.

create http connection

 

Step 4: Create XML Schema for Input and Output:

Our web service will receive Employee Code as input and will return Employee details as output. We need to create two schemas (XSD files) for this:

  1. EmployeeInfoRequest
  2. EmployeeInfoResponse

Request Schema for our web service will be like below:

 

create input schema

 

Response schema which specifies our web service output structure will like this:

create output schema

 

Step 5 : Create WSDL in TIBCO

There are two ways to generate a web service in TIBCO:

  1. Generating Web Service from Process
  2. Generating Web Service from WSDL

In our case, we will be following second approach. We will create a WSDL in TIBCO and then will generate web service from this wsdl.

create wsdl

Double click on EmployeeWSDL and create a PortType. I named it as EmployeeMgr:

create porttype

Now we need to create Message components which are used to specify type of information being exchanged by our web service. We will create one message for input and one message for output. We will use our Request and Response schemas in these Message components.

Below is the Input Message for our WSDL:

create message for input

 

Below is output Message for our WSDL:

create message for output

 

Double click on PortyType and then create operation in it. I named operation as EmployeeDetails. This will be the only operation exposed in our Web service. In configuration of our operation, we specify input and output messages that we just created.

create wsdl operation

 

Step 6: Create Business Process for Web Service:

Once we have our WSDL ready with all required schemas, connections etc. we need to create our business process which will be doing the actual job. In our case, we will have a process which will fetch employee details from Oracle database table based on Employee Code.  Our database table has following information:

database table query

In Processes folder, I created a business process and I named it as EmployeeDetails. Process looks as below:

create process EmployeeDetails

This is a simple process with only three activities.

  • Start Activity

This activity will be our process starter. In confugration Start activity, input WSDL message (that we created earlier in step 5) is specified.

process start activity wsdl message

 

  • JDBC Query Acitivity:

JDBC query activity is used to query Employee details from database. This activity is named as QueryEmployee in our process. We specify database query in its configurations.

process database query

We have to pass Employee code as parameter in input mapping of this JDBC query activity. Employee code that we receive as input in start activity will be used as input here.

 

jdbc query input mapping

 

  • End Activity:

In End activity configurations, we specify out output WSDL message. Our web service operation outputs are based on the WSDL message specified here.

process end activity wsdl message

Values returned as result of JDBC query are mapped to inputs of End activity which are returned to the source calling this service.

process end activity mapping

 

After configuring all activities in the process, validate process to make sure it has no errors.

 

Step 7: Create Web Service from WSDL in TIBCO Designer:

Once we have all our processes, WSDLs and other required components ready, its time to generate web service from WSDL. We can generate web service from WSDL as below:

generate service from wsdl

 

It will ask you to specify Transport and Location to save the service. In transport, specify the HTTP connection that we created. For location, use Services folder that was created in Step 2.

generate service from wsdl 2

After your service is created in given folder, double click it and then give some meaningful name to its Endpoint and also Endpoint URI:

service endpoint name and uri setting

From the configuration of service, you can use Save WSDL button to save WSDL file in your computer’s local directory structure.

save wsdl

Wow, great!!!! You are now done with all the steps to create a SOAP Web Service in TIBCO designer. Now we will be testing this service.

 

Step 8: Test SOAP Web Service in Tibco Designer and SOAP UI:

For testing our service, we will use TIBCO Designer Tester and a tool called SOAP UI. We will start our service in Designer Tester and then consume it using SOAP UI:

start tester for service

 

Open SOAP UI and give it WSDL path that you just saved in Step 7. It will create Request for our Web service operation EmployeeDetails. Give required input (in our case only EmployeeCode) and then press Submit Request Button:

soap ui consuming web service

Wonderful!! Our service is successfully consumed and we got required output. Enjoy 🙂

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

77 thoughts on “Step By Step: Developing SOAP Web Service In TIBCO

  1. Siva

    How does service is created in given folder in Step7. I completed 7.a, 7.b but unable to see 7.c in the Services folder. Can you please help

    Reply
    1. Ajmal Abbasi Post author

      Dear Siva,

      Service is created in the folder that you specify in step 7b in “Location”. In the example case, I created it in the folder /service.

      Reply
      1. Siva

        HI Ajmal,

        For me, “After your service is created in given folder, double click it and then give some meaningful name to its Endpoint and also Endpoint URI:” EmployeeeWSDL-Service has not created.
        How to get this service created.

        Reply
        1. Ajmal Abbasi Post author

          Dear Siva,

          In Spep 7a, when you choose the option of generating web service from WSDL, it does get created in the /service folder. Please ensure you follow the steps correctly.

          Reply
          1. Shobhit Choubey

            Hi Ajmal
            When I am clicking on “Generate” to generate service nothing is happening.

      2. dinesh

        I have created soap service as you said but the service is not generating WSDL source, please can you explain why?

        Reply
  2. Siva

    After i click generate in 7a, nothing is generated under Services folder. Should i have Soap UI installed before performing this step. Can you please advice.

    Reply
    1. Ajmal Abbasi Post author

      Dear Siva,

      SOAP UI is not required for creating web service in TIBCO. You have perhaps missed some other step or you have made something wrong in some prior step.

      I will suggest to go and play with all the steps again and I hope you won’t find same issue again 🙂

      Reply
  3. Ahmad Syahruddin

    Is it normal when i generate service from WSDL at service folder, the process on it just empte (only Start n End).

    and how to connect this service to process we defined ?

    Reply
    1. Ajmal Abbasi

      Hi Ahmad,
      Yes it is normal. You can choose a different process (that you created for this purpose) by going through following steps:

      1. Go to your service and choose its configuration tab.
      2. Under the Operation tab, you will see “Operation Name” and “Operation Implementation”.
      3. In “Operation Implementation, choose the process that you want to use by using binocular.
      4. Click Apply and you are done.

      Reply
      1. Ahmad Syahruddin

        Thank’s for fast reply… i follow ur step and it’s work now. but when i deployed to domain using EAR file i created before, there is no services or with like this configure (ProcessArchive.par = disable).

        Can u give me the clues ?

        Thanks

        Reply
        1. Ajmal Abbasi

          Have you re-created the EAR? After making the said changes of choosing a new process in service, you need to create and Build new EAR and then deploy that.

          Reply
          1. Ahmad Syahruddin

            I already re-create EAR (replaced the old one). Then I goto Administrator Page to Upload EAR, but still the status said Disabled. But now the status changed to “Need to deploy in a Service Container “

      2. darshan

        While selecting the operation implemenation ..it allows to select only “PORT TYPE OPERATION” and not the process which i want to get triggered. For eg in this example it does not allow me to select employee details process .

        Reply
    1. Ajmal Abbasi Post author

      Hi Aradhana,

      You don’t need SOAP UI to test the web service. In fact, you can create a SOAP client process in TIBCO by using SOAP Request Reply activity.

      Reply
  4. Aradhana

    When we generate a web service from wsdl by clicking’Generate webservice from wsdl’ , webservice gets created with a Process definition with Start and End activity having respective Input and Output wsdls .

    But if we want to perform specific operations in the process definition like querying database or manupulating data can we add them into the process definition that was automatically created while generating webservice from wsdl?

    Reply
    1. Ajmal Abbasi Post author

      Yes, when we generate a web service from WSDL in TIBCO, processes automatically get created with start and end activities. You can add activities inside these processes to do any specific operations that your service need to do.

      Reply
  5. Aradhana

    Could you please help me with an example of SOAP Send Fault and Invoke Partner activity? \

    Why it is used?

    Thank you

    Reply
  6. tiana

    I also used the second approach for Generating Web Service from WSDL. But I see after creating the service a Process definition with start and end activity having respective input and output wsdls get created .
    Can I manupulate this process definition or do I need to delete this and create another process definition and invoke the service.

    Can I use SOAP Request Reply?

    Reply
    1. Ajmal Abbasi Post author

      You can either manipulate the auto generated process to add activities of your interest in the processes implementation or you can specify some different process with same Input and Output configurations.

      Reply
  7. Samuel

    Hi Ajmal..this guide is really great..but I am getting an error while adding prepared parameter like”sql statement/prepared parameter count mismatch”.I have followed the same steps that u have mentioned.Kindly help me in this.

    Reply
    1. Ajmal Abbasi Post author

      Hi Samule,

      Please make sure that you are adding only one parameter in your JDBC Query activity configuration as the query that we have written expects only one parameter (as there is only one question mark).

      Code should work fine if you have followed all the steps as mentioned in the tutorial. Thanks

      Reply
  8. Pingback: TIBCO SOAP JMS Tutorial: How to Develop JMS Based Web Service in TIBCO BW | Tibco Guide

  9. Rohit

    I am a learner. I followed your steps as guided. During step 5-C, while creating WSDL->Message ‘EmployeeInput’ and EmployeeOutput, In configuration tab i am creating new Request and response for EmployeeInput and EmployeeOutput respectively in part table; Where by default type is coming as xsd:string. Whereas is the images above it shows ns:Employee. Where is the conflict?

    Similarly after creating WSDL->Opearation i cannot edit name message field in the message table. It is only showing tns:

    Reply
  10. Dan xh

    Very well written article. Very informative. keep up the good work…..!

    Reply
  11. Shivendra Singh

    Hi Ajmal After Following all the steps as mentioned by you when i am trying to consume the service in SOap UI getting below error.
    SOAP-ENV:Server
    Internal Error

    And in Soap request Reply activity also getting the below error.
    SOAPPLUGIN-100023

    SOAP-ENV:Server
    Internal Error

    Any quick reply will be greatfull for me. Thanks in advance.

    Reply
    1. Anil

      Hi Shivendra,
      Your service must be invoking generated process definition. But inside process definition your START and END points must be connected I mean create a Transition between START and END activity.
      Or you can follow below steps

      1. Go to your service and choose its configuration tab.
      2. Under the Operation tab, you will see “Operation Name” and “Operation Implementation”.
      3. In “Operation Implementation, choose the process(Already created process definition) that you want to use by using binocular.
      ****This will replace your default process definition created alongwith Service.
      4. Click Apply and you are done.

      Reply
      1. Shivendra Singh

        Thanks for the reply will try this and hopefully this should work.

        Reply
      2. darshan

        It does not allow me to select some other process.What do i do ?

        Reply
  12. Amita Singh

    How to Publish a WSDL to the consumer for consuming it in Visual Studio?

    Reply
  13. AleksandarT

    Hello, great tutorial, helped me a lot with my job. When i create a Web Service, i want to use it in another project. My plan is to use it with SOAPRequestReply. I save the wsdl file, but i dont know how to use it in another project. Can you make a tutorial explaining/ demonstrating that aspect of TIBCO?

    Thanks a lot in advance

    Reply
      1. gopal

        Hi,
        I have one quick question, if we have configured the http connection using global variable (i.e. localhost, 8888) in TIBCO BW and finally deployed it. In the TIB Admin do we need to re-configure the global variables for the http connection (i.e. adminhost, xxxx) in order to trigger the service.

        Reply
        1. Ajmal Abbasi Post author

          Hi Gopal,

          Your global variable values will be automatically there but if you want to give some different values during deployment time, you can.

          Reply
  14. kalyan

    When to use the soap over http and soap over JMS while developing a WSDL

    Reply
  15. Pingback: Develop RESTful Web Service in TIBCO Step By Step Tutorial | Tibco Guide

  16. Pingback: TIBCO Web Services: Top Interview Questions and Answers | TutorialsPedia

  17. Pingback: SOAP Event Source Tutorial: How to Expose a Process as Web Service in TIBCO | TutorialsPedia

  18. Pingback: 15 Most Popular TIBCO Tutorials on TutorialsPedia | TutorialsPedia

  19. Pingback: SOAP Vs REST: Developing Web Services in TIBCO | TutorialsPedia

  20. kucku

    Hi Ajmal,

    We dont have DB connectivity. We have all data saved in a text file.
    How do i fetch Employee details from a file instead of JDBC query ?
    Please let me know how to proceed with this.

    Thanks

    Reply
    1. Shivani

      hi kucku,

      You can parse the CSV file and then use a group like ‘repeat until true’ on mapper and check the condition on group like
      if ( parse-data/EmpId = start/empid )then true else false.

      If true, map the details EmpName, EmpDept, etc to mapper from parse-data otherwise it will give u error

      Reply
  21. dinesh

    Hi … I need to delete all the directories from a folder except last two days and the directories named by date(EX:2015-05-20), Please can you explain the procedure

    Reply
  22. Areli

    Hi, i created a web site from WSDL and i exposed process definition. When i update WSDL, the process definition does not work and i have to re-create my project.

    Can you help me?

    Reply
  23. Raj

    Great Tutorial – It was a breeze to get this implemented. Quick question what is the difference between what we did here and creating a service through soapRequestReply ?

    Reply
    1. nikhil dash

      I am to tibco . I am getting below exception while loading service in tester . Please help to suggest .
      null Activation error with plugin agent [Services/EmployeeWSDL-service1.serviceagent]
      caused by: An IOException occurred while initializing the service
      caused by: com.tibco.plugin.share.http.HttpInitServerIOException
      caused by: LifecycleException: Protocol handler initialization failed: java.net.BindException: Cannot assign requested address: JVM_Bind:8320

      Reply
  24. nikhil dash

    Hi Ajmal,

    I am getting below error while loading service in designer . Please help to suggest .

    null Activation error with plugin agent [Services/EmployeeWSDL-service1.serviceagent]
    caused by: An IOException occurred while initializing the service
    caused by: com.tibco.plugin.share.http.HttpInitServerIOException
    caused by: LifecycleException: Protocol handler initialization failed: java.net.BindException: Cannot assign requested address: JVM_Bind:8320

    Reply
    1. Ajmal Abbasi Post author

      JVM Bind Exception occurs when the port you are specifying is already in use. Please try using different port for web service. Thanks

      Reply
      1. nikhil dash

        I have tried using different port but still same issue . Then I changed servertype in configuration of http connection to HttpComponent then am able to load in designer . But in soapUI am getting below error .
        Thu Jul 09 12:39:05 IST 2015:INFO:Error getting response for [EmployeeMgrEndpoint4Binding.EmployeeDetails:Request 1]; org.apache.http.conn.HttpHostConnectException: Connection to http://10.4.4.44:8540 refused

        Reply
        1. Ajmal Abbasi Post author

          Dear Nikhil,

          May I know why you are using 10.4.4.44? Host name should be the IP Address/Machine name of the machine where you are testing. 10.4.4.44 was my machine IP address.

          Reply
          1. nikhil dash

            Thanks sir ! that is it . I am getting expected output . This is the fastest response I ever got . Once again thanks a lot 🙂 .

  25. Suchithra

    Hi

    How do I change the Service name of WSDL Source in a Service

    Actual : /Shared_Resources/Abstract_WSDL/Comptel/ResponseHandlerService.serviceagent
    Required : /Shared_Resources/Abstract_WSDL/Comptel/ResponseHandlerService

    Thanks
    Suchithra

    Reply
  26. Anil Bajpai

    Its very informative Ajmal, but i am also stuck at the same point where rohit initiated the thread..

    Please do response on below: re posting Rohit’s thread.

    I am a learner. I followed your steps as guided. During step 5-C, while creating WSDL->Message ‘EmployeeInput’ and EmployeeOutput, In configuration tab i am creating new Request and response for EmployeeInput and EmployeeOutput respectively in part table; Where by default type is coming as xsd:string. Whereas is the images above it shows ns:Employee. Where is the conflict?

    Similarly after creating WSDL->Opearation i cannot edit name message field in the message table. It is only showing tns:

    Reply
    1. Anil Bajpai

      I got the solution for my query, for which i selected the part and its giving me option to select XSD from there

      Reply
  27. Nilima Ray

    Hi Ajmal,

    I wanna know,if a service is already deployed and i want to add operations in it .Is there any way to do this without redeploying the service?

    Reply
    1. Ajmal Abbasi Post author

      Dear Nilima,

      Adding new operations to an existing service is basically a code/design change and you need to redeploy the service by uploading the EAR again.

      Reply
    2. Anshul

      Hi Nilima,
      Better Way is: Extract the code first and add the operation in your Project code, After that you have to Build the EAR and then deploy it.

      But,Yes you can do one thing just go that server and there would be .sh and .ph (Service handler and process handler will be there) just copy your Process(Operation) and paste it at your server and restart your service.
      It will reflect that Operation.

      Reply
  28. Murali

    Hi Ajmal,

    I tried the above example . After I generate the service I take the SERVICE WSDL source code and copied to NEW WSDL file and executed with SOAP Request/Reply activity but I am getting the below error while executing the WSDL in SOAP request reply. I have tested with the below IP and PORT. Please help me to resolve the below error.

    172.30.4.173:8080

    SOAP Envelope is invalid
    SOAPPLUGIN-100002

    Reply
    1. omar

      Dera All

      Thanks All

      I’want Tibco version number for this explained?

      Reply
  29. parveez

    sir….
    To implements the webservice. i am doing all steps, i took the soap palette to performing
    webservice.
    pd one for service n one for client. n created wsdl also ,
    In service pd i got the source code but in towards client i am facing problems…
    then what i need to do to clear that issue..
    where i need to make copy of source wsdl…
    please help on this issues

    Reply
  30. Rohit

    Hi Ajmal,

    I’ve been following your blogs on TIBCO and they have been of great help for me. Currently I’m working on TIBCO and I need some help on RVRD Configuration in machines across 2 different subnets so that the domain that I create on one machine could be discoverable from another machine.

    Reply
  31. Jui

    Hi Ajmal,

    The article is very useful and explanatory. I followed the steps as specified. On testing service using SOAP UI, I am getting this error:

    ERROR:org.apache.http.conn.HttpHostConnectException: Connection to http://10.4.4.44:8320 refused
    org.apache.http.conn.HttpHostConnectException: Connection to http://10.4.4.44:8320 refused

    Please let me know if I have missed some important step, as no one else is getting this error.

    Thanks in advance.

    Reply
    1. Ajmal Abbasi Post author

      Dear Jui,

      10.4.4.44 was the IP address of my machine. In your case; In your HTTP Connection; specify localhost instead of this IP address.

      Reply
    2. Jui

      Hi Ajmal,

      I got to know what mistake I was doing. I changed IP address to my machine’s IP Address. But after that also, I am getting same error Connection refused. Port we can provide any random 4 digit number, or any specific number.
      What can be missing from my side?

      Thanks,
      Jui

      Reply

Leave a Reply

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