axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r614123 - in /webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri: CodeGenerationUtility.java template/JaxbRIDatabindingTemplate.xsl
Date Tue, 22 Jan 2008 05:46:54 GMT
Author: amilas
Date: Mon Jan 21 21:46:39 2008
New Revision: 614123

URL: http://svn.apache.org/viewvc?rev=614123&view=rev
Log:
Always a new input stream must be created when resolving schemas.
add additional escape charactors to escape [].

Modified:
    webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
    webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java?rev=614123&r1=614122&r2=614123&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
(original)
+++ webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/CodeGenerationUtility.java
Mon Jan 21 21:46:39 2008
@@ -102,6 +102,7 @@
                 //here we have to set a proper system ID. otherwise when processing the
                 // included schaemas for this schema we have a problem
                 // it creates the system ID using this target namespace value
+                
                 inputSource.setSystemId(baseURI + "xsd" + i + ".xsd");
                 inputSource.setPublicId(schema.getTargetNamespace());
                 schemaToInputSourceMap.put(schema,inputSource);
@@ -118,8 +119,15 @@
                     for (Iterator iter = schemaToInputSourceMap.keySet().iterator();iter.hasNext();)
{
                         key = (XmlSchema) iter.next();
                         if (key.getTargetNamespace().equals(publicId)) {
-                            returnInputSource = (InputSource) schemaToInputSourceMap.get(key);
-                            // we have the requried schema
+
+                            // when returning the input stream we have to always return a
new
+                            // input stream.
+                            // sinc jaxbri internally consumes the input stream it gives
an
+                            // exception.
+                            returnInputSource = new InputSource(new StringReader(getSchemaAsString(key)));
+                            InputSource existingInputSource = (InputSource) schemaToInputSourceMap.get(key);
+                            returnInputSource.setSystemId(existingInputSource.getSystemId());
+                            returnInputSource.setSystemId(existingInputSource.getPublicId());
                             break;
                         }
                     }

Modified: webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl?rev=614123&r1=614122&r2=614123&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/jaxbri/src/org/apache/axis2/jaxbri/template/JaxbRIDatabindingTemplate.xsl
Mon Jan 21 21:46:39 2008
@@ -35,7 +35,7 @@
 
         <xsl:for-each select="param[not(@type = preceding-sibling::param/@type)]">
             <xsl:if test="@type!=''">
-                private static final javax.xml.bind.JAXBContext _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                private static javax.xml.bind.JAXBContext _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
             </xsl:if>
         </xsl:for-each>
 
@@ -54,7 +54,7 @@
                         Runtime.getRuntime().exit(-1);
                     }
                     finally {
-                        _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>
= jc;
+                        _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>
= jc;
                         classContextMap.put(<xsl:value-of select="@type"/>.class, jc);
                     }
                 </xsl:if>
@@ -67,7 +67,7 @@
                 private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/>
param, boolean optimizeContent)
                 throws org.apache.axis2.AxisFault {
                     try {
-                        javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                        javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                         javax.xml.bind.Marshaller marshaller = context.createMarshaller();
                         marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
 
@@ -100,7 +100,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Byte ret = (java.lang.Integer)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
byte.class).getValue();
@@ -115,7 +115,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Character ret = (java.lang.Character)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
char.class).getValue();
@@ -130,7 +130,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Double ret = (java.lang.Double)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
double.class).getValue();
@@ -145,7 +145,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Float ret = (java.lang.Float)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
float.class).getValue();
@@ -160,7 +160,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Integer ret = (java.lang.Integer)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
int.class).getValue();
@@ -175,7 +175,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Long ret = (java.lang.Long)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
long.class).getValue();
@@ -190,7 +190,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Short ret = (java.lang.Short)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
short.class).getValue();
@@ -205,7 +205,7 @@
                             org.apache.axiom.om.OMElement param,
                             java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
                             try {
-                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;','___')"/>;
+                                javax.xml.bind.JAXBContext context = _<xsl:value-of select="translate(@type,'.&gt;&lt;[]','_____')"/>;
                                 javax.xml.bind.Unmarshaller unmarshaller = context.createUnmarshaller();
 
                                 java.lang.Boolean ret = (java.lang.Boolean)unmarshaller.unmarshal(param.getXMLStreamReaderWithoutCaching(),
boolean.class).getValue();



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


Mime
View raw message