axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r267191 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/clientapi/ wsdl/src/org/apache/axis2/wsdl/codegen/extension/ wsdl/src/org/apache/axis2/wsdl/template/java/
Date Fri, 02 Sep 2005 12:21:55 GMT
Author: ajith
Date: Fri Sep  2 05:21:34 2005
New Revision: 267191

URL: http://svn.apache.org/viewcvs?rev=267191&view=rev
Log:
1. Added a temporary hack to the databind supporter to build the objects straightaway. We
need this until we properly test the switching.
2.Added the support for the setting parameters to the call through the Stub.
3. Refactored the XMLBeans extension

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java?rev=267191&r1=267190&r2=267191&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/Stub.java Fri
Sep  2 05:21:34 2005
@@ -35,6 +35,9 @@
 import org.apache.wsdl.WSDLService;
 
 import javax.xml.stream.XMLStreamReader;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Iterator;
 
 
 /**
@@ -56,15 +59,46 @@
     protected String senderTransport = Constants.TRANSPORT_HTTP;
     protected String listenerTransport =Constants.TRANSPORT_HTTP ;
     protected boolean useSeparateListener;
-    //Default SOAP version
+
+    //Default SOAP version is 11
     protected int soapVesrion = SOAP_11;
+    protected HashMap propertyMap = new HashMap();
 
+    /**
+     *
+     * @param senderTransport
+     * @param listenerTransport
+     * @param useSeparateListener
+     * @throws AxisFault
+     */
     public void setTransportInfo(String senderTransport,String listenerTransport,boolean
useSeparateListener)throws AxisFault{
         this.senderTransport = senderTransport;
         this.listenerTransport=listenerTransport;
         this.useSeparateListener=useSeparateListener;
     }
 
+    /**
+     *
+     * @param key
+     * @param value
+     */
+    public void _put(String key,Object value){
+        this.propertyMap.put(key,value);
+    }
+
+
+    /**
+     *
+     * @param key
+     * @return the object
+     */
+    public Object _get(String key){
+        return this.propertyMap.get(key);
+    }
+    /**
+     *
+     * @param doRest
+     */
     public void setDoREST(boolean doRest) {
         this.doRest = doRest;
     }
@@ -262,6 +296,15 @@
             return OMAbstractFactory.getSOAP12Factory();
         }else{
             throw new RuntimeException("Unknown SOAP version");
+        }
+    }
+
+    protected void populateProperties(Call call){
+        Iterator keys = this.propertyMap.keySet().iterator();
+        String key;
+        while (keys.hasNext()) {
+            key = keys.next().toString();
+            call.set(key,propertyMap.get(key));
         }
     }
 }

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=267191&r1=267190&r2=267191&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
Fri Sep  2 05:21:34 2005
@@ -15,6 +15,7 @@
 
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.ParserConfigurationException;
 import java.io.*;
 import java.util.*;
 
@@ -145,11 +146,9 @@
 
         try {
             ArrayList additionalSchemaElements = new ArrayList();
+            DocumentBuilder documentBuilder = getNamespaceAwareDocumentBuilder();
             for (int i = 0; i < schemaNames.length; i++) {
                 InputStream schemaStream = this.getClass().getResourceAsStream("/org/apache/axis2/wsdl/codegen/schema/"+
schemaNames[i]);
-                DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-                documentBuilderFactory.setNamespaceAware(true);
-                DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
                 Document doc = documentBuilder.parse(schemaStream);
                 additionalSchemaElements.add(doc.getDocumentElement());
             }
@@ -166,6 +165,12 @@
         }
 
         return schemaElements;
+    }
+
+    private DocumentBuilder getNamespaceAwareDocumentBuilder() throws ParserConfigurationException
{
+        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+        documentBuilderFactory.setNamespaceAware(true);
+        return documentBuilderFactory.newDocumentBuilder();
     }
 
 

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=267191&r1=267190&r2=267191&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
Fri Sep  2 05:21:34 2005
@@ -93,6 +93,9 @@
  		    org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
             _call.setTo(this.toEPR);
             _call.setSoapAction("<xsl:value-of select="$soapAction"/>");
+
+             //set the properties
+            populateProperties(_call);
             org.apache.axis2.soap.SOAPEnvelope env = null;
             env = createEnvelope();
             <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
@@ -153,8 +156,6 @@
              _call.setExceptionToBeThrownOnSOAPFault(true);
              org.apache.axis2.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[<xsl:value-of
select="position()-1"/>], _messageContext);
              org.apache.axis2.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
-             //check for faults. This might throw an Axis fault
-             //checkFault(_returnEnv);
              java.lang.Object object = <xsl:value-of select="$fullsupporterclassname"/>.fromOM(getElement(_returnEnv,"<xsl:value-of
select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
              return (<xsl:value-of select="$outputtype"/>)object;
                  </xsl:otherwise>

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl?rev=267191&r1=267190&r2=267191&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/XMLBeansSupporterTemplate.xsl
Fri Sep  2 05:21:34 2005
@@ -16,6 +16,10 @@
                     <xsl:for-each select="param">
                     <xsl:if test="@type!=''">
                     if (<xsl:value-of select="@type"/>.class.equals(type)){
+                        //////////////////////////////////////////////////
+                        /////////// Temporary hack to solve some streaming problems
+                        param.build();
+                        /////////////////////////////////////////////////
                         return <xsl:value-of select="@type"/>.Factory.parse(param.getXMLStreamReader())
;
                     }
                      </xsl:if>



Mime
View raw message