axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r384068 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
Date Wed, 08 Mar 2006 00:32:51 GMT
Author: ajith
Date: Tue Mar  7 16:32:49 2006
New Revision: 384068

URL: http://svn.apache.org/viewcvs?rev=384068&view=rev
Log:
1. fixed the namespace for the nil case
2. fixed a minor issue in codegen where the bindings were not properly populated when wsdl's
were imported

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java
    webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java?rev=384068&r1=384067&r2=384068&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ADBPullParser.java
Tue Mar  7 16:32:49 2006
@@ -4,6 +4,8 @@
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMAttribute;
 import org.apache.ws.commons.om.OMElement;
+import org.apache.ws.commons.om.OMFactory;
+import org.apache.ws.commons.om.OMNamespace;
 import org.apache.ws.commons.om.impl.llom.EmptyOMLocation;
 
 import javax.xml.namespace.NamespaceContext;
@@ -112,7 +114,7 @@
      * remove them from the namespace map, after the end element.
      */
     private HashMap namespaceMap;
-    private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance","nil");
+    private static final QName NIL_QNAME = new QName("http://www.w3.org/2001/XMLSchema-instance","nil","xsi");
 
 
     private ADBPullParser(QName adbBeansQName, Object[] properties, Object[] attributes)
{
@@ -305,8 +307,14 @@
                     eventType = processADBNameValuePair((QName) o, (String) object);
                     return eventType;
                 } else if (object == null) {
-                    OMElement omElement = OMAbstractFactory.getOMFactory().createOMElement((QName)
o, null);
-                    omElement.addAttribute("nil", "true", null);
+                    OMFactory omFactory = OMAbstractFactory.getOMFactory();
+                    OMElement omElement = omFactory.createOMElement((QName) o, null);
+                    OMNamespace omNamespace = omFactory.createOMNamespace(NIL_QNAME.getNamespaceURI(),
+                            NIL_QNAME.getPrefix());
+                    omElement.declareNamespace(omNamespace);
+                    omElement.addAttribute(NIL_QNAME.getLocalPart(),
+                            "true",
+                            omNamespace);
                     childPullParser = omElement.getXMLStreamReader();
 
                     // here we are injecting one additional element. So need to accomodate
that.

Modified: webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java?rev=384068&r1=384067&r2=384068&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/test/org/apache/axis2/databinding/utils/ADBPullParserTest.java
Tue Mar  7 16:32:49 2006
@@ -108,7 +108,8 @@
             This is what I expect :
 
             */
-            String exptectedXML = "<Person xmlns=\"\"><Name xmlns=\"\">FooOne</Name><DependentOne
xmlns=\"\" nil=\"true\" />" +
+            String exptectedXML = "<Person xmlns=\"\"><Name xmlns=\"\">FooOne</Name><DependentOne
xmlns=\"\" " +
+                    "xsi:nil=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"
+
                     "</Person>";
 
             ArrayList propertyList = new ArrayList();

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java?rev=384068&r1=384067&r2=384068&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
Tue Mar  7 16:32:49 2006
@@ -365,6 +365,10 @@
                             Map porttypeMap = importedDef.getPortTypes();
                             wsdl4JDefinition.getPortTypes().putAll(porttypeMap);
 
+                            //add bindings
+                            Map bindingMap = importedDef.getBindings();
+                            wsdl4JDefinition.getBindings().putAll(bindingMap);
+
                         }
 
                     }
@@ -1179,14 +1183,14 @@
             if (wsdl4jElement instanceof UnknownExtensibilityElement) {
                 UnknownExtensibilityElement unknown = (UnknownExtensibilityElement) (wsdl4jElement);
 
-//look for the SOAP 1.2 stuff here. WSDL4j does not understand SOAP 1.2 things
+                //look for the SOAP 1.2 stuff here. WSDL4j does not understand SOAP 1.2 things
                 if (ExtensionConstants.SOAP_12_OPERATION.equals(unknown.getElementType())){
                     org.apache.wsdl.extensions.SOAPOperation soapOperationExtensibiltyElement
= (org.apache.wsdl.extensions.SOAPOperation) extensionFactory
                             .getExtensionElement(wsdl4jElement.getElementType());
                     Element element = unknown.getElement();
                     soapOperationExtensibiltyElement.setSoapAction(element.getAttribute("soapAction"));
                     soapOperationExtensibiltyElement.setStyle(element.getAttribute("style"));
-// soapActionRequired
+                // soapActionRequired
                     component.addExtensibilityElement(soapOperationExtensibiltyElement);
                 }else if (ExtensionConstants.SOAP_12_BODY.equals(unknown.getElementType())){
                     org.apache.wsdl.extensions.SOAPBody soapBodyExtensibiltyElement = (org.apache.wsdl.extensions.SOAPBody)
extensionFactory
@@ -1194,7 +1198,7 @@
                     Element element = unknown.getElement();
                     soapBodyExtensibiltyElement.setUse(element.getAttribute("use"));
                     soapBodyExtensibiltyElement.setNamespaceURI(element.getAttribute("namespace"));
-//encoding style
+                    //encoding style
                     component.addExtensibilityElement(soapBodyExtensibiltyElement);
                 }else if (ExtensionConstants.SOAP_12_HEADER.equals(unknown.getElementType())){
                     org.apache.wsdl.extensions.SOAPHeader soapHeaderExtensibilityElement
= (org.apache.wsdl.extensions.SOAPHeader) extensionFactory.getExtensionElement(



Mime
View raw message