Author: scamp
Date: Thu Apr 14 09:19:23 2005
New Revision: 161315

URL: http://svn.apache.org/viewcvs?view=rev&rev=161315
Log:
Updated for issues Apollo-10 and Apollo-21

Modified:
    incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java
    
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/GenerationUtils.java
    incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
    incubator/apollo/trunk/src/java/org/apache/ws/util/OperationInfo.java
    incubator/apollo/trunk/src/templates/Service.vm

Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java?view=diff&r1=161314&r2=161315
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java 
(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/i18n/Keys.java Thu 
Apr 14 09:19:23 2005
@@ -582,4 +582,9 @@
      * @msg  for Dialect:
      */
     String FOR_DIALECT = "FOR_DIALECT";
+
+    /**
+     * @msg Wsdl2Java expects the WSDL files to have the extension .wsdl the 
passed-in file was named: {0}
+     */
+    String ERROR_ONLY_WSDLS = "ERROR_ONLY_WSDLS";
 }

Modified: 
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/GenerationUtils.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/GenerationUtils.java?view=diff&r1=161314&r2=161315
==============================================================================
--- 
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/GenerationUtils.java
 (original)
+++ 
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/GenerationUtils.java
 Thu Apr 14 09:19:23 2005
@@ -111,7 +111,7 @@
         for ( int i = 0; i < opNames.length; i++ )
         {
             Operation op = resourceDef.getPortType().getOperation( opNames[i], 
null, null );
-            OperationInfo opInfo = new OperationInfo( op );
+            OperationInfo opInfo = new OperationInfo( op );            
             opInfoMap.put( opInfo.getRequestElementName(), opInfo );
         }
         return opInfoMap;

Modified: 
incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java?view=diff&r1=161314&r2=161315
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java 
(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/resource/tool/Wsdl2Java.java 
Thu Apr 14 09:19:23 2005
@@ -103,6 +103,15 @@
         {
             System.out.println( MSG.getMessage( Keys.WARN_EMPTY_WSDLS ) );
         }
+        for (int i = 0; i < wsdlFiles.length; i++)
+        {
+            File wsdlFile = wsdlFiles[i];
+            if(!wsdlFile.getName().endsWith(".wsdl"))
+            {
+                System.out.println(MSG.getMessage( Keys.ERROR_ONLY_WSDLS , 
wsdlFile.getName()));
+                System.exit(0);
+            }
+        }
         m_outputDir = outputDir;
         m_xmlbeansDir = new File( m_outputDir, ".xmlbeans" );
         m_classpath = classpathFiles;

Modified: incubator/apollo/trunk/src/java/org/apache/ws/util/OperationInfo.java
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/util/OperationInfo.java?view=diff&r1=161314&r2=161315
==============================================================================
--- incubator/apollo/trunk/src/java/org/apache/ws/util/OperationInfo.java 
(original)
+++ incubator/apollo/trunk/src/java/org/apache/ws/util/OperationInfo.java Thu 
Apr 14 09:19:23 2005
@@ -35,13 +35,16 @@
     private String m_methodName;
     private String m_methodSig;
     private QName m_requestElemName;
+    private Map m_faults;
+    private String m_fullyQualifiedResponseClassName;
+    private String m_fullyQualifiedRequestClassName;
 
 
     public OperationInfo( Operation op )
     {
         m_methodName = StringUtils.capitalize( op.getName() );
         Input input = op.getInput();
-        String requestClassName;
+
         if ( input != null )
         {
             Map inputParts = input.getMessage().getParts();
@@ -51,14 +54,13 @@
             }
             Part inputPart = (Part) inputParts.values().iterator().next();
             m_requestElemName = inputPart.getElementName();
-            requestClassName = 
XmlBeanNameUtils.getDocumentElementXmlBeanClassName( m_requestElemName );
+            m_fullyQualifiedRequestClassName = 
XmlBeanNameUtils.getDocumentElementXmlBeanClassName( m_requestElemName );
         }
         else
         {
-            requestClassName = "";
+            m_fullyQualifiedRequestClassName = "";
         }
         Output output = op.getOutput();
-        String responseClassName;
         if ( output != null )
         {
             Map outputParts = output.getMessage().getParts();
@@ -67,13 +69,15 @@
                 throw new RuntimeException( "Wsdl output element should have 
exactly one part." );
             }
             Part outputPart = (Part) outputParts.values().iterator().next();
-            responseClassName = 
XmlBeanNameUtils.getDocumentElementXmlBeanClassName( 
outputPart.getElementName() );
+            m_fullyQualifiedResponseClassName = 
XmlBeanNameUtils.getDocumentElementXmlBeanClassName( 
outputPart.getElementName() );
         }
         else
         {
-            responseClassName = void.class.getName();
+            m_fullyQualifiedResponseClassName = void.class.getName();
         }
-        m_methodSig = responseClassName + " " + m_methodName + "( " + 
requestClassName + " requestDoc )";
+        m_methodSig = m_fullyQualifiedResponseClassName + " " + m_methodName + 
"( " + m_fullyQualifiedRequestClassName + " requestDoc )";
+
+        m_faults = op.getFaults();
     }
 
     public String getJavaMethodName()
@@ -89,5 +93,50 @@
     public QName getRequestElementName()
     {
         return m_requestElemName;
+    }
+
+    public Map getFaults()
+    {
+        return m_faults;
+    }
+
+    public String getFullyQualifiedResponseClassName()
+    {
+        return m_fullyQualifiedResponseClassName;
+    }
+
+    public String getFullyQualifiedRequestClassName()
+    {
+        return m_fullyQualifiedRequestClassName;
+    }
+
+    /**
+     * Returns the class name without the package
+     *
+     * @return Class name without the package
+     */
+    public String getUnqualifiedResponseClassName()
+    {
+        return 
m_fullyQualifiedResponseClassName.substring(m_fullyQualifiedResponseClassName.lastIndexOf(".")
 + 1);
+    }
+
+    /**
+     * Returns the class name without the package
+     *
+     * @return  class name without the package
+     */
+    public String getUnqualifiedRequestClassName()
+    {
+        return 
m_fullyQualifiedRequestClassName.substring(m_fullyQualifiedRequestClassName.lastIndexOf(".")
 + 1);
+    }
+
+    public String getUnqualifiedResponseTypeName()
+    {
+        return  getUnqualifiedResponseClassName().substring(0, 
getUnqualifiedResponseClassName().lastIndexOf("Document"));
+    }
+
+    public String getUnqualifiedRequestTypeName()
+    {
+       return getUnqualifiedRequestClassName().substring(0, 
getUnqualifiedRequestClassName().lastIndexOf("Document"));
     }
 }

Modified: incubator/apollo/trunk/src/templates/Service.vm
URL: 
http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/templates/Service.vm?view=diff&r1=161314&r2=161315
==============================================================================
--- incubator/apollo/trunk/src/templates/Service.vm (original)
+++ incubator/apollo/trunk/src/templates/Service.vm Thu Apr 14 09:19:23 2005
@@ -51,9 +51,12 @@
    
    public $customMethodList.get($key).JavaMethodSignature
    {              
-       //TODO implement  
-       return null;
+       ${customMethodList.get($key).FullyQualifiedResponseClassName} 
responseDocument = 
${customMethodList.get($key).FullyQualifiedResponseClassName}.Factory.newInstance();
   
+       
${customMethodList.get($key).FullyQualifiedResponseClassName}.${customMethodList.get($key).UnqualifiedResponseTypeName}
  response = 
responseDocument.addNew${customMethodList.get($key).UnqualifiedResponseTypeName}();
+       //TODO implement method and populate the response object 
+       return responseDocument;
    }
+   
    
    #end   
    



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to