axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bjorn Townsend (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-2399) Problem with unbounded elements and sequence in SimpleAxisServer
Date Thu, 16 Feb 2006 21:50:09 GMT
    [ http://issues.apache.org/jira/browse/AXIS-2399?page=comments#action_12366694 ] 

Bjorn Townsend commented on AXIS-2399:
--------------------------------------

Looking at the source code for the exception,

   /**
     * There should not be nested elements, so thow and exception if this occurs.
     */
    public SOAPHandler onStartChild(String namespace,
                                    String localName,
                                    String prefix,
                                    Attributes attributes,
                                    DeserializationContext context)
            throws SAXException
    {
        throw new SAXException(
                Messages.getMessage("cantHandle00", "SimpleDeserializer"));
    } 

it seems pretty clear that the SimpleDeserializer is not intended to handle nested elements.
 It looks like a different deserializer needs to be used, but I think you may be going beyond
SimpleAxisServer's intended capabilities.  From the Simple Axis Server class javadoc notes:


"This is a simple implementation of an HTTP server for processing SOAP requests via Apache's
xml-axis. This is not intended for production use. Its intended uses are for demos, debugging,
and performance profiling."
(http://ws.apache.org/axis/java/apiDocs/org/apache/axis/transport/http/SimpleAxisServer.html)


And it looks to me like SimpleAxisServer is designed to use only the SimpleDeserializer. 
I would say you need to use a more complete server for this application.  

> Problem with unbounded elements and sequence in SimpleAxisServer
> ----------------------------------------------------------------
>
>          Key: AXIS-2399
>          URL: http://issues.apache.org/jira/browse/AXIS-2399
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.3
>  Environment: Java Version 1.4.2_09
> SimpleAxisServer
>     Reporter: Thomas Früh
>     Priority: Blocker
>  Attachments: Example.xsd
>
> With the newest version 1.3., I have a problem with following xml schema type:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
attributeFormDefault="unqualified">
> 	<xs:complexType name="ucFeedbackRequestType">
> 		<xs:sequence>
> 			<xs:element name="ucLabel" type="xs:string"/>
> 			<xs:element name="possibleAnswers">
> 				<xs:complexType>
> 					<xs:sequence>
> 						<xs:element name="Answer" maxOccurs="unbounded">
> 							<xs:complexType>
> 								<xs:sequence>
> 									<xs:element name="code" type="xs:string"/>
> 									<xs:element name="text" type="xs:string"/>
> 								</xs:sequence>
> 							</xs:complexType>
> 						</xs:element>
> 					</xs:sequence>
> 				</xs:complexType>
> 			</xs:element>
> 			<xs:element name="defaultCode" type="xs:string"/>
> 			<xs:element name="timeOut" type="xs:unsignedInt"/>
> 		</xs:sequence>
> 	</xs:complexType>
> </xs:schema>
> In our Java Application I use the SimpleAxisServer to receive some soap messages from
a client.
> If the SimpleAxisServer receive a SOAP Message with the upper structure, then I get the
following error in the client:
> <?xml version="1.0" encoding="UTF-8"?>
> <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>
> 		<soapenv:Fault>
> 			<faultcode>soapenv:Server.userException</faultcode>
> 			<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child
element, which is NOT expected, in something it was trying to deserialize.</faultstring>
> 			<detail>
> 				<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXException:
SimpleDeserializer encountered a child element, which is NOT expected, in something it was
trying to deserialize.
> org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
> org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
> org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
> org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
> org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:81)
> org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
> org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
> org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
> org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
> org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
> org.apache.axis.transport.http.SimpleAxisWorker.execute(SimpleAxisWorker.java:428)
> org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.java:155)
> java.lang.Thread.run(Unknown Source)
> </ns1:stackTrace>
> 				<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">CHZRHD0CH0152</ns2:hostname>
> 			</detail>
> 		</soapenv:Fault>
> 	</soapenv:Body>
> </soapenv:Envelope>
>  
> If the SimpleAxisServer receive a soap message with an empty <xs:element name="possibleAnswers">
 tag then there is no error.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message