Sunday 3 July 2016

Java SOAP Web Services MCQ's for Interview and WS Certification Exam 1Z0-897

1) Which of the following transport protocols are complient with SOAP
A. HTTP
B. SMTP
C. FTP
D. TCP
E. All of the above
Ans - E

2) Select HTTP methods associate with SOAP Web service.
A. Put
B. Post
C. Get
D. Delete
Ans - B 
Desc - SOAP only uses POST method for HTTP communication.

3) Select Web Service technology stack from following options (any 3)
A. SOAP
B. JSON
C. JAX-RS
D. WSDL
E. UDDI
Ans - ADE

4) Select correct definition of a WSDL's <service> element.

A. Collection of related endpoints.

B. Contains data type definitions using type system.

C. A single endpoint defined as a combination of a binding and a network address.
D. Set of operations supported by one or more Endpoints.
Ans - A

5) Select the operations supported by Web Services.

A. One way (Request only)

B. Two way (Request - Response)

C. Solicit-Response (Server pust message and client responds)
D. Notification (Request/push message from server to client)
E. All of the above
Ans - E

6) Select statements which are true for SOAP. (any 3)
A. SOAP Transport protocol used by Web Services
B. SOAP is specification for exchanging structured information
C. SOAP relies on other trasport protocols like http, ftp for data trasmission 
D. SOAP uses xml to format data
E. SOAP uses json to format data
Ans - BCD

7) You are going to develop Stock market web service which will be consumed by other companies. Jave team from your company want to re-use your web service code as soon as possible. Which approach you will follow in this case?
A. Top down (contract first)
B. Meet in the middle
C. Bottom up (code first)
D. None of the above
Ans - C
Desc - In bottom up approach you start with writing service code so code will be available earliest for other teams using this approach.

8) Our company wants to create JAX-WS Web service client for weather forcast service. This weather forcast service is implemented in C++. You have given a WSDL file for service. What is correct statement to be able to create WS client from WSDL. (Select one).
A. Use JAXP to parse and generate the java classes from WSDL. Then create Service Endpoint Interface(SEI) from factory classes. Then use SEI to call WS.
B. Use wsgen to generate SEI from WSDL and then invoke SEI's methods to call WS.
C. Use wsimport to generate SEI from WSDL and then invoke SEI's methods to call WS.
D. We can not consume a web service created in C++ on java.
Ans - C
Desc - To create WS client from WSDL we use wsimport tool. Wsgen is used to create web service from WSDL.

9) Our company want to create application in which servlet will be exposed as WS endpoint. What we will require among following? (any 3)
A. Application needs to be packaged as JAR file.
B. Application needs to be packaged as WAR file.
C. web.xml is required.
D. webservice.xml is required.
E. WEB-INF directory is required.
F. META-INF directory is required.
Ans - BCE
Desc - We need to package application as WAR file to deploy in web container. We need WEB-INF/web.xml file inside WAR file.

10) Our company has created web service for employee payroll system which is deployed in Web container. Now we have new requirements from management to protect access to this service URL using basic authentication. Which file we need to modify to fulfill this requirement?
A. security.xml
B. sun-web.xml
C. web.xml
D. webservices.xml
Ans - C
Desc - We have to update web.xml with security configurations for URLS. This is xml element we need to add in web.xml <auth-method>basic</auth-method>

11) Select the feature provided by EJB endpoint exposed as a web service. (any 3)
A. Client Managed Transactions
B. Java EE declarative Security
C. Java EE programatic Security
D. HTTP Sessions
E. Container Managed transactions.
Ans - ACE
Desc - Exposing EJB bean as WS endpoint we can use declarative security using EJB annotation, programmatic security and EJB container managed transactions.


12) We have created one web service which is deployed in web container, now we need to support WS client session in our service. However we have to expire a session in case user session is inactive for 10 mins. Which file we need to  modify for this requirement.
A. security.xml
B. sun-web.xml
C. web.xml
D. webservices.xml
Ans - C
Desc - We need to add <session-config><session-timeout>10</session-timeout></session-config> in web.xml file.

13) What is the correct web.xml-snippet to declare a session time-out of 3 minutes in web.xml?
A. <session-config>    <session-timeout>3</session-timeout> </session-config>
B. <session-config>    <session-timeout>180</session-timeout> </session-config>
C. <session-timeout>    <session-time>3</session-time> </session-timeout>
D. <session-timeout>    <session-time>180</session-time> </session-timeout>
Ans - A

14) Select programming languages supported by Web Services
A. c++
B. Java
C. Python
D. C
E. All of the above
Ans - E

15) What is an best way of the handling of application exceptions thrown by a
JAX-WS service endpoint?
A. Exceptions should be mapped to faults in WSDL.
B. Exceptions are NOT handled by JAX-WS clients.
C. Exceptions are always propagated to JAX-WS clients as RemoteExceptions.
D. Exceptions are always propagated to JAX-WS clients as WebServiceExceptions.
E. Exceptions are always propagated to JAX-WS clients as SOAPFaultExceptions.
Ans - A

20) What is the correct definition of WSDL's port element?
A. Contains data type definitions using type system.
B. Description of an action supported by the service.
C. Set of operations supported by one or more Endpoints.
D. A single endpoint defined as a combination of a binding and a network address.
Ans - D
Desc - PortType element contains supported binding, literals by endpoint and networ address of endpoint.

21) Select one of the use of javax.xml.ws.BindingProvider interface while working with JAX-WS.
A. Set custom Hadlers chain
B. Set UserName and Password used for BASIC Authentication
C. Validate SOAP request message against xml schema
D. Validate SOAP response message against xml schema

22) We have configured a number of Handlers in our Web Service. This is the order of the handlers in the configuration file:
1. LogicalHandler 1
2. LogicalHandler 2
3. SOAPHandler 1
4. SOAPHandler 2

What will be the order of execution on an outbound message?
A. LogicalHandler 1 - SOAPHandler 1 - LogicalHandler 2 - SOAPHandler 2
B. SOAPHandler 1 - SOAPHandler 2 - LogicalHandler 1 - LogicalHandler 2
C. LogicalHandler 1 - LogicalHandler 2 - SOAPHandler 1 - SOAPHandler 2
D. SOAPHandler 2 - SOAPHandler 1 - LogicalHandler 2 - LogicalHandler 1
E. None of above.
Ans - C
Desc - For outgoing message first logical handlers gets executed then SOAPHandlers. And reverse for Inbound message.

23) Please select incorrect statement among following statements.
A. Confidentiality - encrypting of SOAP messages
B. Integrity - signing of SOAP messages
C. Authentication - attach security tokens to SOAP messages
D. Non-repudiation - signing of SOAP messages
E. Authorization - attach identity tokens to SOAP message
Ans - E

24) Which two statements are true about the Web services? (any 2)
A. SOAP messages are compressed during transport to reduce size of payload.
B. You have to implement session tracking via HTTP cookies.
C. The WSDL defines services as collections of network endpoints.
D. All data shared between Java and non-Java components must be in XML format.
E. Data interchange is doen via in XML.
Ans - CE

25) We have a Web Service that can respond with a Street name when receiving a House number. This service will be used on several mobile devices and size of payload should be small to consume less bandwidth. Which technologies can provide the best solution for this requirement. (any 3)
A. XML
B. JSON
C. JAX-WS
D. JAX-RS
E. HTTP
Ans - BDE

26) What are three benefits of using SSL to connect to a Web service without mutual
authentication. (any 3)
A. The server is assured of the client's identity if the client issues the certificate.
B. The client is assured of the server's identity.
C. Message integrity is preserved between the client and the server.
D. The communication between the client and the server is still logged.
E. The communication between the client and the server is encrypted.
F. Using SSL over HTTP incurs less overhead than HTTPS.
Ans - ACE

27) We want to develop a Web Service and after developing we understood result processing can take a long time to finish. So we decided to convert it to asynchronous method invocations. What steps we need to perform to convert our synchronous Web Service to an asynchronous Web Service? (any 2)
A. An asynchronous transport protocol to facilitate the asynchronous invocations.
B. The client providing a ReplyTo-address for the response.
D. A correlation identifier in order to relate the request and response.
E. The client providing a From-address in order for the Web Service to facilitate asynchronous processing.
Ans - BD

28) Given a following code snippet of the service can you tell what is the name of the operation in WSDL file?

@WebService(serviceName = ""PayrollSystemService"", name = ""PayrollSystem"", portName = ""PayrollSystemPort"")
public class PayrollSystem {

 public String getEmployeeDetails(Long empId) {
  return ""dummyDetails"";
 }
}

A. getEmployeeDetails
B. getEmployeeDetailsOperation
C. getEmployeeDetailsMethod
D. getEmployeeDetailsWebMethod
E. getEmployeeDetailsService
Ans - A
Desc - Default value of the operation name is the name of the method. You can modify the name of the operation using @WebMethod annotation.

29) What is the correct WSDL generated from this Web Service declaration: 
@WebService (name=""TaxiService"", portName=""TaxiPort"", serviceName=""TaxiWebService"") public class TaxiServiceImpl {    public void taxi(String msg) {       
 System.out.println(msg);
 } 
}

  A.  <definitions> . . .
    <portType name=""TaxiWebService""> . . .</portType>
    <binding name=""TaxiPortBinding"" type=""...""> . . . </binding>
    <service name=""TaxiServiceImplService"">
     <port name=""TaxiPort"" binding=""tns:TaxiPortBinding"">  . . . </port>
    </service>
   </definitions>
 
  B. <definitions> . . .
    <portType name=""TaxiService""> . . .</portType>
    <binding name=""TaxiPortPortBinding"" type=""...""> . . . </binding>
    <service name=""TaxiWebService"">
     <port name=""TaxiPortPort"" binding=""tns:TaxiPortPortBinding"">  . . . </port>
    </service>
   </definitions>
 
  C.  <definitions>
    . . .
    <portType name=""TaxiService""> . . .</portType>
    <binding name=""TaxiServiceImplPortBinding"" type=""...""> . . . </binding>
    <service name=""TaxiServiceImplService"">
     <port name=""TaxiServicePort"" binding=""tns:TaxiServiceImplPortBinding"">  . . . </port>
    </service>
   </definitions>
 
  D.  <definitions>
    . . .
    <portType name=""TaxiService""> . . .</portType>
    <binding name=""TaxiPortBinding"" type=""...""> . . . </binding>
    <service name=""TaxiWebService"">
     <port name=""TaxiPort"" binding=""tns:TaxiPortBinding"">  . . . </port>
    </service>

   </definitions>
Ans - D

30) Which of the following code snippet matches to this WSDL portType element?  
<portType name=""ElementsTableImpl"">
 <operation name=""getTable"">
  <input message=""tns:getTable"" />
  <output message=""tns:getTableResponse"" />
  <fault message=""tns:WsException"" name=""WsException"" />
 </operation>
</portType>

  A. @WebService
   public class ElementsTableImpl {   
    public SimpleElementsTable getElementsTable(Integer number) throws WsException {       
     SimpleElementsTable table = new SimpleElementsTable(number);
         return table;   
    } 
   }

  B. @WebService
   public class ElementsTableImpl {    
    public SimpleElementsTable getTable(Integer number) {       
     SimpleElementsTable table = new SimpleElementsTable(number);       
     return table;    
    }
   }
   
  C. @WebService (endpointInterface=""ElementsTableService"")
   public class ElementsTableImpl {   
    public SimpleElementsTable getTable(Integer number) throws WsException {       
     SimpleElementsTable table = new SimpleElementsTable(number);       
     return table;    
    } 
   }

  D. @WebService
   public class ElementsTableImpl {    
    public SimpleElementsTable getTable(Integer number) throws WsException {       
     SimpleElementsTable table = new SimpleElementsTable(number);       
     return table;    
    }
   }
Ans - D

Please feel free to correct me if I am wrong anywhere.


10 comments:

  1. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
    mulesoft training

    ReplyDelete
  2. Greetings from M- tech Systems!

    Hope you & your family are doing well in this COVID 19 Pandemic.

    M- tech is Pune based company which is helping peoples for registration of their business viz. Shop act licence, udyog aadhar registration, GST registration. We will develop your website & establish your business online platform. Nowadays Social media marketing is the fastest way of advertisement of business.
    M-tech will do your social media marketing which includes your Facebook page development, increase the google views of your buisness & so on.

    In short M- tech is the one stop shop of all your online / offline business needs.

    For further queries please feel free to contact (concern person details)

    Thanking you,
    M- tech System

    Support@mtechsystems.co.in
    https://mtechsystems.co.in/
    Contact -+919975480871

    #Digitalmarketing
    #whatsappbulkmarketing
    #BulkSMSmarketing
    #GraphicDesigning
    #Socialmediamarketing
    #webddesigning
    #softwaredevelopmen
    #SEO

    www.mtechsystems.co.in

    ReplyDelete


  3. Greetings from The Ganimi Kava team!

    Hope you & your family are doing well in this COVID 19 Pandemic.

    The Ganimi Kava is a famous social site in which we provide various types of information. The word ganimi is the origin of persian language and is the sixth varient of the word. The word kava means 'deception'.

    Here you can read articles, blogs, news, know the history.

    For any queries or suggestions please feel fre to contact us (corncern prsonal details)


    Thanking you,
    The Ganimi Kava


    info@theganimikava.com
    https://theganimikava.com/
    Contact: 08454873124

    #news
    #articles
    #blogs
    #indiandefence
    #travelblogs
    #businessnews
    #technology

    www.theganimikava.com

    https://theganimikava.com/Baji-Prabhu-Deshpande--commander-of-Chhatrapati-Shivaji-Maharaj

    ReplyDelete
  4. Casinos Near Santa Clarita, LA | Mapyro
    Search for 진주 출장샵 Casinos Near 울산광역 출장샵 Santa Clarita in LA. 포항 출장마사지 See 447 traveler reviews, 여주 출장안마 1566 candid photos, and great deals for 광명 출장마사지 Casinos Near Santa Clarita,

    ReplyDelete

  5. Thanks for sharing it. I always enjoy reading such superb content with valuable information. The ideas presented are excellent and really cool, making the post truly enjoyable. Keep up the fantastic work.
    Spring Boot: Empowering Microservices

    ReplyDelete