Computer Knowledge

Java Enterprise and Web Technologies

2,279 Questions

Java enterprise and web technologies questions focus on J2EE architecture, web services like SOAP, and servlet functionalities. These topics frequently appear in IT officer and specialist scale examinations. Regular practice ensures familiarity with enterprise application components.

HttpServlet methodsSOAP and web servicesEJB architecture rolesJ2EE componentsJSP servlet callingUDDI concepts

Java Enterprise and Web Technologies Questions

Multiple choice technology web technology
  1. Its a protocol for calling services

  2. Its a registry for discovering services

  3. Its an xml file for defining the methods that can be called over the web.

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

WSDL (Web Services Description Language) is an XML-based language used to describe the public interface, operations, parameters, and access endpoints of a web service. SOAP is the protocol used to call them, and UDDI is used for discovery.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

This is false. A web service is more than just a function or method exposed on the web. It is a standardized way of integrating web applications using XML, SOAP, WSDL and UDDI open standards over the internet. It involves a complete architecture with protocols for discovery, description, and communication.

Multiple choice technology web technology
  1. Open Standard

  2. Secure

  3. Text Based Response

  4. All of Them

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

Web services are based on open standards (like HTTP and SOAP) and use text-based message formats (like XML or JSON). These features enable cross-platform interoperability, unlike vendor-specific, binary-based native technologies such as EJB, COM/DCOM, or CORBA.

Multiple choice technology web technology
  1. A Web service

  2. A tool to generate Web services from java classes.

  3. A tool to generate web service stubs.

  4. All of the above.

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

Apache Axis is primarily a tool for generating web services from Java classes (B) and for generating web service stubs/proxies (C). While Axis can work with web services (A), describing it as 'a web service' is not its primary definition - it's a framework/tool for creating and consuming web services. Option D 'All of the above' is incorrect because A is misleadingly worded.

Multiple choice technology testing
  1. Web Service Discovery Logic

  2. Web Service Dynamic Link

  3. Web Service Discovery Latency

  4. Web Services Description Language

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

WSDL (Web Services Description Language) is an XML-based language that describes the interface, operations, parameters, and location of a web service. It enables clients to understand how to invoke the service. The other options are not standard web service acronyms.

Multiple choice technology testing
  1. J2EE

  2. WPF

  3. WCF

  4. Silverlight

  5. ASP.NET

Reveal answer Fill a bubble to check yourself
A,C,E Correct answer
Explanation

J2EE (Java Enterprise Edition) provides comprehensive support for developing web services through JAX-WS and JAX-RS APIs. WCF (Windows Communication Foundation) is Microsoft's unified framework for building service-oriented applications and web services. ASP.NET supports web services through ASMX (legacy) and Web API (modern) technologies. WPF and Silverlight are client-side UI frameworks for desktop and browser-based applications respectively - they consume web services but are not used to build them.

Multiple choice technology programming languages
  1. Mapping files

  2. http.conf

  3. XML Configuration hibernate.cfg.xml

  4. web.config

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

Hibernate configuration is typically defined using programmatic mapping files and XML configuration files like hibernate.cfg.xml. Config files like http.conf (Apache Web Server) and web.config (ASP.NET) are completely unrelated to Hibernate.

Multiple choice technology programming languages
  1. Session is a light weight non-threadsafe object

  2. You can share the session between threads

  3. Session represents a single unit-of-work with the database

  4. Session is the primary interface for the persistence service

  5. A session loads database connections using lazy-loading

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Hibernate Session objects are explicitly designed to be non-threadsafe. Each thread should have its own Session instance to prevent race conditions and data corruption. The Session is lightweight but must not be shared across threads.

Multiple choice technology programming languages
  1. Configuration interface

  2. Session interface

  3. Query and Criteria interfaces

  4. User interface

Reveal answer Fill a bubble to check yourself
A,B,C Correct answer
Explanation

Configuration, Session, Query, and Criteria are core Hibernate interfaces used to establish settings, manage database connections, and run queries. The User interface is not part of Hibernate's core framework APIs.

Multiple choice technology programming languages
  1. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier

  2. Created during application initialization

  3. Wraps a JDBC connection

  4. Act as session Factory

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The Hibernate Session interface wraps a JDBC connection and provides methods for CRUD operations. It also holds a first-level cache and is created by SessionFactory (not during application initialization - that's when SessionFactory is created). The Session itself does not act as a factory.

Multiple choice technology programming languages
  1. DataContractSerializer

  2. XMLSerializer

  3. DataContractFormatter

  4. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

DataContractSerializer is the default serializer used by WCF to translate .NET objects into XML. XmlSerializer is an alternative that must be explicitly opted into, while DataContractFormatter is not a standard standalone serializer class.

Multiple choice technology programming languages
  1. [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode=SessionMode.Required)] public interface ICalculator{ [OperationContract] double AddTo(double n); }

  2. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class CalculatorService : ICalculator { double result = 0.0D; public double AddTo(double n) { return result+=n; } }

  3. a and b both

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Enabling sessions in WCF requires both: (1) marking the service contract with SessionMode.Required, and (2) setting InstanceContextMode to PerSession in the ServiceBehavior. Option A shows the contract requirement, Option B shows the service behavior - both are necessary.

Multiple choice technology programming languages
  1. [ServiceContract] interface IStock { [OperationContract] [WebGet] int GetStock(string StockId); }

  2. [ServiceContract] interface IStock { [OperationContract] [WebInvoke] int GetStock(string StockId); }

  3. a and b

  4. None

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

WCF REST services are created by adding WebGet (for HTTP GET) or WebInvoke (for other HTTP methods) attributes to operation contracts. Both approaches are valid for creating RESTful services.

Multiple choice technology programming languages
  1. Use a BasicHttpBinding binding with the security mode set to Message

  2. Use a BasicHttpBinding binding with the security mode set to TransportWithMessageCredential

  3. Use a WSFederationHttpBinding binding with the security mode set to Message

  4. Use a WSFederationHttpBinding binding with the security mode set to TransportWithMessageCredential

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

WSFederationHttpBinding with Message security is the correct choice for STS-based token authentication when SSL/TLS is not available. This binding is specifically designed for federated security scenarios where a Security Token Service issues tokens. TransportWithMessageCredential requires SSL transport security, which the scenario explicitly states clients cannot use.