ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r391340 [1/3] - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: ./ cpp/ cpp/literal/
Date Tue, 04 Apr 2006 15:36:00 GMT
Author: dicka
Date: Tue Apr  4 08:35:58 2006
New Revision: 391340

URL: http://svn.apache.org/viewcvs?rev=391340&view=rev
Log:
AXISCPP-961

A number of important fixes are missing from WSDL2Ws for rpc/encoded WSDLs containing optional
and nillable elements.

I have taken this as an opportunity to consolidate some of the WSDL2Ws code where they are
otherwise identical for doc/literal and rpc/encoded WSDLs.

I have also included a fix to ensure response messages that are declared in the WSDL using
an anonymous complex type are also correctly processed.

Removed:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java?rev=391340&r1=391339&r2=391340&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/SourceWriterFactory.java
Tue Apr  4 08:35:58 2006
@@ -35,14 +35,14 @@
                 return new UndeploymentWriter(wscontext);
             case WrapperConstants.GENERATOR_BUILDSCRIPT :
                 return new BuildScriptWriter(wscontext);
+            case WrapperConstants.GENERATOR_PARAM_CPP_ALL :
+                return new org.apache.axis.wsdl.wsdl2ws.cpp.AllParamWriter(wscontext);
         }
         if ("rpc".equals(wscontext.getWrapInfo().getWrapperStyle()))
         {
             switch (generatorType)
             {
                 // C++
-                case WrapperConstants.GENERATOR_PARAM_CPP_ALL :
-                    return new org.apache.axis.wsdl.wsdl2ws.cpp.AllParamWriter(wscontext);
                 case WrapperConstants.GENERATOR_WRAPPER_CPP :
                     return new org.apache.axis.wsdl.wsdl2ws.cpp.WrapWriter(wscontext);
                 case WrapperConstants.GENERATOR_WRAPPER_HPP :
@@ -82,8 +82,6 @@
                 switch (generatorType)
                 {
                     // C++
-                    case WrapperConstants.GENERATOR_PARAM_CPP_ALL :
-                        return new org.apache.axis.wsdl.wsdl2ws.cpp.literal.AllParamWriter(wscontext);
                     case WrapperConstants.GENERATOR_WRAPPER_CPP :
                         return new org.apache.axis.wsdl.wsdl2ws.cpp.literal.WrapWriter(wscontext);
                     case WrapperConstants.GENERATOR_WRAPPER_HPP :

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java?rev=391340&r1=391339&r2=391340&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java Tue Apr  4
08:35:58 2006
@@ -774,6 +774,34 @@
                               Iterator AllTypes = symbolTable.getTypeIndex().values().iterator();
                           }
                       }
+                      Collection outputParameterTypes = method.getOutputParameterTypes();
+                      paramIterator = outputParameterTypes.iterator();
+                      while(paramIterator.hasNext())
+                      {
+                          ParameterInfo parameterInfo =(ParameterInfo)paramIterator.next();
+                          Type parameterType = parameterInfo.getType();
+                          if(parameterType.getName().equals(type.getQName()))
+                          {
+                              QName oldName = parameterType.getName();
+                              QName newTypeName = new QName(parameterType.getName().getNamespaceURI(),
parameterType.getName().getLocalPart().substring(1));
+                              
+                              Type innerClassType =  wsContext.getTypemap().getType(parameterType.getName());
+                              // innerClassType.setLanguageSpecificName(newTypeName);
+                              
+                              // First thing to do is to expose the type so it gets created.
+                              innerClassType.setLanguageSpecificName(newTypeName.getLocalPart().toString());
+                              
+                              // also have to set the QName becuase this is used in generating
the header info.
+                              innerClassType.setName(newTypeName);
+                              
+                              // The typemap we get back is a copy of the actual typemap
so we have to set the new value explicitly
+                              // firstly remove the old version
+                              wsContext.getTypemap().removeType(oldName);
+                              wsContext.getTypemap().addType(newTypeName, innerClassType);
+                              
+                              Iterator AllTypes = symbolTable.getTypeIndex().values().iterator();
+                          }
+                      }
                   }
                     
                 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java?rev=391340&r1=391339&r2=391340&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
Tue Apr  4 08:35:58 2006
@@ -56,57 +56,69 @@
             try
             {
                 type = (Type) types.next();
-                    if (type.isArray())
+                if (type.isArray())
+                {
+                    if (WSDL2Ws.verbose)
                     {
-                        if (WSDL2Ws.verbose)
-                        {
-                            System.out.println("Array writer called ......");
-                        }
-                        QName qname = type.getName();
-                        if (CUtils.isSimpleType(qname)
-                            && !CUtils.isDefinedSimpleType(qname))
-                        {
-                            throw new WrapperFault(
-                                "No need to create an Array for simple type "
-                                    + qname
-                                    + "\n"
-                                    + "It seems that some thing wrong with symbolTable population
- Susantha");
-                        }
-                        ArrayParamHeaderWriter writer =
-                            (new ArrayParamHeaderWriter(wscontext, type));
-                        if (!writer.isSimpleTypeArray())
-                        {
-                            writer.writeSource();
-                            (new ArrayParamWriter(wscontext, type)).writeSource();
-                        }
+                        System.out.println("Array writer called ......");
+                    }
+                    QName qname = type.getName();
+                    
+                    String elementType = type.getElementType();
+                    if (elementType != null)
+                    {
+                        elementType = elementType.replace('>', '_');
+                        QName elementQname = new QName(qname.getNamespaceURI(), elementType);
+                        
+                        Type currentType = wscontext.getTypemap().getType(elementQname);
+                        if (currentType != null)
+                            if ( currentType.isSimpleType())
+                                continue;
+                    }
+                    
+                    if (CUtils.isSimpleType(qname)
+                        && !CUtils.isDefinedSimpleType(qname))
+                    {
+                        throw new WrapperFault(
+                            "No need to create an Array for simple type "
+                                + qname
+                                + "\n"
+                                + "It seems that some thing wrong with symbolTable population
- Susantha");
+                    }
+                    ArrayParamHeaderWriter writer =
+                        (new ArrayParamHeaderWriter(wscontext, type));
+                    if (!writer.isSimpleTypeArray())
+                    {
+                        writer.writeSource();
+                        (new ArrayParamWriter(wscontext, type)).writeSource();
+                    }
+                }
+                else
+                {
+                    /* TODO check whether this type is referenced or not. Synthesize only
if  reference
+                     * But of cause that depends on the command line option too  */
+                    if (type.getLanguageSpecificName().startsWith(">"))
+                    {
+                        /* TODO do some processing to this type before synthesizing to remove
">" charactors.
+                         * And then it should also be synthesized if command line option
says to */
+                        if(WSDL2Ws.verbose)
+                            System.out.println(
+                                    "ignoring anonymous type " + type.getLanguageSpecificName()
+ "\n");
                     }
                     else
                     {
-                        /* TODO check whether this type is referenced or not. Synthesize
only if  reference
-                         * But of cause that depends on the command line option too  */
-                        if (type.getLanguageSpecificName().startsWith(">"))
+                        if (WSDL2Ws.verbose)
                         {
-                            /* TODO do some processing to this type before synthesizing to
remove ">" charactors.
-                             * And then it should also be synthesized if command line option
says to */
                             System.out.println(
-                                "ignoring anonymous type "
-                                    + type.getLanguageSpecificName()
-                                    + "\n");
-                        }
-                        else
-                        {
-                            if (WSDL2Ws.verbose)
-                            {
-                                System.out.println(
-                                    "struct writer called ......");
-                            }
-                            (new BeanParamWriter(wscontext, type))
-                                .writeSource();
-                            (new ParmHeaderFileWriter(wscontext, type))
-                                .writeSource();
+                                "struct writer called ......");
                         }
+                        (new BeanParamWriter(wscontext, type))
+                            .writeSource();
+                        (new ParmHeaderFileWriter(wscontext, type))
+                            .writeSource();
                     }
                 }
+            }
             catch (Exception e)
             {
                 System.out.println(



Mime
View raw message