How to Call a Web Service Using Web Experience Factory

This article will show you how easy it is to call any Web service into your WebSphere Portal using Web Experience Factory. Web services allow different applications to talk to each other and share data and services among themselves. Other applications can also use Web services. For example, VB or .NET application can talk to java web services and vice-versa. So, Web services is used to make the application platform and technology independent. For testing purposes, we are using the Currency Converter.
Web service in this example as shown in Figure 1.

Figure 1 

We start by creating a "Web Experience Factory" project and then creating an empty model inside it. To call any Web services, Web Experience Factory provides the Web Service Call builder.

Open the Web service call builder and write your WSDL URL and click on the Fetch WSDL button as shown in Figure 2. This will populate the list of operations supported by your WSDL.

Figure 2
Select the operation name that you want to execute from dropdown list. Check the "AutoCreate Input Vars" to automatically create Input Variable for Web Service, as shown below in Figure 3. That's it.

Figure 3
To test your service, we need to add Service Provider builder and Service Operation builder. When you add Service Provider builder, check the Add Testing Support and Generate Main options, as shown below in Figure 4.

Figure 4
Now Add Service Operation builder and call the Web service to execute. This is shown in Figure 5 below.

Figure 5
One important thing here is the sequence of builder. Service Operation builder always comes after Service Definition builder. So make the Service Definition builder first, then Web Service Call builder and then Service Operation builder.
Now save your work and run the model, as shown below in Figure 6.
Figure 6
We use this service in many consumer models to create a portlet and deploy it on Portal 8. The final look and feel is shown in the Consumer Model screenshot below (Figure 7).

Figure 7

Author Bio
Hatim Quaid Joher works as a Senior Software Engineer at Royal Cyber Inc. He is an Electronic Engineering Graduate and has been serving Royal Cyber since February 2010. Hatim has significant experience with IBM WebSphere Application Server, IBM Web Sphere Portal, and IBM Portlet Development using Portlet Factory, Java, XML, JavaScript and HTML. He holds IBM certifications for IBM FileNet Content Manager - Administrator 4.5 and IBM FileNet Content Manager - Designer 4.5. His major projects include code migration of WebSphere Portlet Factory 6.1.2 to Web Experience Factory 7.0.1 and developing SAC Application. 

No comments:

Post a Comment