You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org> on 2007/06/16 21:52:25 UTC

[jira] Resolved: (AXIS2-2589) com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.

     [ https://issues.apache.org/jira/browse/AXIS2-2589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-2589.
-------------------------------------------------

    Resolution: Fixed

This response element is wrong. the schema that defines the xml is as follows.
<xs:element name="response">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="response" nillable="true" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
this expects a string inside the response element. but your xml contains an xml. if you want to do so you have to do it like this.

<ns1:response xmlns:ns1="http://tempuri.org/Product_Version_V002/definitions">
    <ns1:response>
        &lt;FundVersionResponse&gt;
        &lt;TransactionStatus&gt;Success&lt;/TransactionStatus&gt;
        &lt;/FundVersionResponse&gt;
    </ns1:response>
</ns1:response>

> com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
> --------------------------------------------------------------------------------
>
>                 Key: AXIS2-2589
>                 URL: https://issues.apache.org/jira/browse/AXIS2-2589
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.1.1
>         Environment: WindowsXP, Java 1.4.2, Eclipse 3.2.1
>            Reporter: Stuart Bell
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Blocker
>             Fix For: 1.3
>
>         Attachments: Product_Version_For_JIRA.wsdl
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org