axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal WrapHeaderWriter.java
Date Thu, 04 Nov 2004 17:01:04 GMT
dicka       2004/11/04 09:01:04

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        WrapHeaderWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        WrapHeaderWriter.java
  Log:
  Re-aligning inheritance tree and pulling up duplicate methods, to reduce code duplication
in WSDL2Ws tool.
  
  Submitted by: Adrian Dick
  
  Revision  Changes    Path
  1.24      +4 -2      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapHeaderWriter.java
  
  Index: WrapHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapHeaderWriter.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- WrapHeaderWriter.java	4 Nov 2004 16:22:34 -0000	1.23
  +++ WrapHeaderWriter.java	4 Nov 2004 17:01:03 -0000	1.24
  @@ -34,7 +34,8 @@
   
   public class WrapHeaderWriter extends HeaderFileWriter
   {
  -    private ArrayList methods;
  +	protected String bindingStyle;
  +    protected ArrayList methods;
       public WrapHeaderWriter(WebServiceContext wscontext) throws WrapperFault
       {
           super(
  @@ -43,6 +44,7 @@
                       + CUtils.WRAPPER_NAME_APPENDER));
           this.wscontext = wscontext;
           this.methods = wscontext.getSerInfo().getMethods();
  +        this.bindingStyle = "RPC_ENCODED";
       }
   
       protected void writeClassComment() throws WrapperFault
  @@ -106,7 +108,7 @@
               writer.write("\tint AXISCALL init();\n");
               writer.write("\tint AXISCALL fini();\n");
               writer.write(
  -                "\tAXIS_BINDING_STYLE AXISCALL getBindingStyle(){return RPC_ENCODED;};\n");
  +                "\tAXIS_BINDING_STYLE AXISCALL getBindingStyle(){return "+bindingStyle+";};\n");
               writer.write(
                   "private:/*Methods corresponding to the web service methods*/\n");
               MethodInfo minfo;
  
  
  
  1.20      +4 -177    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapHeaderWriter.java
  
  Index: WrapHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapHeaderWriter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- WrapHeaderWriter.java	4 Nov 2004 16:22:35 -0000	1.19
  +++ WrapHeaderWriter.java	4 Nov 2004 17:01:03 -0000	1.20
  @@ -21,188 +21,15 @@
   
   package org.apache.axis.wsdl.wsdl2ws.cpp.literal;
   
  -import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
  -
  -import org.apache.axis.wsdl.wsdl2ws.CUtils;
   import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
  -import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
  -import org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter;
  -import org.apache.axis.wsdl.wsdl2ws.info.FaultInfo;
  -import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
   import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
   
  -public class WrapHeaderWriter extends HeaderFileWriter
  +public class WrapHeaderWriter
  +    extends org.apache.axis.wsdl.wsdl2ws.cpp.WrapHeaderWriter
   {
  -    private ArrayList methods;
       public WrapHeaderWriter(WebServiceContext wscontext) throws WrapperFault
       {
  -        super(
  -            WrapperUtils.getClassNameFromFullyQualifiedName(
  -                wscontext.getSerInfo().getQualifiedServiceName()
  -                    + CUtils.WRAPPER_NAME_APPENDER));
  -        this.wscontext = wscontext;
  -        this.methods = wscontext.getSerInfo().getMethods();
  -    }
  -
  -    protected void writeClassComment() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write("/*\n");
  -            writer.write(
  -                " * This file was auto-generated by the Axis C++ Web Service Generator
(WSDL2Ws)\n");
  -            writer.write(
  -                " * This file contains Web Service Wrapper declarations\n");
  -            writer.write(" */\n\n");
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeConstructors()
  -     */
  -    protected void writeConstructors() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write("public:\n\t" + classname + "();\n");
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeDistructors()
  -     */
  -    protected void writeDestructors() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write("public:\n\tvirtual ~" + classname + "();\n");
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
  -     */
  -    protected void writeMethods() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write(
  -                "public:/*implementation of WrapperClassHandler interface*/\n");
  -            writer.write("\tint AXISCALL invoke(void* pMsg);\n");
  -            writer.write("\tvoid AXISCALL onFault(void* pMsg);\n");
  -            writer.write("\tint AXISCALL init();\n");
  -            writer.write("\tint AXISCALL fini();\n");
  -            writer.write(
  -                "\tAXIS_BINDING_STYLE AXISCALL getBindingStyle(){return DOC_LITERAL;};\n");
  -            writer.write(
  -                "private:/*Methods corresponding to the web service methods*/\n");
  -            MethodInfo minfo;
  -            for (int i = 0; i < methods.size(); i++)
  -            {
  -                minfo = (MethodInfo) methods.get(i);
  -                writer.write(
  -                    "\tint " + minfo.getMethodname() + "(void* pMsg);");
  -                writer.write("\n");
  -            }
  -
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writePreprocssorStatements()
  -     */
  -    protected void writePreprocessorStatements() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write(
  -                "#include \""
  -                    + CUtils.getWebServiceNameFromWrapperName(classname)
  -                    + ".h\"\n");
  -            writer.write("#include <axis/server/WrapperClassHandler.hpp>\n");
  -            writer.write("#include <axis/server/IMessageData.hpp>\n");
  -            writer.write("#include <axis/server/GDefine.hpp>\n");
  -            writer.write("#include <axis/server/AxisWrapperAPI.hpp>\n");
  -            writer.write("#include \"AxisServiceException.h\" \n");
  -            writer.write("AXIS_CPP_NAMESPACE_USE \n\n");
  -            //writeFaultHeaders();
  -
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -    	 * @see org.apache.axis.wsdl.wsdl2ws.cpp.HeaderFileWriter#writeMethods()
  -    	 */
  -    protected void writeFaultHeaders() throws WrapperFault
  -    {
  -        try
  -        {
  -
  -            MethodInfo minfo;
  -            for (int i = 0; i < methods.size(); i++)
  -            {
  -                minfo = (MethodInfo) methods.get(i);
  -                Iterator fault = minfo.getFaultType().iterator();
  -                String faultInfoName = null;
  -                while (fault.hasNext())
  -                {
  -                    FaultInfo info = (FaultInfo) fault.next();
  -                    faultInfoName = info.getFaultInfo();
  -                    writer.write(
  -                        "#include \"Axis"
  -                            + faultInfoName.toString()
  -                            + "Exception.h\"\n");
  -                }
  -            }
  -            writer.write("\n");
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -    protected String getExtendsPart()
  -    {
  -        return " : public WrapperClassHandler";
  -    }
  -    protected void writeAttributes() throws WrapperFault
  -    {
  -        try
  -        {
  -            writer.write(
  -                "private:/* Actual web service object*/\n\t"
  -                    + CUtils.getWebServiceNameFromWrapperName(classname)
  -                    + " *pWs;\n");
  -        }
  -        catch (IOException e)
  -        {
  -            throw new WrapperFault(e);
  -        }
  -    }
  -    protected String getFileType()
  -    {
  -        return "ServerWrapper";
  +        super(wscontext);
  +        this.bindingStyle="DOC_LITERAL";
       }
   }
  
  
  

Mime
View raw message