You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by babloosony <ba...@gmail.com> on 2005/04/11 19:16:50 UTC

org.xml.sax.SAXException: Invalid element

Hi All,

I am using WSDL2Java program of AXIS 1.2 RC2 on below wsdl and I am
getting below error at runtime:

org.xml.sax.SAXException: Invalid element in ds.OPINFO - PLANDATA
        at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:223)
        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:10
        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:238)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:386)
        at org.apache.axis.client.Call.invoke(Call.java:2402)
        at org.apache.axis.client.Call.invoke(Call.java:2301)
        at org.apache.axis.client.Call.invoke(Call.java:1758)




Response Soap Message from AXIS 1.2 RC2 Server
-------------------------------------------------
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <getOPZingListResponse xmlns="http://ws.as.com/wsdl/ds">
         <OPINFO xmlns="http://ws.as.com/schemas/ds">
            <wsflag>0</wflag>
            <PDATA>
               <TBEAN>
                  <id>100</id>
               </TBEAN>
               <TBEAN>
                  <id>101</ID>
               </TBEAN>
            </PDATA>
         </OPINFO>
      </getOPZingListResponse>
   </soapenv:Body></soapenv:Envelope>
   
   


WSDL
-----
<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions 
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
	xmlns:impl="http://ws.as.com/wsdl/dcplanlistws" 
	xmlns:intf="http://ws.as.com/wsdl/dcplanlistws" 
	xmlns:apachesoap="http://xml.apache.org/xml-soap" 
	xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	xmlns:tns1="http://ws.as.com/schemas/ds" 
	xmlns:tns2="http://ws.as.com/schemas/ds" 
	targetNamespace="http://ws.as.com/wsdl/ds">

<!--WSDL created by Apache Axis version: 1.2RC2 Built on Nov 16, 2004
(12:19:44 EST)-->
<wsdl:types>
	<schema	elementFormDefault="qualified"
xmlns="http://www.w3.org/2001/XMLSchema"
			targetNamespace="http://ws.as.com/schemas/dcplanlistws">
	
		<complexType name="bs-rt-bean">
			<sequence>
				<element name="id" nillable="true" type="xsd:string"/>
			</sequence>
		</complexType>
		<complexType name="REQUESTDATA">
			<complexContent>
				<extension base="tns1:bs-rt-bean">
					<sequence>
						<element name="CLIENTID" nillable="true" type="xsd:string"/>
					</sequence>
				</extension>
			</complexContent>
		</complexType>
		<complexType name="bs-data-bean">
			<sequence>
				<element name="vnumber" nillable="true" type="xsd:string"/>
				<element name="wtext" nillable="true" type="xsd:string"/>
				<element minOccurs="0" maxOccurs="unbounded" name="planData"
type="tns1:TBEAN"/>
			</sequence>
		</complexType>
		<complexType name="TBEAN">
			<sequence>
				<element name="id" nillable="true" type="xsd:string"/>
				<element minOccurs="0" maxOccurs="unbounded" name="planValues"
type="tns1:OPZingValues"/>
			</sequence>
		</complexType>
		<complexType name="OPZingValues">
			<sequence>
				<element name="description" nillable="true" type="xsd:string"/>
			</sequence>
		</complexType>
		<complexType name="OPINFO">
			<complexContent>
				<extension base="tns2:bs-data-bean">
					<sequence>
						<element name="wflag" type="xsd:boolean"/>
					</sequence>
				</extension>
			</complexContent>
		</complexType>
	</schema>

	<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
			targetNamespace="http://ws.as.com/wsdl/dcplanlistws" >
			
			<import namespace="http://ws.as.com/schemas/dcplanlistws"/>

			<element name="getOPZingList">
				<complexType>
					<sequence>
						<element name="in0" type="tns1:REQUESTDATA"/>
					</sequence>
				</complexType>
			</element>
			<element name="getOPZingListResponse">
				<complexType>
					<sequence>
						<element name="getOPZingListReturn" type="tns1:OPINFO"/>
					</sequence>
				</complexType>
			</element>
	</schema>
</wsdl:types>
  
<wsdl:message name="getOPZingListRequest">
	<wsdl:part name="parameters" element="impl:getOPZingList"/>
</wsdl:message>
<wsdl:message name="getOPZingListResponse">
	<wsdl:part name="parameters" element="impl:getOPZingListResponse"/>
</wsdl:message>

<wsdl:portType name="OPZingListWSInterface">
	<wsdl:operation name="getOPZingList">
		<wsdl:input name="getOPZingListRequest" message="impl:getOPZingListRequest"/>
		<wsdl:output name="getOPZingListResponse"
message="impl:getOPZingListResponse"/>
	</wsdl:operation>
</wsdl:portType>
  
<wsdl:binding name="OPZingListWSBinding" type="impl:OPZingListWSInterface">
	<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
	<wsdl:operation name="getOPZingList">
	<wsdlsoap:operation soapAction=""/>
		<wsdl:input name="getOPZingListRequest">
			<wsdlsoap:body use="literal"/>
		</wsdl:input>
		<wsdl:output name="getOPZingListResponse">
			<wsdlsoap:body use="literal"/>
		</wsdl:output>
	</wsdl:operation>
</wsdl:binding>
  
<wsdl:service name="OPZingListWSInterfaceService">
	<wsdl:port name="OPZingListWSBean" binding="impl:OPZingListWSBinding">
		<wsdlsoap:address
location="http://localhost:8080/ArWeb/services/OPZingListWS"/>
	</wsdl:port>
</wsdl:service>

</wsdl:definitions>



Can anyone please tell me is there any thing wrong in my WSDL. Even if
I change my WSDL in accordance with my  response soap message I am
getting similiar exception from AXIS on client side. Please suggest
...



Thanks & Regards,
Kumar.

Re: org.xml.sax.SAXException: Invalid element

Posted by Anne Thomas Manes <at...@gmail.com>.
I think you have the wrong namespaces declared for tns1 and tns2.
Shouldn't they be:

xmlns:tns1="http://ws.as.com/schemas/dcplanlistws"
xmlns:tns2="http://ws.as.com/schemas/dcplanlistws"

On Apr 11, 2005 1:16 PM, babloosony <ba...@gmail.com> wrote:
> Hi All,
> 
> I am using WSDL2Java program of AXIS 1.2 RC2 on below wsdl and I am
> getting below error at runtime:
> 
> org.xml.sax.SAXException: Invalid element in ds.OPINFO - PLANDATA
>         at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:223)
>         at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:10
>         at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
>         at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1140)
>         at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:238)
>         at org.apache.axis.message.RPCElement.getParams(RPCElement.java:386)
>         at org.apache.axis.client.Call.invoke(Call.java:2402)
>         at org.apache.axis.client.Call.invoke(Call.java:2301)
>         at org.apache.axis.client.Call.invoke(Call.java:1758)
> 
> Response Soap Message from AXIS 1.2 RC2 Server
> -------------------------------------------------
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>    <soapenv:Body>
>       <getOPZingListResponse xmlns="http://ws.as.com/wsdl/ds">
>          <OPINFO xmlns="http://ws.as.com/schemas/ds">
>             <wsflag>0</wflag>
>             <PDATA>
>                <TBEAN>
>                   <id>100</id>
>                </TBEAN>
>                <TBEAN>
>                   <id>101</ID>
>                </TBEAN>
>             </PDATA>
>          </OPINFO>
>       </getOPZingListResponse>
>    </soapenv:Body></soapenv:Envelope>
> 
> WSDL
> -----
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <wsdl:definitions
>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>         xmlns:impl="http://ws.as.com/wsdl/dcplanlistws"
>         xmlns:intf="http://ws.as.com/wsdl/dcplanlistws"
>         xmlns:apachesoap="http://xml.apache.org/xml-soap"
>         xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>         xmlns:tns1="http://ws.as.com/schemas/ds"
>         xmlns:tns2="http://ws.as.com/schemas/ds"
>         targetNamespace="http://ws.as.com/wsdl/ds">
> 
> <!--WSDL created by Apache Axis version: 1.2RC2 Built on Nov 16, 2004
> (12:19:44 EST)-->
> <wsdl:types>
>         <schema elementFormDefault="qualified"
> xmlns="http://www.w3.org/2001/XMLSchema"
>                         targetNamespace="http://ws.as.com/schemas/dcplanlistws">
> 
>                 <complexType name="bs-rt-bean">
>                         <sequence>
>                                 <element name="id" nillable="true" type="xsd:string"/>
>                         </sequence>
>                 </complexType>
>                 <complexType name="REQUESTDATA">
>                         <complexContent>
>                                 <extension base="tns1:bs-rt-bean">
>                                         <sequence>
>                                                 <element name="CLIENTID" nillable="true" type="xsd:string"/>
>                                         </sequence>
>                                 </extension>
>                         </complexContent>
>                 </complexType>
>                 <complexType name="bs-data-bean">
>                         <sequence>
>                                 <element name="vnumber" nillable="true" type="xsd:string"/>
>                                 <element name="wtext" nillable="true" type="xsd:string"/>
>                                 <element minOccurs="0" maxOccurs="unbounded" name="planData"
> type="tns1:TBEAN"/>
>                         </sequence>
>                 </complexType>
>                 <complexType name="TBEAN">
>                         <sequence>
>                                 <element name="id" nillable="true" type="xsd:string"/>
>                                 <element minOccurs="0" maxOccurs="unbounded" name="planValues"
> type="tns1:OPZingValues"/>
>                         </sequence>
>                 </complexType>
>                 <complexType name="OPZingValues">
>                         <sequence>
>                                 <element name="description" nillable="true" type="xsd:string"/>
>                         </sequence>
>                 </complexType>
>                 <complexType name="OPINFO">
>                         <complexContent>
>                                 <extension base="tns2:bs-data-bean">
>                                         <sequence>
>                                                 <element name="wflag" type="xsd:boolean"/>
>                                         </sequence>
>                                 </extension>
>                         </complexContent>
>                 </complexType>
>         </schema>
> 
>         <schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
>                         targetNamespace="http://ws.as.com/wsdl/dcplanlistws" >
> 
>                         <import namespace="http://ws.as.com/schemas/dcplanlistws"/>
> 
>                         <element name="getOPZingList">
>                                 <complexType>
>                                         <sequence>
>                                                 <element name="in0" type="tns1:REQUESTDATA"/>
>                                         </sequence>
>                                 </complexType>
>                         </element>
>                         <element name="getOPZingListResponse">
>                                 <complexType>
>                                         <sequence>
>                                                 <element name="getOPZingListReturn" type="tns1:OPINFO"/>
>                                         </sequence>
>                                 </complexType>
>                         </element>
>         </schema>
> </wsdl:types>
> 
> <wsdl:message name="getOPZingListRequest">
>         <wsdl:part name="parameters" element="impl:getOPZingList"/>
> </wsdl:message>
> <wsdl:message name="getOPZingListResponse">
>         <wsdl:part name="parameters" element="impl:getOPZingListResponse"/>
> </wsdl:message>
> 
> <wsdl:portType name="OPZingListWSInterface">
>         <wsdl:operation name="getOPZingList">
>                 <wsdl:input name="getOPZingListRequest" message="impl:getOPZingListRequest"/>
>                 <wsdl:output name="getOPZingListResponse"
> message="impl:getOPZingListResponse"/>
>         </wsdl:operation>
> </wsdl:portType>
> 
> <wsdl:binding name="OPZingListWSBinding" type="impl:OPZingListWSInterface">
>         <wsdlsoap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <wsdl:operation name="getOPZingList">
>         <wsdlsoap:operation soapAction=""/>
>                 <wsdl:input name="getOPZingListRequest">
>                         <wsdlsoap:body use="literal"/>
>                 </wsdl:input>
>                 <wsdl:output name="getOPZingListResponse">
>                         <wsdlsoap:body use="literal"/>
>                 </wsdl:output>
>         </wsdl:operation>
> </wsdl:binding>
> 
> <wsdl:service name="OPZingListWSInterfaceService">
>         <wsdl:port name="OPZingListWSBean" binding="impl:OPZingListWSBinding">
>                 <wsdlsoap:address
> location="http://localhost:8080/ArWeb/services/OPZingListWS"/>
>         </wsdl:port>
> </wsdl:service>
> 
> </wsdl:definitions>
> 
> Can anyone please tell me is there any thing wrong in my WSDL. Even if
> I change my WSDL in accordance with my  response soap message I am
> getting similiar exception from AXIS on client side. Please suggest
> ...
> 
> Thanks & Regards,
> Kumar.
>