axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r178576 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/clientapi/ wsdl/src/org/apache/axis/wsdl/codegen/emitter/ wsdl/src/org/apache/axis/wsdl/databinding/ wsdl/src/org/apache/axis/wsdl/template/java/ xml/src/org/apache/axis/soap/impl/llom/builder/
Date Thu, 26 May 2005 04:03:35 GMT
Author: ajith
Date: Wed May 25 21:03:33 2005
New Revision: 178576

URL: http://svn.apache.org/viewcvs?rev=178576&view=rev
Log:
Added basic databinding to the stubs. Now for Java code the generated stubs will support String,Integer,Float
and Double. OMElement will be used in any other case.
Testcases has been amended to produce correct objects

Added:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/StubSupporter.java
Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/TestClassTemplate.xsl
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/Stub.java Wed May
25 21:03:33 2005
@@ -1,18 +1,18 @@
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2001-2004 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
 package org.apache.axis.clientapi;
 
@@ -25,86 +25,139 @@
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.om.OMAbstractFactory;
 import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
 import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPBody;
+import org.apache.axis.soap.SOAPFactory;
+import org.apache.wsdl.WSDLService;
+
+
 
 /**
  * @author chathura@opensource.lk
  *
  */
 public abstract class Stub {
-	
-	protected ConfigurationContext _configurationContext;
-	protected static ServiceDescription _service;
-	protected ServiceContext _serviceContext;
+
+    protected ConfigurationContext _configurationContext;
+    protected static ServiceDescription _service;
+    protected ServiceContext _serviceContext;
     protected EndpointReference toEPR ;
 
 
 
-	/**
-	 * If _maintainSession is set to True all the calls will use the same 
-	 * ServiceContext and the user can Share information through that 
-	 * ServiceContext across operations.
-	 */
-	protected boolean _maintainSession = false;
-	protected String _currentSessionId = null;
-	
-	
-	protected Stub()throws DeploymentException, AxisFault{
+    /**
+     * If _maintainSession is set to True all the calls will use the same
+     * ServiceContext and the user can Share information through that
+     * ServiceContext across operations.
+     */
+    protected boolean _maintainSession = false;
+    protected String _currentSessionId = null;
+
+
+    protected Stub()throws DeploymentException, AxisFault{
+
+    }
 
-	}
-	
 //	public abstract void _setSessionInfo(Object key, Object value) throws Exception;
 //
 //	public abstract Object _getSessionInfo(Object key) throws Exception ;
 
-     public void _setSessionInfo(String key, Object value)throws java.lang.Exception{
-		if(!_maintainSession){
-			//TODO Comeup with a Exception
-			throw new java.lang.Exception("Client is running the session OFF mode: Start session before
saving to a session ");
-		}
-		_configurationContext.getServiceContext(_currentSessionId).setProperty(key, value);
-	}
-
-
-	public Object _getSessionInfo(String key) throws java.lang.Exception{
-		if(!_maintainSession){
-			//TODO Comeup with a Exception
-			throw new java.lang.Exception("Client is running the session OFF mode: Start session before
saving to a session ");
-		}
-		return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
-	}
-
-	public void _startSession(){
-		_maintainSession = true;
-		_currentSessionId = getID() ;
-	}
-	
-	public void _endSession(){
-		_maintainSession = false;
-	}
-	
-	protected String _getServiceContextID(){
-		if(_maintainSession)
-			return _currentSessionId;
-		else
-			return getID();
-	}
-	
-	private String getID(){
-		//TODO Get the UUID generator to generate values
-		return Long.toString(System.currentTimeMillis());
-	}
-
-    protected SOAPEnvelope createEnvelope(OMElement omElement){
-        SOAPEnvelope env = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope();
-        env.getBody().addChild(omElement);
+    public void _setSessionInfo(String key, Object value)throws java.lang.Exception{
+        if(!_maintainSession){
+            //TODO Comeup with a Exception
+            throw new java.lang.Exception("Client is running the session OFF mode: Start
session before saving to a session ");
+        }
+        _configurationContext.getServiceContext(_currentSessionId).setProperty(key, value);
+    }
+
+
+    public Object _getSessionInfo(String key) throws java.lang.Exception{
+        if(!_maintainSession){
+            //TODO Comeup with a Exception
+            throw new java.lang.Exception("Client is running the session OFF mode: Start
session before saving to a session ");
+        }
+        return _configurationContext.getServiceContext(_currentSessionId).getProperty(key);
+    }
+
+    public void _startSession(){
+        _maintainSession = true;
+        _currentSessionId = getID() ;
+    }
+
+    public void _endSession(){
+        _maintainSession = false;
+    }
+
+    protected String _getServiceContextID(){
+        if(_maintainSession)
+            return _currentSessionId;
+        else
+            return getID();
+    }
+
+    private String getID(){
+        //TODO Get the UUID generator to generate values
+        return Long.toString(System.currentTimeMillis());
+    }
+
+    //todo make this compliant with the SOAP12
+    protected SOAPEnvelope createEnvelope(){
+        SOAPEnvelope env = getFactory().getDefaultEnvelope();
         return env;
     }
-     /**
+
+    protected void setValueRPC(SOAPEnvelope env,String methodNamespaceURI,String methodName,String[]
paramNames,Object[] values){
+        SOAPBody body = env.getBody();
+        OMFactory fac = this.getFactory();
+
+        OMNamespace methodNamespace = fac.createOMNamespace(methodNamespaceURI,"ns1");
+        OMElement elt =  fac.createOMElement(methodName,methodNamespace);
+        if (paramNames!=null){
+        //find the relevant object here, convert it and add it to the elt
+        for (int i = 0; i < paramNames.length; i++) {
+            String paramName = paramNames[i];
+            Object value  = values[i];
+            elt.addChild(StubSupporter.createRPCMappedElement(paramName,
+                    fac.createOMNamespace("",null),//empty namespace
+                    value,
+                    fac));
+        }
+        }
+        body.addChild(elt);
+    }
+
+
+    protected void setValueDOC(SOAPEnvelope env,OMElement value){
+        SOAPBody body = env.getBody();
+        body.addChild(value);
+    }
+
+
+    protected Object getValue(SOAPEnvelope env,String type,Class outputType){
+        SOAPBody body = env.getBody();
+        OMElement element = body.getFirstElement();
+
+        if (WSDLService.STYLE_RPC.equals(type)){
+            return StubSupporter.getRPCMappedElementValue(element.getFirstElement(),outputType);
+        }else if (WSDLService.STYLE_DOC.equals(type)){
+            return element;
+        }else {
+            throw new UnsupportedOperationException("Unsupported type");
+        }
+
+    }
+    /**
      * get the message context
      */
     protected MessageContext getMessageContext() throws AxisFault {
             return new MessageContext(_configurationContext);
+    }
+
+
+    private SOAPFactory getFactory(){
+        return OMAbstractFactory.getSOAP11Factory();
     }
 }
 

Added: webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/StubSupporter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/StubSupporter.java?rev=178576&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/StubSupporter.java
(added)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/clientapi/StubSupporter.java
Wed May 25 21:03:33 2005
@@ -0,0 +1,70 @@
+package org.apache.axis.clientapi;
+
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMElement;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *  A utility class for the use of the stub
+ *  Not visible outside
+ */
+class StubSupporter {
+
+    public static OMElement createRPCMappedElement(String elementName,OMNamespace ns,Object
value, OMFactory fac){
+       OMElement returnElement = fac.createOMElement(elementName,ns);
+       Class inputParamClass = value.getClass();
+
+       if (inputParamClass.equals(String.class)){
+           returnElement.addChild(fac.createText(returnElement,value.toString()));
+       }else if (inputParamClass.equals(Integer.class)){
+            returnElement.addChild(fac.createText(returnElement,String.valueOf(((Integer)value).intValue())));
+       }else if (inputParamClass.equals(Float.class)){
+            returnElement.addChild(fac.createText(returnElement,String.valueOf(((Float)value).floatValue())));
+       }else if (inputParamClass.equals(Double.class)){
+            returnElement.addChild(fac.createText(returnElement,String.valueOf(((Double)value).doubleValue())));
+       //todo this seems to be a long list... needs to complete this
+       }else if (inputParamClass.equals(OMElement.class)){
+           returnElement.addChild((OMElement)value);
+       }else{
+           returnElement.addChild(fac.createText(returnElement,value.toString()));
+       }
+        return returnElement;
+    }
+
+    public static Object getRPCMappedElementValue(OMElement elt, Class outputTypeClass){
+       Object outputObj = null;
+       if (outputTypeClass.equals(String.class)){
+           outputObj = elt.getText();
+       }else if (outputTypeClass.equals(Integer.class)){
+            outputObj = new Integer(elt.getText());
+       }else if (outputTypeClass.equals(Float.class)){
+            outputObj = new Float(elt.getText());
+       }else if (outputTypeClass.equals(Double.class)){
+            outputObj = new Double(elt.getText());
+
+       //todo this seems to be a long list... needs to complete this
+
+       }else if (outputTypeClass.equals(OMElement.class)){
+           outputObj = elt;
+       }else{
+           outputObj = elt.toString();
+       }
+
+        return outputObj;
+    }
+
+}

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/codegen/emitter/JavaEmitter.java
Wed May 25 21:03:33 2005
@@ -40,7 +40,7 @@
      */
     public JavaEmitter(CodeGenConfiguration configuration) {
         this.configuration = configuration;
-        this.mapper = new DefaultTypeMapper();
+        this.mapper = new JavaTypeMapper();
 
     }
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/databinding/TypeMappingAdapter.java
Wed May 25 21:03:33 2005
@@ -1,5 +1,7 @@
 package org.apache.axis.wsdl.databinding;
 
+import org.apache.axis.om.OMElement;
+
 import javax.xml.namespace.QName;
 import java.util.HashMap;
 
@@ -39,7 +41,7 @@
             if (o!=null){
                return (Class)o;
             }else{
-                return Object.class;
+                return OMElement.class;
             }
         }
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/InterfaceImplementationTemplate.xsl
Wed May 25 21:03:33 2005
@@ -39,7 +39,7 @@
 
            this.toEPR = new org.apache.axis.addressing.EndpointReference(org.apache.axis.addressing.AddressingConstants.WSA_TO,targetEndpoint);
 		    //creating the configuration
-           _configurationContext = new org.apache.axis.context.EngineContextFactory().buildClientEngineContext(axis2Home);
+           _configurationContext = new org.apache.axis.context.ConfigurationContextFactory().buildClientEngineContext(axis2Home);
             _configurationContext.getEngineConfig().addService(_service);
            _serviceContext = _configurationContext.createServiceContext(_service.getName());
 
@@ -72,17 +72,38 @@
 		    org.apache.axis.clientapi.Call _call = new org.apache.axis.clientapi.Call(_serviceContext);
  		    org.apache.axis.context.MessageContext _messageContext = getMessageContext();
             _call.setTo(toEPR);
-            _messageContext.setEnvelope(createEnvelope(<xsl:value-of select="$inputparam"></xsl:value-of>));
-
-            <xsl:if test="$outputtype=''">
-             _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>],
_messageContext);
-             return;
-            </xsl:if>
-             <xsl:if test="$outputtype!=''">
+            org.apache.axis.soap.SOAPEnvelope env = null;
+            env = createEnvelope();
+             <xsl:choose>
+              <xsl:when test="$inputtype!=''">
+                setValueRPC(env,
+                            "<xsl:value-of select="@namespace"/>",
+                            "<xsl:value-of select="@name"/>",
+                            new String[]{"<xsl:value-of select="$inputparam"/>"},
+                            new Object[]{<xsl:value-of select="$inputparam"/>});  
  //fix this - code is RPC only
+              </xsl:when>
+              <xsl:otherwise>
+               setValueRPC(env,
+                            "<xsl:value-of select="@namespace"/>",
+                            "<xsl:value-of select="@name"/>",
+                            null,
+                            null);     //fix this - code is RPC only
+             </xsl:otherwise>
+            </xsl:choose>
+             _messageContext.setEnvelope(env);
+             <xsl:choose>
+                 <xsl:when test="$outputtype=''">
+                    _call.invokeBlocking(_operations[<xsl:value-of select="position()-1"/>],
_messageContext);
+                    return;
+                 </xsl:when>
+                 <xsl:otherwise>
              org.apache.axis.context.MessageContext  _returnMessageContext = _call.invokeBlocking(_operations[<xsl:value-of
select="position()-1"/>], _messageContext);
              org.apache.axis.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
-             return (<xsl:value-of select="$outputtype"/>)_returnEnv.getBody().getFirstElement();
-            </xsl:if>
+             <!-- todo this needs to be fixed -->
+             return (<xsl:value-of select="$outputtype"/>)getValue(_returnEnv,"rpc",<xsl:value-of
select="$outputtype"/>.class);
+                 </xsl:otherwise>
+             </xsl:choose>
+
             <!-- this needs to be changed -->
         }
         </xsl:if>
@@ -93,11 +114,30 @@
          *<xsl:if test="$inputtype!=''">@param <xsl:value-of select="$inputparam"></xsl:value-of></xsl:if>
          */
         public  void start<xsl:value-of select="@name"/>(<xsl:if test="$inputtype!=''"><xsl:value-of
select="$inputtype"/><xsl:text> </xsl:text><xsl:value-of select="$inputparam"></xsl:value-of>,</xsl:if>final
<xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback)
throws java.rmi.RemoteException{
-                org.apache.axis.clientapi.Call _call = new org.apache.axis.clientapi.Call(_serviceContext);<!--
this needs to change -->
- 		        org.apache.axis.context.MessageContext _messageContext = getMessageContext();
-                _call.setTo(toEPR);
-                _messageContext.setEnvelope(createEnvelope(<xsl:value-of select="$inputparam"/>));
-		        _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>],
_messageContext, new org.apache.axis.clientapi.Callback(){
+             org.apache.axis.clientapi.Call _call = new org.apache.axis.clientapi.Call(_serviceContext);<!--
this needs to change -->
+ 		     org.apache.axis.context.MessageContext _messageContext = getMessageContext();
+             _call.setTo(toEPR);
+             org.apache.axis.soap.SOAPEnvelope env = null;
+             <xsl:choose>
+              <xsl:when test="$inputtype!=''">
+                env = createEnvelope();
+                setValueRPC(env,
+                            "<xsl:value-of select="@namespace"/>",
+                            "<xsl:value-of select="@name"/>",
+                            new String[]{"<xsl:value-of select="$inputparam"/>"},
+                            new Object[]{<xsl:value-of select="$inputparam"/>});
+              </xsl:when>
+              <xsl:otherwise>
+                env = createEnvelope();
+                setValueRPC(env,
+                            "<xsl:value-of select="@namespace"/>",
+                            "<xsl:value-of select="@name"/>",
+                            null,
+                            null);
+             </xsl:otherwise>
+            </xsl:choose>
+             _messageContext.setEnvelope(env);
+		      _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>],
_messageContext, new org.apache.axis.clientapi.Callback(){
                    public void onComplete(org.apache.axis.clientapi.AsyncResult result){
                          callback.receiveResult<xsl:value-of select="@name"/>(result);
                    }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/TestClassTemplate.xsl?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/TestClassTemplate.xsl
(original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/template/java/TestClassTemplate.xsl
Wed May 25 21:03:33 2005
@@ -17,7 +17,9 @@
 
 
      <xsl:for-each select="method">
-
+         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+         <xsl:variable name="inputtype"><xsl:value-of select="input/param/@type"></xsl:value-of></xsl:variable>
 <!-- this needs to change-->
+         <xsl:variable name="inputparam"><xsl:value-of select="input/param/@name"></xsl:value-of></xsl:variable>
 <!-- this needs to change-->
          <xsl:if test="$isSync='1'">
 
         /**
@@ -26,7 +28,16 @@
         public  void test<xsl:value-of select="@name"/>() throws java.lang.Exception{
 
         <xsl:value-of select="$stubname"/> stub = new <xsl:value-of select="$package"/>.<xsl:value-of
select="$stubname"/>();
-         assertNotNull(stub.<xsl:value-of select="@name"/>(getRPCStyleChildElement("<xsl:value-of
select="@namespace"/>","<xsl:value-of select="@name"/>")));
+           <xsl:choose>
+             <xsl:when test="$inputtype!=''">
+               assertNotNull(stub.<xsl:value-of select="@name"/>(
+                                (<xsl:value-of select="$inputtype"/>)createTestInput(<xsl:value-of
select="$inputtype"/>.class)));//this should come as a type
+              </xsl:when>
+              <xsl:otherwise>
+                assertNotNull(stub.<xsl:value-of select="@name"/>());
+             </xsl:otherwise>
+            </xsl:choose>
+
 
 
         }
@@ -38,10 +49,21 @@
          */
         public  void testStart<xsl:value-of select="@name"/>() throws java.lang.Exception{
             <xsl:value-of select="$stubname"/> stub = new <xsl:value-of select="$package"/>.<xsl:value-of
select="$stubname"/>();
-            stub.start<xsl:value-of select="@name"/>(
-                    getRPCStyleChildElement("<xsl:value-of select="@namespace"/>","<xsl:value-of
select="@name"/>"),
+             <xsl:choose>
+             <xsl:when test="$inputtype!=''">
+                stub.start<xsl:value-of select="@name"/>(
+                   (<xsl:value-of select="$inputtype"/>)createTestInput(<xsl:value-of
select="$inputtype"/>.class),
+                    new <xsl:value-of select="$tempCallbackName"/>()
+                );
+              </xsl:when>
+              <xsl:otherwise>
+                stub.start<xsl:value-of select="@name"/>(
                     new <xsl:value-of select="$tempCallbackName"/>()
-            );
+                );
+             </xsl:otherwise>
+            </xsl:choose>
+
+
         }
 
         private class <xsl:value-of select="$tempCallbackName"/>  extends <xsl:value-of
select="$package"/>.<xsl:value-of select="$callbackname"/>{
@@ -59,21 +81,25 @@
       </xsl:if>
      </xsl:for-each>
 
-       private org.apache.axis.om.OMElement getRPCStyleChildElement(String methodNamespaceURI,String
methodName){
-         org.apache.axis.om.OMFactory omFactory = org.apache.axis.om.OMAbstractFactory.getOMFactory();
-         org.apache.axis.om.OMNamespace ns = omFactory.createOMNamespace(methodNamespaceURI,"ns");
-         org.apache.axis.om.OMNamespace emptyNS = omFactory.createOMNamespace("",null);
-         org.apache.axis.om.OMNamespace soapEnvNs = omFactory.createOMNamespace(
-                org.apache.axis.soap.impl.llom.soap11.SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
-                org.apache.axis.soap.impl.llom.soap11.SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX)
;
-        org.apache.axis.om.OMElement rootElt =  omFactory.createOMElement(methodName,ns);
-        rootElt.declareNamespace(soapEnvNs);
-        rootElt.addAttribute("encodingStyle","http://schemas.xmlsoap.org/soap/encoding/",soapEnvNs);
 
-        //have to add the parameters here
+     public static Object createTestInput(Class paramClass){
 
-        return rootElt;
+       if (paramClass.equals(String.class)){
+           return new String("Test");
+       }else if (paramClass.equals(Integer.class)){
+            return new Integer(1);
+       }else if (paramClass.equals(Float.class)){
+           return new Float(2);
+       }else if (paramClass.equals(Double.class)){
+           return new Double(3);
+       //todo this seems to be a long list... needs to complete this
+       //}else if (paramClass.equals(OMElement.class)){
+       //  return null;
+       }else{
+         return new Object();
        }
+
+    }
     }
     </xsl:template>
  </xsl:stylesheet>

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java?rev=178576&r1=178575&r2=178576&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
Wed May 25 21:03:33 2005
@@ -260,14 +260,14 @@
             switch (token) {
                 case XMLStreamConstants.START_ELEMENT:
                     elementLevel++;
-                    System.out.println("Start ==> "+parser.getLocalName());
+                   // System.out.println("Start ==> "+parser.getLocalName());
                     lastNode = createOMElement();
                     break;
                 case XMLStreamConstants.CHARACTERS:
                     lastNode = createOMText();
                     break;
                 case XMLStreamConstants.END_ELEMENT:
-                    System.out.println("End ==> "+parser.getLocalName());
+                   //System.out.println("End ==> "+parser.getLocalName());
 
                     if (lastNode.isComplete()) {
                         OMElement parent = lastNode.getParent();



Mime
View raw message