Java Webservices Interview Questions & Answers

4 avg. rating (80% score) - 1 votes

Java Webservices Interview Questions & Answers

Do you like to switch your career? Here's our recommendation on the important things to need to prepare for the job interview to achieve your career goals in an easy way. Java Web services is a standardized way or medium to propagate communication between the client and server applications on the World Wide Web. Web services provide a common platform that allows multiple applications built on various programming languages to have the ability to communicate with each other. Popular web service portals are SOAP, REST, WSDL. One can check the availability of the job across cities including Mumbai, Delhi, Bangalore, Pune and Hyderabad. Follow Wisdomjobs page for Java Webservices job interview questions and answers page to get through your job interview successfully.

Java Webservices Interview Questions

Java Webservices Interview Questions
    1. Question 1. What Are The Different Application Integration Styles?

      Answer :

      There are a number of different integration styles like

      1. Shared database
      2. batch file transfer
      3. Invoking remote procedures (RPC)
      4. Exchanging asynchronous messages over a message oriented middle-ware (MOM).

    2. Question 2. What Are The Different Styles Of Web Services Used For Application Integration?

      Answer :

      SOAP WS and Restful Web Service

    3. Question 3. What Are The Differences Between Both Soap Ws And Restful Ws?

      Answer :

      • The SOAP WS supports both remote procedure call (i.e. RPC) and message oriented middle-ware (MOM) integration styles. The Restful Web Service supports only RPC integration style.
      • The SOAP WS is transport protocol neutral. Supports multiple protocols like HTTP(S), Messaging, TCP, UDP SMTP, etc. The REST is transport protocol specific. Supports only HTTP or HTTPS protocols.
      • The SOAP WS permits only XML data format.You define operations, which tunnels through the POST. The focus is on accessing the named operations and exposing the application logic as a service. The REST permits multiple data formats like XML, JSON data, text, HTML, etc. Any browser can be used because the REST approach uses the standard GET, PUT, POST, and DELETE Web operations. The focus is on accessing the named resources and exposing the data as a service. REST has AJAX support. It can use the XMLHttpRequest object. Good for stateless CRUD (Create, Read, Update, and Delete) operations.
      • GET - read()
        POST - create()
        PUT - update()
        DELETE - delete()
      • SOAP based reads cannot be cached. REST based reads can be cached. Performs and scales better.
      • SOAP WS supports both SSL security and WS-security, which adds some enterprise security features like maintaining security right up to the point where it is needed, maintaining identities through intermediaries and not just point to point SSL only, securing different parts of the message with different security algorithms, etc. The REST supports only point-to-point SSL security. The SSL encrypts the whole message, whether all of it is sensitive or not.
      • The SOAP has comprehensive support for both ACID based transaction management for short-lived transactions and compensation based transaction management for long-running transactions. It also supports two-phase commit across distributed resources. The REST supports transactions, but it is neither ACID compliant nor can provide two phase commit across distributed transactional resources as it is limited by its HTTP protocol.
      • The SOAP has success or retry logic built in and provides end-to-end reliability even through SOAP intermediaries. REST does not have a standard messaging system, and expects clients invoking the service to deal with communication failures by retrying.

    4. Question 4. How Would You Decide What Style Of Web Service To Use? Soap Ws Or Rest?

      Answer :

      In general, a REST based Web service is preferred due to its simplicity, performance, scalability, and support for multiple data formats. SOAP is favored where service requires comprehensive support for security and transnational reliability.

    5. Question 5. What Tools Do You Use To Test Your Web Services?

      Answer :

      SoapUI tool for SOAP WS and the Firefox "poster" plugin for RESTFul services.

    6. Question 6. What Is The Difference Between Soa And A Web Service?

      Answer :

      SOA is a software design principle and an architectural pattern for implementing loosely coupled, reusable and coarse grained services. You can implement SOA using any protocols such as HTTP, HTTPS, JMS, SMTP, RMI, IIOP (i.e. EJB uses IIOP), RPC etc. Messages can be in XML or Data Transfer Objects (DTOs).

      Web service is an implementation technology and one of the ways to implement SOA. You can build SOA based applications without using Web services – for example by using other traditional technologies like Java RMI, EJB, JMS based messaging, etc. But what Web services offer is the standards based and platform-independent service via HTTP, XML, SOAP, WSDL and UDDI, thus allowing interoperability between heterogeneous technologies such as J2EE and .NET.

    7. Question 7. Web Services When You Can Use Traditional Style Middle-ware Such As Rpc, Corba, Rmi And Dcom?

      Answer :

      The traditional middle-wares tightly couple connections to the applications and it can break if you make any modification to your application. Tightly coupled applications are hard to maintain and less reusable. Generally do not support heterogeneity. Do not work across Internet. Can be more expensive and hard to use.

      Web Services support loosely coupled connections. The interface of the Web service provides a layer of abstraction between the client and the server. The loosely coupled applications reduce the cost of maintenance and increases re-usability. Web Services present a new form of middle-ware based on XML and Web. Web services are language and platform independent. You can develop a Web service using any language and deploy it on to any platform, from small device to the largest supercomputer. Web service uses language neutral protocols such as HTTP and communicates between disparate applications by passing XML messages to each other via a Web API. Do work across internet, less expensive and easier to use.

    8. Question 8. What Are The Different Approaches To Developing A Soap Based Web Service? A. 2 Approaches?

      Answer :

      The contract-first approach, where you define the contract first with XSD and WSDL and the generate the Java classes from the contract.

      The contract-last approach where you define the Java classes first and then generate the contract, which is the WSDL file from the Java classes.

      Note: The WSDL describes all operations that the service provides, locations of the endpoints (i.e.e where the services can be invoked), and simple and complex elements that can be passed in requests and responses.

    9. Question 9. Explain Each Web Service Technologies - Soap, Wsdl, Uddi, Ebxml And Jax Pack.

      Answer :

      SOAP: Simple Object Access Protocol is a protocol that is used to exchange structured information at the time of implementing a web service. SOAP is relied on XML. Message format of SOAP usually relies on another protocol of different application layers. Among these the most notable application layer is Remote Procedure Call and HTTP. SOAP forms the foundation layer for web services protocol stack. This stack provides the basic framework for messaging on which the web services are built.

      WSDL: Web Service Definition Language is used to describe a web service based on XML. WSDL is used for describing Web Services and to locate the services. WSDL consists of the information on what the service is all about, its residing location and the way of invocation the service.

      UDDI Universal Discovery Description Integration: To publish and discover the information about web services, UDDI is a specification. It is an XML based standard. This standard is used for describing, publishing, and finding services. These services are found in a distributed environment through the use of a server called registry server.

      Electronic Business using XML: EBXML is one from XML family that is based on the standards of OASIS and UN/CEFACT. The mission of this standard is to provide an open xml-based infrastructure which could enable the global use of e-business in an interoperable, secure and consistent manner by all of the partners of trading. This is a unique architecture with unique concepts that are part theory and part implemented within the existing EBXML standards.

      JAX PACK: A java API for xml pack that integrates all of the programming interfaces by SUN for different web services development. All these interfaces are made as a single download. JAX PACK is a bundle of JAXB,J AXM, JAX-RPC, and JAXR. Jax pack includes the documentations for support for the SAX, DOM.SOAP, WSDL, XSLT, EBXML, UDDI standards.

    10. Question 10. Explain The Technologies Included Within Jax Pack, I.e. Jaxp, Jaxb, Jaxm, Jax-rpc, Jaxr.

      Answer :

      JAXP: Java API for xml processing. It provides the validation capability and parsing XML documents. There are three basic parsing interfaces in JAXP are DOM, SAX and Straming API for XML STAX.

      JAXB: Java Architecture for XML Binding: The java classes are mapped to XML representations. The two main features of JAXB are the ability to marshal Java objects into XML and unmarshal XML back to Java objects.

      The Java API for XML Messaging (JAXM) enables distributed software applications to communicate using XML (and SOAP). JAXM supports both asynchronous and synchronous messaging.

      JAX-RPC: Java API for XML based RPC. Allows a java based web service that is to be invoked by a Java application provided the description, still being consistent with WSDL description. This can resemble as Java RMI over web services.

      Allowing a web service to be implemented at server side as a servlet/jsp or EJB container is the advantage of JAX-RPC.

    11. Question 11. Explain The Web Services Architecture.

      Answer :

      The operations between different software applications, which are running on a variety of platforms and frameworks are supported by a standard called Web services. The web services architecture provides the concepts, model and understanding web services and relationships among the components.

      The WSA specifies the minimal characteristics that are very common for all web services and a number of characteristics to the needed web services. WSA is called interoperability architecture that means the global elements of a global web service network are identified by this architecture in order to perform the interoperability between the web services.

    12. Question 12. What Are Smart Web Services?

      Answer :

      A smart web service understands the situational context and capable of sharing the context with other services. The result of this web service is based on the needs like who, what, when, where it was called.

      The customer’s identity, role of a customer, security policies, physical location of a customer, type of client device are some of the number of the situational circumstances of that a smart web service is aware of.

    13. Question 13. What Is Web Services?

      Answer :

      Web Services are the components that provide functionality via internet, uses standard protocol such as HTTP. Web services use SOAP to expose functionality which is an XML-based protocol that enables 2 disparate components to communicate. So web services hosted on windows platform can easily be consumed Linux and UNIX platform.

    14. Question 14. What Is Soap?

      Answer :

      SOAP is an XML-based protocol that enables 2 components to communicate each other. It has the rules to translate platform specific data into the XML format. Web services are based on SOAP protocol in order to expose their functionality to disparate application and platform.

    15. Question 15. Explain Jaxr?

      Answer :

      JARX is a standard API that are used to access XML registries (list of services available on the web) from the JAVA platform. Client application can use JARX API to query the registries. It acts as a pluggable layer that allows access to registries implemented on different standards such as UDDI.

    16. Question 16. Explain Jax-rpc?

      Answer :

      JAX-RPC uses SOAP to call remote procedures. JAX-RPC enables JAX-RPC clients to invoke web services developed across heterogeneous platform.

    17. Question 17. What Are Web Services?

      Answer :

      Web services exposes functionality over internet using protocol such as HTTP. Web services can be accessed by two disparate applications from different platforms as they use SOAP protocol to expose the business functionality. SOAP is a platform independent protocol, so the consumer of the web services doesn’t have to know any implementation detail of web services based components. This is the reason why web services hosted on windows can even be accessed by LINUX consumer.

    18. Question 18. Explain Jaxm Messaging Models?

      Answer :

      JAXM messaging models has two types of messaging model, synchronous and asynchronous.

      Synchronous messaging model

      In this type of model, client directly interacts with the source. The client sends a request and waits for the response.

      Asynchronous messaging model

      In this model, client sends message to the messaging provider and returns back. Messaging provider then performs the routing of message to the end source.

    19. Question 19. What Is Jaxb?

      Answer :

      Java Architecture for XML Binding: The java classes are mapped to XML representations. The two main features of JAXB are the ability to marshal Java objects into XML and unmarshal XML back to Java objects.

      The Java API for XML Messaging (JAXM) enables distributed software applications to communicate using XML (and SOAP). JAXM supports both asynchronous and synchronous messaging.

    20. Question 20. What Is Jaxp?

      Answer :

      Java API for xml processing. It provides the validation capability and parsing XML documents. There are three basic parsing interfaces in JAXP are DOM, SAX and Streaming API for XML STAX.

    21. Question 21. What Is Jax-rpc?

      Answer :

      Java API for XML based RPC. Allows a java based web service that is to be invoked by a Java application provided the description, still being consistent with WSDL description. This can resemble as Java RMI over web services.

      Allowing a web service to be implemented at server side as a servlet/jsp or EJB container is the advantage of JAX-RPC.

    22. Question 22. Explain The Technologies Included Within Jax Pack, I.e. Jaxp, Jaxb, Jaxm, Jax-rpc, Jaxr?

      Answer :

      Included in the bundle are Java API for XML Processing (JAXP) JAXP enables applications to parse, transform, validate and query XML documents. It uses an API that is independent of a particular XML processor implementation.

      JAXP enables vendors to provide their own implementations without introducing dependencies in application code.

    23. Question 23. Explain Java Architecture For Xml Binding (jaxb)?

      Answer :

      XML is a standard for exchanging data across heterogeneous systems. Java provides a platform for building portable applications.

      A combination of these two enables users and application developers to program Web based functionality on an platform.

    24. Question 24. Explain Java Api For Xml Messaging (jaxm)?

      Answer :

      JAXM is a SOAP 1.1 based standard to send XML documents over the Internet from the Java platform.

      JAXM can be extended to work with higher level messaging protocols by adding the protocol functionality on top of SOAP.

    25. Question 25. Explain Java Api For Xml-based Rpc (jax-rpc)?

      Answer :

      JAX-RPC project provides the code base for the Reference Implementation of JAX-RPC, the Java APIs for XML based RPC. JAX-RPC RI is a production-quality implementation that is used directly in a number of products by Sun and other vendors.

    26. Question 26. Explain Java Api For Xml Registries (jaxr)?

      Answer :

      JAXR gives you a uniform way to use business registries that are based on open standards (ebXML) or industry consortium-led specifications (UDDI).

    27. Question 27. Explain The Web Services Architecture?

      Answer :

      The operations between different software applications, which are running on a variety of platforms and frameworks are supported by a standard called Web services. The web services architecture provides the concepts, model and understanding web services and relationships among the components.

      The WSA specifies the minimal characteristics that are very common for all web services and a number of characteristics to the needed web services. WSA is called interoperability architecture that means the global elements of a global web service network are identified by this architecture in order to perform the interoperability between the web services.

    28. Question 28. Do You Know Jax-rpc?

      Answer :

      JAX-RPC uses SOAP to call remote procedures. JAX-RPC enables JAX-RPC clients to invoke web services developed across heterogeneous platform.

    29. Question 29. Can You Explain Soap?

      Answer :

      SOAP is an XML-based protocol that enables 2 components to communicate each other. It has the rules to translate platform specific data into the XML format. Web services are based on SOAP protocol in order to expose their functionality to disparate application and platform.

    30. Question 30. Explain Wsdl?

      Answer :

      Web Service Definition Language is used to describe a web service based on XML. WSDL is used for describing Web Services and to locate the services. WSDL consists of the information on what the service is all about, its residing location and the way of invocation the service.

    31. Question 31. Explain Uddi Universal Discovery Description Integration?

      Answer :

      To publish and discover the information about web services, UDDI is a specification. It is an XML based standard. This standard is used for describing, publishing, and finding services. These services are found in a distributed environment through the use of a server called registry server.

    32. Question 32. Explain Electronic Business Using Xml?

      Answer :

      EBXML is one from XML family that is based on the standards of OASIS and UN/CEFACT. The mission of this standard is to provide an open xml-based infrastructure which could enable the global use of e-business in an interoperable, secure and consistent manner by all of the partners of trading. This is a unique architecture with unique concepts that are part theory and part implemented within the existing EBXML standards.

    33. Question 33. Explain Jax Pack?

      Answer :

      A java API for xml pack that integrates all of the programming interfaces by SUN for different web services development. All these interfaces are made as a single download. JAX PACK is a bundle of JAXB,JAXM,JAX-RPC,and JAXR. Jax pack includes the documentations for support for the SAX, DOM.SOAP, WSDL, XSLT, EBXML, UDDI standards.

    34. Question 34. Explain Each Web Service Technologies - Soap, Wsdl, Uddi, Ebxml And Jax Pack?

      Answer :

      A Simple Object Access Protocol (SOAP) enables the heterogeneous operating system to communicate with one another by using Hypertext Transfer Protocol (HTTP) and its Extensible Markup Language (XML) as the mechanisms for information exchange.

      Web Services Description Language (WSDL) is an XML-based language used to describe the services business offers, which can be accessed electronically.

      Universal Description Discovery and Integration (UDDI) is a specification for maintaining standardized directories of information about Web services in a universally recognized format. It records their capabilities, location and requirements.

      The ebXML Messaging Service specification (ebMS) extends the SOAP specification. It provides the security and reliability features. It is supported by a variety of commercial and open source software implementations.

      Due to the interoperability of its implementations, ebMS is a strong complement or even alternative to other web service specifications.

      The Java APIs for XML (JAX) Pack integrates all of Sun's programming interfaces for web services development and makes them available as a single download.

Jsp Tutorial

Java Webservices Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

JSP Tutorial