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 "SPSS (JIRA)" <ax...@ws.apache.org> on 2005/07/21 19:13:10 UTC

[jira] Created: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

CastorSerializer 1.2/1.2.1 does not handle arrays correctly
-----------------------------------------------------------

         Key: AXIS-2135
         URL: http://issues.apache.org/jira/browse/AXIS-2135
     Project: Apache Axis
        Type: Bug
  Components: Serialization/Deserialization  
    Versions: 1.2, 1.2.1    
    Reporter: SPSS


It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).

Here is the SOAP envelope produced by the serializer:

<?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>
             <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
                    <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
                           <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
                    </ns1:subscriber[0,unbounded]> 
             </getSubscribersResponse>
       </soapenv:Body>
</soapenv:Envelope>

Note that array boundaries are included in the XML as [0,unbounded]. 
The XML parser throws the following exception when tries to parse this invalid XML

org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
	at org.apache.axis.client.Call.invoke(Call.java:2748)
	at org.apache.axis.client.Call.invoke(Call.java:2424)
	at org.apache.axis.client.Call.invoke(Call.java:2347)
	at org.apache.axis.client.Call.invoke(Call.java:1804)
	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)

The correct envelope should look like this

<?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>
             <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
                    <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
                           <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
                    </ns1:subscriber> 
             </getSubscribersResponse>
       </soapenv:Body>
</soapenv:Envelope>

The quick fix is the change 

            marshaller.setRootElement(name.getLocalPart());

to 

            String localPart = name.getLocalPart();
            int arrayDims = localPart.indexOf('[');
            if (arrayDims != -1) {
                localPart = localPart.substring(0, arrayDims);
            }
            marshaller.setRootElement(localPart);

in the org.apache.axis.encoding.ser.castor.CastorSerializer






-- 
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


[jira] Resolved: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2135?page=all ]
     
Davanum Srinivas resolved AXIS-2135:
------------------------------------

    Resolution: Fixed

Applied patch.

thanks,
dims

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Updated: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "SPSS (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2135?page=all ]

SPSS updated AXIS-2135:
-----------------------

    Attachment: castor_serializer_diffs.zip

I have attached diffs as you requested.

Thanks,
Dmitry

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: SPSS
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Greg Tassone (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12372585 ] 

Greg Tassone commented on AXIS-2135:
------------------------------------

Done.  I've created a new bug #AXIS-2454 to deal with this as a separate issue.

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Eric Schwarzenbach (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12366849 ] 

Eric Schwarzenbach commented on AXIS-2135:
------------------------------------------

I see this is marked fixed but not closed, and there is no Fix version set...and yet 1.3 has come out since the comments with the patch.

Was this fix really in 1.3 and not closing seting the Fix version just an oversight? Or does 1.3 still have this bug? 

I am in fact seeing this same kind of [0,unbounded] crap in my messages with 1.3 and it is breaking my interoperability. 

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Dmitry Vasilenko (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12372573 ] 

Dmitry Vasilenko commented on AXIS-2135:
----------------------------------------

Please file a new bug report if you are having problems with standard serializers. This bug was resolved for CastorSerializers. 

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Eric Schwarzenbach (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12367250 ] 

Eric Schwarzenbach commented on AXIS-2135:
------------------------------------------

I comparing the source, I can see that this patch is indeed in the 1.3 source. I'm attempting to debug it, though I don't really have much of a grasp of how all the various serialization classes come into play...I'm not actually seeing CastorSerializer be invoked in my case (not that I have any basis for thinking it should, other than its mention in this bug which I found by searching on the symptom), but rather BeanSerializer, SerializationContext, and ArraySerializer.

I'm beginning to suspect ArraySerializer...perhaps I should create a new Issue.

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Davanum Srinivas (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12316406 ] 

Davanum Srinivas commented on AXIS-2135:
----------------------------------------

can you please submit a diff against latest CVS? easier to review the changes. (New files i can get from the zip, that's ok)

thanks,
dims

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: SPSS
>  Attachments: castor_serializer.zip
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Updated: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "SPSS (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2135?page=all ]

SPSS updated AXIS-2135:
-----------------------

    Attachment: castor_serializer.zip

Added castor_serializer.zip with updated org.apache.axis.encoding.ser.castor.CastorSerializer file

The ZIP also includes updated Castor*Factory.java classes with static create(..) method to suppress 
annoying NoSuchMethodException exceptions like  

java.lang.NoSuchMethodException: org.apache.axis.encoding.ser.castor.CastorSerializerFactory.create(java.lang.Class, javax.xml.namespace.QName)



> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: SPSS
>  Attachments: castor_serializer.zip
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Updated: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Dmitry Vasilenko (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXIS-2135?page=all ]

Dmitry Vasilenko updated AXIS-2135:
-----------------------------------

    Attachment: patchfile.txt

The patch against the latest version of CVS

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Dmitry Vasilenko (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12366855 ] 

Dmitry Vasilenko commented on AXIS-2135:
----------------------------------------

I'm not sure why you still see that [0,unbounded] crap in your messages...
We tested Axis 1.3 with our WSDL and it seemed to be working fine...


> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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


[jira] Commented: (AXIS-2135) CastorSerializer 1.2/1.2.1 does not handle arrays correctly

Posted by "Greg Tassone (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXIS-2135?page=comments#action_12372571 ] 

Greg Tassone commented on AXIS-2135:
------------------------------------

I am having this exact issue right now.  Axis 1.3 is encoding my Array-enabled messages with the same exact broken XML as you're listing above (example below).  I am using the standard serializers -- my guess is that ArraySerializer is having the issue.

Eric Schwarzenbach:  Did you find any resolution to this?  I see in certain mailing list messages that changing the structure of the WSDL may solve the problem... have you tried this?  I couldn't find a new bug on this so I assume you haven't yet created one?

Here is an example of mine:

[code]
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Date: Thu, 30 Mar 2006 05:10:54 GMT
Connection: close

<?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>
         <getAlarmListResponse xmlns="http://vtracsystems.net/ResponseCenterService">
            <alarm[0,unbounded]>
               <alarmTime xmlns="">1142220126</alarmTime>
               <latestEventTime xmlns="">1142220265</latestEventTime>
               <lastUpdateTime xmlns="">1142220265</lastUpdateTime>
            </alarm[0,unbounded]>
            <alarm[0,unbounded]>
               <alarmTime xmlns="">1142220266</alarmTime>
               <latestEventTime xmlns="">1142220508</latestEventTime>
               <lastUpdateTime xmlns="">1142220508</lastUpdateTime>
            </alarm[0,unbounded]>
            <alarm[0,unbounded]>
               <alarmTime xmlns="">1142220901</alarmTime>
               <latestEventTime xmlns="">1142221208</latestEventTime>
               <lastUpdateTime xmlns="">1142221208</lastUpdateTime>
            </alarm[0,unbounded]>
         </getAlarmListResponse>
      </soapenv:Body>
   </soapenv:Envelope>

[/code]

> CastorSerializer 1.2/1.2.1 does not handle arrays correctly
> -----------------------------------------------------------
>
>          Key: AXIS-2135
>          URL: http://issues.apache.org/jira/browse/AXIS-2135
>      Project: Apache Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2, 1.2.1
>     Reporter: Dmitry Vasilenko
>  Attachments: castor_serializer.zip, castor_serializer_diffs.zip, patchfile.txt
>
> It seems that new Castor Serializer for Axis 1.2/1.2.1 does not handle arrays correctly (it works fine in 1.1).
> Here is the SOAP envelope produced by the serializer:
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber[0,unbounded] enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber[0,unbounded]> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> Note that array boundaries are included in the XML as [0,unbounded]. 
> The XML parser throws the following exception when tries to parse this invalid XML
> org.xml.sax.SAXParseException: Element type "ns1:subscriber" must be followed by either attribute specifications, ">" or "/>".
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode: 
>  faultString: org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
>  faultActor: 
>  faultNode: 
>  faultDetail: 
> 	{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Element type &quot;ns1:subscriber&quot; must be followed by either attribute specifications, &quot;&gt;&quot; or &quot;/&gt;&quot;.
> 	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
> 	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
> 	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> 	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> 	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
> 	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
> 	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
> 	at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
> 	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
> 	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
> 	at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
> 	at org.apache.axis.client.Call.invoke(Call.java:2748)
> 	at org.apache.axis.client.Call.invoke(Call.java:2424)
> 	at org.apache.axis.client.Call.invoke(Call.java:2347)
> 	at org.apache.axis.client.Call.invoke(Call.java:1804)
> 	at com.spss.notification.ws.axis.SubscriptionRepositoryServiceStub.getSubscribers(SubscriptionRepositoryServiceStub.java:2120)
> The correct envelope should look like this
> <?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>
>              <getSubscribersResponse xmlns="http://xml.spss.com/notification/remote">
>                     <ns1:subscriber enabled="true" principalID="\SPSS\dvasilen" xmlns:ns1=" http://xml.spss.com/notification">
>                            <ns1:identifier>0a0a483801584807000001053a13f207800e</ns1:identifier>
>                     </ns1:subscriber> 
>              </getSubscribersResponse>
>        </soapenv:Body>
> </soapenv:Envelope>
> The quick fix is the change 
>             marshaller.setRootElement(name.getLocalPart());
> to 
>             String localPart = name.getLocalPart();
>             int arrayDims = localPart.indexOf('[');
>             if (arrayDims != -1) {
>                 localPart = localPart.substring(0, arrayDims);
>             }
>             marshaller.setRootElement(localPart);
> in the org.apache.axis.encoding.ser.castor.CastorSerializer

-- 
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