Sunday, November 6, 2016

Retrieve Resources Activity | To Retrieve Concrete WSDL in TIBCO BW


Before Moving into post, Refer the post - How to create Web Service By using SOAP Event Source process starter Activity

     In previous post, we have created and exposed a web service by using SOAP Event Source process starter. Now we will retrieve the concrete WSDL respective to that web service and it can be done by using Retrieve Resources activity available in TIBCO BW SOAP palette.

RetrieveResources : The Retrieve Resources activity generates a WSDL file containing a concrete service description of any process definition that has a SOAP Event Source process starter. This allows client to access the WSDL for a web service that is implemented by a TIBCO Active Matrix BusinessWorks process definition. The client can then use the WSDL file to invoke the web service.

NOTE: The Retrieve Resources activity can also be used to retrieve any other resources, including XSDs and WSIL.

     This activity is normally used in conjunction with an HTTP Receiver process starter and a Send HTTP Response activity. The HTTP Receiver process starter can receive an HTTP request and pass it along to the Retrieve Resources activity. When a request is made to retrieve a WSDL file for a process definition that has a SOAP Event Source process starter, Retrieve Resources creates a WSDL file dynamically. This file contains the concrete service definition of the specified Business Works process definition. The WSDL file or other requested resources are then placed into the output for this activity.

As shown below, Here we have configured

  • HTTP Recevier with HTTP connection having Host name as "localhost" and port as "7369"
  • RetrieveResources activity is provided with input details for resourcePath, filter, hostname and port.

     You can then pass the output of the Retrieve Resources activity to the Send HTTP Response activity to send the response back to the requestor.

     When sending the HTTP response, set the Headers/Content-Type item on the input tab to the appropriate type for the type of resource retrieved. Use “text/xml” when this activity is used to retrieve a WSDL file.

     At run time, a client can retrieve the WSDL file for a process containing this process starter using an HTTP request. Once the WSDL file is retrieved, the client can perform a SOAP request to invoke the web service.

     Now we can test this process to retrieve the concrete WSDL but to use the Retrieve Resource activity, the HTTP request must have one of the following forms:

http://<host>:<port>/<path>/<resourceName>?wsdl
http://<host>:<port>/<path>/<resourceName>
http://<host>:<port>/inspection.wsil

host – Host Name of the Machine that is listening for the HTTP Request.
port – Port is the port number on the machine for incoming HTTP requests.
Path – The location of the resource in the TIBCO ActiveMatrix BusinessWorks project tree.

resourceName – The Name of the resource to retrieve

If you are retrieving a WSDL file for a process definition, use the name of the process definition followd by ?wsdl.
If you are retrieving other resources (such as XSD files, images and so on), specify the name of the resource, such as SchemaName.xsd (or) ImageName.gif.

inspection.wsil – Used to retrieve a Web Service Inspection Language (WSIL) file containing a list of all configured web services. Any process definitions with SOAP Event Source process starters in the project will be contained in the WSIL file.

In our case, HTTP request to retrieve concrete WSDL specific to web service exposed by SOAP Event Source process starter will look like as below :

http://localhost:7369/Processes/SOAPEventSource/BusinessProcesses/SESProcess?wsdl

NOTE : before sending the request in browser, make sure that SOAP Event Source process starter service is up and running i.e. either in Tester(in designer) or as deployed application in TIBCO Admin and also load the RetrieveResources process into Tester.

--> You can use below request to list all configured web services.

   http://localhost:7369/inspection.wsil

   Please note here the output of inspection.wsil request you can observe the URLs related to web services and can make use of these URLs to retrieve the concrete WSDL respective to each service.



No comments:

Post a Comment

back to top