Q11. What are 2 styles web service’s endpoint by using JAX-WS?
- RPC (remote procedure call) style web service in JAX-WS
- document style web service in JAX-WS.
For more read our previous article Difference between RPC Style and Document Style SOAP web Services in Java
Q12. What is the difference between RPC Style and Document Style SOAP web Services?
These two are the different approach of JAX-WS. RPC style generate WSDL document based on the method name and it’s parameters. No type definitions are present in WSDL document.
Document style contains type and can be validated against predefined schema.
for more details example read previous article Difference between RPC Style and Document Style SOAP web Services in Java
Q13. What is use of javax.xml.ws.Endpoint class?
Endpoint class provides useful methods to create endpoint and publish existing implementation as web service. This comes handy in testing web services before making further changes to deploy it on actual server.
Q14. What is sun-jaxws.xml file?
sun-jaxws.xml file is used to provide endpoints details when JAX-WS web services are deployed in servlet container such as Tomcat. This file is present under WEB-INF directory and contains endpoint name, implementation class and URL pattern. For example as follows.
Q15. How to get WSDL file of a SOAP web service?
WSDL document can be accessed by appending ?wsdl to the SOAP endoint URL. we can access it at http://localhost:8888/employeeWS?wsdl location.
Q16. What is the use of @XmlRootElement annotation?
@XmlRootElement annotation is used by
JAXB (Java Architecture for XML Binding) to transform java object to XML and vice versa. We have to annotate model classes with this annotation.
Q17. What is MTOM?
MTOM (Message Transmission Optimization Mechanism) is a mechanism for transmitting large binary attachments with SOAP messages as raw bytes, allowing for smaller messages.
Q18. What is XOP?
XOP (XML-binary Optimized Packaging) is a mechanism defined for the serialization of XML Information Sets that contain binary data, as well as deserialization back into the XML Information Set.
Q19. What is JAX-WS?
JAX-WS (Java API for XML Web Services) is a set of APIs for creating web services in SOAP XML format.
Q20. What is JAXB?
JAXB (Java Architecture for XML Binding) is a Java standard that defines how Java objects are converted from and to XML. It makes reading and writing of XML via Java relatively easy.