Author: nadiramra
Date: Wed Jul 18 16:26:26 2012
New Revision: 1363007

URL: http://svn.apache.org/viewvc?rev=1363007&view=rev
Log:
AXISCPP-1090 Wrong namespace being used (part 2)

Modified:
    
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java

Modified: 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=1363007&r1=1363006&r2=1363007&view=diff
==============================================================================
--- 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java 
(original)
+++ 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java 
Wed Jul 18 16:26:26 2012
@@ -232,7 +232,14 @@ public class BeanParamWriter extends Par
         {
             String namespace = "NULL";
             if (attribs[i].getNsQualified())
+            {
                 namespace = "Axis_URI_" + c_classname;
+                
+                // Elements can reference other elements in different 
schema...need to handle.
+                QName elementName = attribs[i].getElementName();
+                if (elementName != null)
+                   namespace = "\"" + elementName.getNamespaceURI() + "\"";
+            }
             
             // if the attribute is a choice following should do
             boolean ifCheckPrinted = false;
@@ -325,15 +332,6 @@ public class BeanParamWriter extends Par
             else
             {
                 //if complex type
-                namespace = type.getName().getNamespaceURI();
-                
-                String elm        = attribs[i].getParamNameAsSOAPString();
-                QName elementName = attribs[i].getElementName();
-                if (elementName != null)
-                   namespace = elementName.getNamespaceURI();
-                
-                if (attribs[i].isReference())
-                    elm = attribs[i].getTypeName();
                 
                 String tab = "";
                 if (ifCheckPrinted)
@@ -344,8 +342,17 @@ public class BeanParamWriter extends Par
                     c_writer.write("\tif (param->" + 
attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n\t");
                 }
                 
+                String elm = attribs[i].getParamNameAsSOAPString();
+                if (attribs[i].isReference())
+                    elm = attribs[i].getTypeName();
+                
                 if (attribs[i].getNsQualified())
                 {
+                    namespace = type.getName().getNamespaceURI();
+                    QName elementName = attribs[i].getElementName();
+                    if (elementName != null)
+                       namespace = elementName.getNamespaceURI();
+                    
                     c_writer.write("\tsPrefix = 
axiscSoapSerializerGetNamespacePrefix(pSZ, \"" + namespace + "\", 
&blnIsNewSubElemPrefix);\n");
                     c_writer.write(tab + "\taxiscSoapSerializerSerialize(pSZ, 
\"<\", sPrefix, \":\", \"" + elm + "\", 0);\n");
                     c_writer.write(tab + "\tif (blnIsNewSubElemPrefix)\n");

Modified: 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: 
http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=1363007&r1=1363006&r2=1363007&view=diff
==============================================================================
--- 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
 (original)
+++ 
axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
 Wed Jul 18 16:26:26 2012
@@ -445,7 +445,14 @@ public class BeanParamWriter extends Par
         {
             String namespace = "NULL";
             if (attribs[i].getNsQualified())
+            {
                 namespace = "Axis_URI_" + c_classname;
+                
+                // Elements can reference other elements in different 
schema...need to handle.
+                QName elementName = attribs[i].getElementName();
+                if (elementName != null)
+                   namespace = "\"" + elementName.getNamespaceURI() + "\"";
+            }
             
             // if the attribute is a choice following should do
             boolean ifCheckPrinted = false;
@@ -537,15 +544,6 @@ public class BeanParamWriter extends Par
             else
             {
                 //if complex type
-                namespace = type.getName().getNamespaceURI();
-                
-                String elm = attribs[i].getParamNameAsSOAPString();
-                QName elementName = attribs[i].getElementName();
-                if (elementName != null)
-                   namespace = elementName.getNamespaceURI();
-
-                if (attribs[i].isReference())
-                    elm = attribs[i].getTypeName();
                 
                 String tab = "";
                 if (ifCheckPrinted)
@@ -556,8 +554,17 @@ public class BeanParamWriter extends Par
                     c_writer.write("\tif (param->" + 
attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n\t");
                 }
                 
+                String elm = attribs[i].getParamNameAsSOAPString();
+                if (attribs[i].isReference())
+                    elm = attribs[i].getTypeName();
+
                 if (attribs[i].getNsQualified())
                 {
+                    namespace = type.getName().getNamespaceURI();
+                    QName elementName = attribs[i].getElementName();
+                    if (elementName != null)
+                       namespace = elementName.getNamespaceURI();
+
                     c_writer.write("\tsPrefix = pSZ->getNamespacePrefix(\"" + 
namespace + "\", blnIsNewSubElemPrefix);\n");
                     c_writer.write(tab + "\tpSZ->serialize(\"<\", sPrefix, 
\":\", \"" + elm + "\", 0);\n");
                     c_writer.write(tab + "\tif (blnIsNewSubElemPrefix)\n");


Reply via email to