Tuesday, September 25, 2012

Java Web Services Questions

1. What are the features of web services?
A. Web services(WS)
· Web services can convert your applications into web applications
· Web services can be used by other applications
· Web services are published, found and used through the web
· Web services platform is XML + Http
· WS are application components
· WS communicate using open protocols
· WS are self contained and self describing
· WS can be discovered using UDDI (Universal Discovery, Description and Integration)
· XML is the basis for web services
2. How does the web services work?
A. The basic platform for web services is XML and HTTP. The HTTP protocol is the most widely used internet protocol. XML can be used between different platforms and programming languages. XML expresses the complex messages and functions. Following are the basic components of web services platform.
· SOAP(Simple Object Access Protocol)
· UDDI (Universal Description, Discovery and Integration)
· WSDL (Web Services Description Language)
3. Why web services?
· Interoperability is the most important factor
· Reusability of application components
· WS makes your application to publish its function or message to the rest of the world
· using the WS applications can exchange data between different applications and different platforms
· WS used XML to code and decode the data (which is understandable by all applications written in any language)
· WS uses SOAP to transport the data using open protocols
4. What are the three basic elements of web services platform?
· SOAP(Simple Object Access Protocol)
· UDDI (Universal Description, Discovery and Integration)
· WSDL (Web Services Description Language)
5. What is SOAP?
A. SOAP is a XML based protocol that is used by applications to exchange information over HTTP. Or simply we can define it as a protocol for accessing a web service.
The basic Web services platform is XML plus HTTP.
· SOAP is a communication protocol used for communication between applications
· SOAP is a format for sending messages
· SOAP is based on XML (eXtensible Markup Language)
· SOAP is designed to communicate via Internet
· SOAP is platform and language independent
· SOAP is based on XML
· SOAP is simple and extensible
· SOAP allows you to get around firewalls
· SOAP will be developed as a W3C standard
6. What is WSDL?
A. WSDL is an XML based language for describing web services. It also tell you how to access the services that it is providing.
· WSDL is an XML document
· WSDL is used to describe web services, along with the message format and protocol details for the web service
· WSDL is also used to locate Web Services
· WSDL is not yet a W3C standard
7. What is UDDI?
A. UDDI stands for Universal Description, Discovery and Integration. It is a Directory Service where businesses can register and search for web services.
· UDDI is a directory for storing information about web services
· UDDI is a directory of web service interfaces described by WSDL
· UDDI communicates via SOAP
8. What exactly WSDL document contains?
A. It is a document written in XML and used to describe web services. It specifies the location of the service and the operations (or methods) the service exposes.
9. Describe the major elements of a WSDL document?
A. There are four major elements in a WSDL document.
1. - defines the operations performed by the web service
2. - The message used by the web service
3. - defines the data types used by the application
4. - The communication protocols used by the web service
The above four components are generally used in a WSDL document. In addition to above components there are few more elements that can be used in WSDL, like extension elements and a service element that makes it possible to group together the definitions of several web services in one single WSDL document.
10. Explain WSDL ports?
1. is a most important element in the WSDL document.
2. The port defines the connection point to the web service
3. it describes a service, the operations that can be performed and the messages that are involved
4. it can be compared to a function library or a module or a class in general programming languages
11. Explain WSDL message?
1. defines the data elements of an operation
2. each message can consists of one or more parts
3. defines the data types of its parts
4. these parts can be compared to the parameters of a function in general programming languages
12. Explain WSDL types?
1. element defines the data types used by the web service
2. WSDL uses XML Schema syntax to define the data types (for maximum platform neutrality)
13. Explain WSDL binding?
A. WSDL binding element defines 1) message format and 2) protocol details for each port
14. What are different operation types in WSDL?
A. WSDL generally uses request-response type operation. But WSDL has actually four operation types.
1. One-way -> The operation can receive a message but it will not return a message.
2. request-response -> The operation can receive a request and will return a response
3. solicit-response -> The operation can send a request and waill wait for a response
4. Notification -> The operation can send a message but will not wait for a response
15. Explain breifly about WSDL binding to SOAP?
A. The element has two attributes.
1. name attribute - defines the name of the binding
2. type attribute - poitnts to the port for the binding
element has two attributes.
1. style attribute - It can be an "rpc" or a document
2. transport attribute - defines the SOAP protocol to use. HTTP(S) and SMTP are the valid application layer protocols used as Transport for SOAP.
Operation element defines the operation that the port exposes. For each operation, we need to specify the corresponding saopAction. You also need to specify how the input and output are encoded. The different types are literal, encoding types.
16. What is UDDI based on?
A. UDDI is based on XML, SOAP and DNS.
17. What are the Benefits of UDDI?
A.
· Making it possible to discover the right business from the millions currently online
· Defining how to enable commerce once the preferred business is discovered
· Reaching new customers and increasing access to current customers
· Expanding offerings and extending market reach
· Solving customer-driven need to remove barriers to allow for rapid participation in the global Internet economy
· Describing services and business processes programmatically in a single, open, and secure environment
18.  What are the two approaches to create a webservice?
Top Down: From WSDL one generates the Java Classes
Bottom Up: From Java classes one generates the WSDL
19.  Few tools used in your project if you used webservices.
 SOAP UI: Test the web service
 Some times some of the back end services might not available , so you can create a mock response and run the webservice service from the soap ui. Then your program should hit the mock response and you can check the functionality.
 Stylus Studio: Create the XML Schema and generate the binding classes.
 Axis2: Create the web service
20. Explain the use of Castor?
Castor is used to create the binding classes from the schema XML over HTTP

Reference for to learn Web Services:
http://www.j2eebrain.com/java-J2ee-developing-web-services-part-1.html
http://www.j2eebrain.com/java-J2ee-developing-web-services-part-2.html
http://www.j2eebrain.com/java-J2ee-developing-web-services-part-3.html

1 comment:

Tutorial Solution said...

Wonderful & nice blog post for answer to question for freshers/experienced,helpful me - thanks. plz sir given more interview answer on tutorialsolution dot com

Advance Java Blogging

Java New Articles

Javas Latest News

Java Web Services and XML

Ajax Latest News

Mac OS Java Features

Advance Spotlights

Patterns Features