Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-101

XsdBasedSoap11Wsdl4jDefinitionBuilder parsing error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 M3
    • Fix Version/s: 1.0 RC1
    • Component/s: None
    • Labels:
      None

      Description

      Parsing xml schema files with xs:element tags have do not a 'name' attribute causes the builder to fail with the following exception when requesting the wsdl:

      java.lang.NullPointerException
      at org.springframework.ws.wsdl.wsdl11.builder.XsdBase dSoap11Wsdl4jDefinitionBuilder.isRequestMessage(Xs dBasedSoap11Wsdl4jDefinitionBuilder.java:244)
      at org.springframework.ws.wsdl.wsdl11.builder.XsdBase dSoap11Wsdl4jDefinitionBuilder.buildMessages(XsdBa sedSoap11Wsdl4jDefinitionBuilder.java:223)
      at org.springframework.ws.wsdl.wsdl11.builder.Abstrac tWsdl4jDefinitionBuilder.buildMessages(AbstractWsd l4jDefinitionBuilder.java:115)

      I have tested a fix locally, and adding a null check to the element name within the following method resolves this problem:

      protected void buildMessages(Definition definition) throws WSDLException {
      NodeList elements = schemaElement.getElementsByTagNameNS(
      SCHEMA_NAMESPACE_URI, "element");
      for (int i = 0; i < elements.getLength(); i++) {
      Element element = (Element) elements.item;
      QName elementName = getSchemaElementName(element);
      if ((elementName != null)
      && (isRequestMessage(elementName) || isResponseMessage(elementName)))

      { Message message = definition.createMessage(); populateMessage(message, element); Part part = definition.createPart(); populatePart(part, elementName); message.addPart(part); message.setUndefined(false); definition.addMessage(message); }

      }
      }

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              paul watson paul watson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: