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 bu...@apache.org on 2003/02/17 20:47:08 UTC
DO NOT REPLY [Bug 17140] New: -
XML Schema Extension Element not Deserialized Correctly
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17140>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17140
XML Schema Extension Element not Deserialized Correctly
Summary: XML Schema Extension Element not Deserialized Correctly
Product: Axis
Version: 1.1RC1
Platform: PC
OS/Version: Windows NT/2K
Status: NEW
Severity: Major
Priority: Other
Component: Serialization/Deserialization
AssignedTo: axis-dev@ws.apache.org
ReportedBy: fwaris@ford.com
I am using WSAD/WAS 5.0 + Axis 1.1RC1 to access a Web Service.
The WSDL2Java tool was used to generate the proxy and the Java bean classes. My
goal is to test if we can successfully exchange and process complex XML
documents (based on the OAGIS BOD Schema's) via Web Services.
I have found that the Deserialzation mechanism is unable to handle XML Schema
extension elements which are all to too common in OAGIS BODs. I have isolated
the problem to a simple WSDL and an XML message. The stack trace, WSDL and the
sample XML message are attached at the end of the document.
In the WSDL look at the elements Status and Dispostion. Disposition extends
Status. This translates correctly to Disposition being the sublcass of Status
in the WSDL2Java generated code. However, this is also what causes the problem
when a message containing the Disposition element is deserialized.
Faisal
Here are the attachmetnts:
---- Stack Trace -------------------------------
. I get an "org.xml.sax.SAXException: Invalid element...' error when trying to
access the web
I get the following error when I access a web service form the WSDL2Java
generated proxy:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Invalid element in
org.tempuri.Disposition - Code
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException:
Invalid element in org.tempuri.Disposition - Code
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild
(BeanDeserializer.java:260)
at org.apache.axis.encoding.DeserializationContextImpl.startElement
(DeserializationContextImpl.java:921)
at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:198)
at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:699)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:224)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:331)
at org.apache.axis.client.Call.invoke(Call.java:2200)
at org.apache.axis.client.Call.invoke(Call.java:2099)
at org.apache.axis.client.Call.invoke(Call.java:1622)
at org.tempuri.PlanWSSoapStub.getPlan(PlanWSSoapStub.java:164)
at TestPlanServlet.doGet(TestPlanServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService
(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service
(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service
(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service
(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service
(ServletInstance.java:258)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch
(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch
(ServletInstanceReference.java:40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch
(WebAppRequestDispatcher.java:872)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch
(WebAppRequestDispatcher.java:491)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward
(WebAppRequestDispatcher.java:173)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward
(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook
(WebAppInvoker.java:199)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation
(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI
(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service
(OSEListener.java:331)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest
(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest
(HttpConnection.java:432)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:343)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:592)
----------- WSDL --------------------
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://tempuri.org/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://tempuri.org/">
<s:element name="GetPlan">
<s:complexType />
</s:element>
<s:element name="GetPlanResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetPlanResult"
type="s0:Plan" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="Plan">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Disposition"
type="s0:Disposition" />
</s:sequence>
</s:complexType>
<s:complexType name="Disposition">
<s:complexContent mixed="false">
<s:extension base="s0:Status" />
</s:complexContent>
</s:complexType>
<s:complexType name="Status">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Code" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Description"
type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="Plan" nillable="true" type="s0:Plan" />
</s:schema>
</types>
<message name="GetPlanSoapIn">
<part name="parameters" element="s0:GetPlan" />
</message>
<message name="GetPlanSoapOut">
<part name="parameters" element="s0:GetPlanResponse" />
</message>
<message name="GetPlanHttpGetIn" />
<message name="GetPlanHttpGetOut">
<part name="Body" element="s0:Plan" />
</message>
<message name="GetPlanHttpPostIn" />
<message name="GetPlanHttpPostOut">
<part name="Body" element="s0:Plan" />
</message>
<portType name="PlanWSSoap">
<operation name="GetPlan">
<input message="s0:GetPlanSoapIn" />
<output message="s0:GetPlanSoapOut" />
</operation>
</portType>
<portType name="PlanWSHttpGet">
<operation name="GetPlan">
<input message="s0:GetPlanHttpGetIn" />
<output message="s0:GetPlanHttpGetOut" />
</operation>
</portType>
<portType name="PlanWSHttpPost">
<operation name="GetPlan">
<input message="s0:GetPlanHttpPostIn" />
<output message="s0:GetPlanHttpPostOut" />
</operation>
</portType>
<binding name="PlanWSSoap" type="s0:PlanWSSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="GetPlan">
<soap:operation soapAction="http://tempuri.org/GetPlan"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<binding name="PlanWSHttpGet" type="s0:PlanWSHttpGet">
<http:binding verb="GET" />
<operation name="GetPlan">
<http:operation location="/GetPlan" />
<input>
<http:urlEncoded />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<binding name="PlanWSHttpPost" type="s0:PlanWSHttpPost">
<http:binding verb="POST" />
<operation name="GetPlan">
<http:operation location="/GetPlan" />
<input>
<mime:content type="application/x-www-form-urlencoded" />
</input>
<output>
<mime:mimeXml part="Body" />
</output>
</operation>
</binding>
<service name="PlanWS">
<port name="PlanWSSoap" binding="s0:PlanWSSoap">
<soap:address location="http://19.49.203.148/WebService1/PlanWS.asmx" />
</port>
<port name="PlanWSHttpGet" binding="s0:PlanWSHttpGet">
<http:address location="http://19.49.203.148/WebService1/PlanWS.asmx" />
</port>
<port name="PlanWSHttpPost" binding="s0:PlanWSHttpPost">
<http:address location="http://19.49.203.148/WebService1/PlanWS.asmx" />
</port>
</service>
</definitions>
---------- Sample XML Message ----------------
<?xml version="1.0" encoding="utf-8"?>
<Plan xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
<Disposition>
<Code>p1s1b1</Code>
<Description>disposition</Description>
</Disposition>
</Plan>