readyforhires

Intermediate XML & SOAP Web Services test (Intermediate)

30 questions · 35 minutes · Free

SOAP messages, WSDL, XPath and XSLT, and calling SOAP services.

Take the Intermediate XML & SOAP Web Services test

What it covers

Interview format

Sample questions

5 sample questions from the Intermediate XML & SOAP Web Services test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. What does the XPath expression `//book/title/text()` select from the following XML snippet: `<lib><book><title>XML Guide</title></book></lib>`?

    1. The parent element of the <title> element
    2. All text nodes in the document
    3. The <title> element itself
    4. The text content of the <title> element

    Answer: D. The text content of the <title> element

    The XPath expression `//book/title/text()` selects the text content of the <title> element within any <book> element. The other options are either incorrect XPath syntax or select different parts of the XML document.

  2. When calling a SOAP service, what is the correct requirement for the SOAPAction HTTP header?

    1. The SOAPAction HTTP header must be set to the same value as the WSDL service's endpoint address.
    2. The SOAPAction HTTP header must match the action URI declared in the WSDL binding.
    3. The SOAPAction HTTP header is optional and can be omitted for SOAP 1.2 services.
    4. The SOAPAction HTTP header can be any string, as it is not checked by the service.

    Answer: B. The SOAPAction HTTP header must match the action URI declared in the WSDL binding.

    When calling a SOAP service, the SOAPAction HTTP header must match the action URI specified in the WSDL binding. This ensures that the service endpoint correctly identifies and processes the incoming request. If the SOAPAction does not match, the service may return a VersionMismatch fault or fail to process the request altogether.

  3. You are working with an XML document that contains elements in a namespace. Your XSLT stylesheet is not matching the elements in the XML document as expected. What should you do to ensure the XPath expressions in your XSLT stylesheet correctly handle the namespaces?

    1. Use the xmlns attribute in the XPath expression to declare the namespace.
    2. Use the namespace URI directly in the XPath expression without any prefix.
    3. Use a namespace prefix bound in the XSLT stylesheet or use local-name() in the XPath expression.
    4. Use a default namespace declaration in the XSLT stylesheet and omit the namespace in the XPath expression.

    Answer: C. Use a namespace prefix bound in the XSLT stylesheet or use local-name() in the XPath expression.

    When working with XML documents that contain namespaces, XPath expressions in XSLT must account for the namespace declarations. If the XSLT stylesheet does not declare a namespace prefix for the XML namespace, the XPath expression will not match the elements in the XML document. To resolve this, the XSLT stylesheet can bind a namespace prefix, or the XPath expression can use the local-name() function to match elements by their local name, ignoring the namespace.

  4. In a WSDL 1.1 document, where is the endpoint address of a web service defined?

    1. The endpoint address is defined within the 'message' element's 'soap:address' attribute in the WSDL.
    2. The endpoint address is defined within the 'service' element's 'soap:address' attribute in the WSDL.
    3. The endpoint address is defined within the 'portType' element's 'soap:address' attribute in the WSDL.
    4. The endpoint address is defined within the 'binding' element's 'soap:address' attribute in the WSDL.

    Answer: B. The endpoint address is defined within the 'service' element's 'soap:address' attribute in the WSDL.

    In WSDL 1.1, the endpoint address is specified within the 'service' element using the 'soap:address' attribute, which contains the URL of the service. This is how the client discovers where to send the SOAP requests. Other options are incorrect because they refer to elements or attributes not used for defining the endpoint address in the WSDL.

  5. In WSDL 1.1, where is the service name declared, and what is its purpose?

    1. The service name is declared in the 'message' element within the WSDL, and it is used to identify the endpoint of the service.
    2. The service name is declared in the 'binding' element within the WSDL, and it is used to identify the endpoint of the service.
    3. The service name is declared in the 'service' element within the WSDL, and it is used to identify the endpoint of the service.
    4. The service name is declared in the 'types' element within the WSDL, and it is used to identify the endpoint of the service.

    Answer: C. The service name is declared in the 'service' element within the WSDL, and it is used to identify the endpoint of the service.

    In WSDL 1.1, the 'service' element is used to declare the service name and its endpoints. It contains one or more 'port' elements that define the address of the service. This information is crucial for clients to locate and communicate with the service.

Frequently asked questions

How many questions are in the Intermediate XML & SOAP Web Services test?
30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
What does the Intermediate XML & SOAP Web Services test cover?
SOAP message structure, WSDL, XPath and XML queries, XSLT transformations, Calling SOAP services.
Is the Intermediate XML & SOAP Web Services test free?
Yes. It is free to take with a readyforhires account.
What level is the Intermediate XML & SOAP Web Services test?
Intermediate, in Backend.

More Backend tests

Roles that test these skills

Companies that test these skills

All practice tests · All Backend tests

Last updated