Which lines of code will accomplish this?

A developer is using SAAJ to create a new SOAP message and access the header and body. Which lines of code will accomplish this?
A. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.newMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getSOAPEnvelope();
7. SOAPHeader header = envelope.getSOAPHeader();
8. SOAPBody body=envelope.getSOAPBody();
B. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.new(Message());
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();
C. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();
D. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getSOAPPart();
6. SOAPEnvelope envelope = soapPart.getSOAPEnvelope();
7. SOAPHeader header = envelope.getSOAPHeader();
8. SOAPBody body=envelope.getSOAPBody();
E. 1. //Creating a SOAP message
2. MessageFactory factory = MessageFactory.newInstance();
3. SOAPMessage request = factory.createMessage();
4. //Accessing elements of the message
5. SOAPPart soapPart = request.getPart();
6. SOAPEnvelope envelope = soapPart.getEnvelope();
7. SOAPHeader header = envelope.getHeader();
8. SOAPBody body=envelope.getBody();

Download Printable PDF. VALID exam to help you PASS.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.