Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-2589

com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.1.1
    • 1.3
    • om
    • None
    • WindowsXP, Java 1.4.2, Eclipse 3.2.1

    Description

      Hi,

      I have SOAP XML being returned from a service using Axis2, however it is resorting to the following exception:

      com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.

      This Exception is thrown in my generated stub class derived from a WSDL. The line that it is failing on is when it attempts to execute a getElementText() method on an XMLStreamReader based object. I performed various checks and I can confirm that the state of the XML reader is START_ELEMENT. According to Stax documentation, this is a valid state for the getElementText() method to be called.

      A sample of the response XML I am attempting to parse is as follows:

      <?xml version='1.0' encoding='utf-8'?>
      <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
      <ns1:response xmlns:ns1="http://tempuri.org/Product_Version_V002/definitions">
      <ns1:response>
      <FundVersionResponse>
      <TransactionStatus>Success</TransactionStatus>
      <Platform>
      <Indicator>M</Indicator>
      <Version>
      <VersionNo>4</VersionNo>
      </Version>
      </Platform>
      <Platform>
      <Indicator>U</Indicator>
      <Version>
      <VersionNo>7</VersionNo>
      </Version>
      <Version>
      <VersionNo>8</VersionNo>
      </Version>
      <Version>
      <VersionNo>9</VersionNo>
      </Version>
      <Version>
      <VersionNo>10</VersionNo>
      </Version>
      <Version>
      <VersionNo>11</VersionNo>
      </Version>
      </Platform>
      </FundVersionResponse>
      </ns1:response>
      </ns1:response>
      </soapenv:Body>
      </soapenv:Envelope>

      Can anyone please help or comment on this? This is preventing me from using Axis2 altogether during my proof of concept.

      Thanks,

      Stuart

      Attachments

        1. Product_Version_For_JIRA.wsdl
          6 kB
          Stuart Bell

        Activity

          People

            amilachinthaka Amila Chinthaka Suriarachchi
            stuart.bell@aegon.co.uk Stuart Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: