Using wsimport and wsgen Tools - Quiz

Total: 29 questions

1. What wsimport utility is used for?
It helps to write a Java client against a SOAPbased web service. The utility generates client-support code or artifacts from the service contract, the WSDL document, namely: - Service Endpoint Interface - Service - Exception class mapped from wsdl:fault - Async Reponse Bean derived from response wsdl:message - JAXB generated value types
2. 

Syntax of wsimport.

wsimport [options] <wsdl>

3. What -d option is used for in wsimport?
To specify the place for generated output files.
4. 

What -b option is used for in wsimport?

Specify external JAX-WS or JAXB binding files or additional schema files (Each <file> must have its own -b).

5. What -B option is used for in wsimport?
Pass this option to JAXB schema compiler.
6. What -keep option is used for in wsimport?
Keep generated source code files. It is enabled with -s option.
7. What -p option is used for in wsimport?
To specify a target package.
8. What -s option is used for in wsimport?
Specify the place for generated source code files. -keep is turned on with this option.
9. What -wsdlLocation option is used for in wsimport?
@WebServiceClient.wsdlLocation value.
10. What -target option is used for in wsimport? Default value?
To specify the version of JAX-WS to be compatible with. The default is 2.0.
11. What -verbose is used for in wsimport?
To indicate the work.
12. 

Does wsimport generate WSDL artifacts in a package created from the WSDL targetNamespace by default?

Yes.

13. What wsgen utility is used for?
It generates the data types needed in the document-style service to produce the WSDL automatically. It generates: - any additional Java Architecture for XML Binding (JAXB) classes that are required to marshal and unmarshal the message contents. - a WSDL file if the optional -wsdl argument is specified. The wsgen tool does not automatically generate the WSDL file.
14. Example of generating a WSDL document with wsgen utility.
% wsgen -cp "." -wsdl ch01.es.ExamServerImpl
15. Is there a difference between the WSDL generated with the wsgen utility and the one retrieved at runtime after the web service has been published?
Yes, the wsgen-generated WSDL does not include the service endpoint, as this URL depends on the actual publication of the service.
16. Is using of wsgen tool optional in Java EE6?
Yes, as artifacts are generated at run time.
17. Is using of wsgen tool optional in Java EE5?
No, it is required.
18. When wsgen tool is used?
It is used to generate the required JAX-WS portable artifacts with a bottoms-up approach to develop JAX-WS web services.
19. Syntax of wsgen.
wsgen [options] service_implementation_class
20. What -classpath option is used for in wsgen?
To specify the place of the service implementation class.
21. 

What -cp option is used for in wsgen?

It is the same as -classpath <path>.

22. What -d option is used for in wsgen?
To specify the place for the generated output files.
23. What -extension option is used for in wsgen?
To specify whether to allow custom extensions for functionality not specified by the JAX-WS specification.
24. What -keep option is used for in wsgen?
To specify whether to keep the generated source files.
25. What -r option is used for in wsgen?
Specify the place for the generated WSDL file. This parameter is only used in conjunction with the -wsdl parameter.
26. What -s option is used for in wsgen?
To specify the directory to place the generated source files.
27. What -wsdl option is used for in wsgen?
To generate a WSDL file.
28. What -servicename option is used for in wsgen?
It specifies a wsdl:service name to be generated in the WSDL file. This parameter is only used with the -wsdl option.
29. What -portname option is used for in wsgen?
It specifies a wsdl:port name to be generated in the WSDL file. This parameter is only used with the -wsdl option.
Page 1 of 1