| By Anshuk Pal Chaudhari, Sandeep Gaikwad, Ambar Verma, V. Niranjan | Article Rating: |
|
| September 23, 2005 09:00 AM EDT | Reads: |
24,757 |
The following descriptions pertain to Figure 1:
- WSIF Service: The WSIFService interface is used for creating an instance of the WSIFOperation interface to use for a specific invocation of a service operation
- WSIF Operation: The run-time illustration of an operation, called WSIFOperation, is used for invoking a service based on a particular binding
- WSIF Provider: A WSIF provider is an implementation of a WSDL binding that can run a WSDL operation through a binding-specific protocol. WSIF includes SOAP providers, JMS providers, Java providers, and EJB providers - and it can include all of those concurrently, if required.
General Prerequisites
www.apache.org/dyn/closer.cgi/ws/wsif/
- wsif.jar
- wsif-j2c.jar
Java Binding
Description
We will now demonstrate invoking a simple Java Class as a Service using the WSIF APIs.
- We have a Java Class called as CalculatorImpl, which has a method of simple addition.
- Now since we are calling the Java class as a service, we also need to change the WSDL accordingly. All elements of the WSDL remain the same, only the binding tag is changed to indicate that we are using JAVA Binding.
- A mapping from the abstract types used in WSDL message parts to Java types that represent the same information is achieved by the "format: typemapping" element.
- To represent Java method in a WSDL in an abstract way the "java: operation" element is used
- To represent a Java object as an endpoint for a service available through a Java binding we use the "java: address." The className attribute is used to give a fully qualified class name to be used for service invocation. Please refer the binding element of "Addition.wsdl."
- Now we take a look into the changes in the client for invoking the simple addition service. We call the method executeRequestResponseOperation, which is method from class WSIFOperation_Java, This class implements the WSIFOperation interface. The method contains three parameters (input, output, and fault), which are objects of the WSIFMessage interface. Please refer the "getAdditionResult" method of Run.java.
Description
We will now try to demonstrate the invocation of an EJB as a service.
- The EJB that we have developed is used to insert values in an Oracle database
- We have deployed the EJB on the WebLogic Server 8.1
- The binding element in the WSDL indicates that it is EJB binding. The format:typeMapping and ejb:operation elements remain the same as in the case of Java binding
- To specify an EJB object as an endpoint we modify the ejb:address as shown below. The className (optional) attribute gives the fully qualified name of the home interface class of the EJB, while the jndiName attribute specifies the name under which this EJB can be looked up in a JNDI context. Please refer "EJBSample.wsdl"
- As we can see even in this case, it is the WSDL that is changed; the binding name has changed and we have different attributes for the EJB address, which is the endpoint for the service
- For the client, refer to the Run.java of the EJB binding source code
Description
The following service invocation aims to showcase the most important concept of WSIF - multiple binding and protocol with the same WSDL file. Let's look at an example:
- We have a service, for instance, a Calculator. Now it is quite possible to have multiple clients who need to access the service, for instance, a "Dot Net Client" and a "Java Client."
- The Calculator application has been developed in Java.
- Now the only way for the Dot Net Client to access that service Calculator is only when the functionality is exposed via SOAP binding. SOAP binding is fine for the Dot Net Client, but why would a client in Java access the service via SOAP binding and not via simple Java binding?
- For the Java Client it is always better to access a Java Class than to access a Web service through a SOAP binding.
- WSIF provides the option of exposing the functionality of a service through multiple bindings, and that too in single WSDL file. Let's see how.
- We have a simple Java Class, which we expose as Web service on WebLogic Server 8.1.
- Now we will describe the same class in a WSDL as SOAP binding (Web service) as well as a Java binding (simple Java Class). Please refer the binding element of MultiBinding.wsdl.
- Now it is up to the client what port to use at what time. If we notice the service element of the WSDL carefully, it shows one service whose functionality with multiple bindings, for instance the Dot Net Client, will be using the SimpleSumServiceSOAPPort, and the Java Client will be using the SimpleSumServiceJavaPort. Let us see the client for the invocation of multiple bindings. Please refer the Dot Net Client "Form1.cs" (source code is available by viewing this article - see zip.html file.
Advantages
The advantage here lies in the fact that we can have multiple bindings for a single service. The client finds a suitable binding for them and then invokes the service. It is also convenient for building the client on any platform and to access the service.
JMS Bindings
Description
The following service invocation aims at using the message-oriented middleware using Java Messaging Service (JMS) through WSIF Apis. We only want to demonstrate that it is possible to bind JMS using WSIF.
- We have developed a Message Driven Bean (MDB) as a service that has a method that just appends "Hi" to whatever the user enters.
- The MDB is being deployed on WebLogic Server 8.1.
- The main focus of the service is the JMS binding.
- The JMS binding in this case uses JMS text messages for communication
- The WSIF API provides the translation of the invocation to the sending of JMS text message to the particular queue. The specific part of WSDL that deals with the JMS binding is shown below. Please refer the binding element of "JMS.wsdl."
- The service in the WSDL also describes the different parameters that need to be given in order to look up the Queue. The Client for calling the MDB is also a very simple one. Please refer the client "Run.java" of JMS binding.
Published September 23, 2005 Reads 24,757
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Anshuk Pal Chaudhari
The authors are interning and/or working as part of the Web Services COE (Center of Excellence) for Infosys Technologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies.
More Stories By Sandeep Gaikwad
The authors are interning and/or working as part of the Web Services COE (Center of Excellence) for Infosys Technologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies.
More Stories By Ambar Verma
The authors are interning and/or working as part of the Web Services COE (Center of Excellence) for Infosys Technologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies.
More Stories By V. Niranjan
The authors are interning and/or working as part of the Web Services COE (Center of Excellence) for Infosys Technologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies.
- Cloud Expo New York: Why PostgreSQL is the Database for the Cloud
- Cloud Expo New York Speaker Profile: Dave Linthicum – Blue Mountain Labs
- Agile Adoption – Crossing the Chasm
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Cross-Platform Mobile Website Development – a Tool Comparison
- Cloud Expo New York: Cloud Architectures Require Scale-Out Storage
- Cloud Expo New York: The Growing Big Data Tools Landscape
- Architecture Governance – the TOGAF Way
- Cloud Expo New York: Cloud Computing and Healthcare
- Big Data – A Sea Change of Capabilities in IT
- Cloud Expo New York: Mobilizing Enterprise Applications for the Cloud
- Cloud Expo New York: Why PostgreSQL is the Database for the Cloud
- Cloud Expo New York Speaker Profile: Dave Linthicum – Blue Mountain Labs
- Agile Adoption – Crossing the Chasm
- Red Hat Executive Appointed to Technology Services Industry Association (TSIA) Support Services Advisory Board
- Graal, a Dynamic Java Compiler in the Works
- Cloud Expo New York: The Java EE 7 Platform - Developing for the Cloud
- Write Once Run Anywhere or Cross Platform Mobile Development Tools
- Cross-Platform Mobile Website Development – a Tool Comparison
- What Motivates Open Standards in the Cloud?
- Cloud Expo New York: Cloud Architectures Require Scale-Out Storage
- Cloud Expo New York: The Growing Big Data Tools Landscape
- Are You Your Own Worst Enemy?
- The i-Technology Right Stuff
- The Top 150 Players in Cloud Computing
- Who Are The All-Time Heroes of i-Technology?
- Where Are RIA Technologies Headed in 2008?
- Get the Message
- ESB Myth Busters: 10 Enterprise Service Bus Myths Debunked
- i-Technology Viewpoint: Is Web 2.0 the Global SOA?
- i-Technology Viewpoint: Thinking Outside the VC Box
- i-Technology Viewpoint: When to Leave Your First IT Job
- SOA Web Services Edge Conference Coverage on SYS-CON.TV
- SYS-CON.TV's "SOA Web Services" and "Enterprise Open Source" Programs To Air in December
- Five Reasons Why Web 2.0 Matters


















