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 BeanParamWriter.java
Date Tue, 22 Feb 2005 14:14:49 GMT
dicka       2005/02/22 06:14:49

  Modified:    c/include/axis IWrapperSoapSerializer.hpp
               c/src/cbindings IWrapperSoapSerializerC.cpp
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java
  Log:
  Add ability for generated stubs to determine if namespace is being newly declared.
  
  PR: AXISCPP-464
  Submitted by: Adrian Dick
  
  Revision  Changes    Path
  1.7       +16 -1     ws-axis/c/include/axis/IWrapperSoapSerializer.hpp
  
  Index: IWrapperSoapSerializer.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/IWrapperSoapSerializer.hpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- IWrapperSoapSerializer.hpp	28 Jan 2005 16:16:54 -0000	1.6
  +++ IWrapperSoapSerializer.hpp	22 Feb 2005 14:14:48 -0000	1.7
  @@ -58,9 +58,24 @@
       virtual int AXISCALL createSoapFault(const AxisChar* sLocalName, 
           const AxisChar* sURI, const AxisChar* sFaultCode,
   	const AxisChar* sFaultString)=0;
  -
  +    /**
  +     * Returns the corrosponding namespace prefix.
  +     * @param pNamespace The namespace.
  +     * @return The corrosponding prefix.
  +     */
       virtual const AxisChar* AXISCALL getNamespacePrefix
           (const AxisChar* pNamespace)=0;
  +    /**
  +     * Returns the corrosponding namespace prefix. This method is 
  +     * called when the caller also wants to know whether this is a new 
  +     * namespace or not as appose to its overloaded other member.
  +     * @param pNamespace The namespace.
  +     * @param blnIsNewPrefix The boolean which behaves as 
  +     * an out parameter to indicate whether this is a new namespace or not.
  +     * @return The corrosponding prefix.
  +     */
  +    virtual const AxisChar* AXISCALL getNamespacePrefix(const AxisChar* pNamespace,
  +        bool& blnIsNewPrefix)=0;
   
       virtual void AXISCALL removeNamespacePrefix(const AxisChar* pNamespace)=0;
   
  
  
  
  1.6       +14 -3     ws-axis/c/src/cbindings/IWrapperSoapSerializerC.cpp
  
  Index: IWrapperSoapSerializerC.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/cbindings/IWrapperSoapSerializerC.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IWrapperSoapSerializerC.cpp	28 Jan 2005 16:16:54 -0000	1.5
  +++ IWrapperSoapSerializerC.cpp	22 Feb 2005 14:14:49 -0000	1.6
  @@ -45,10 +45,21 @@
   	return sz->createSoapFault(sLocalName,sURI,sFaultCode,sFaultString);
   }
   
  +//AXISC_STORAGE_CLASS_INFO const AxiscChar * axiscGetNamespacePrefixIWrapperSoapSerializer(
  +//	AXISCHANDLE wrapperSoapSerializer, const AxiscChar * pNamespace) {
  +//	IWrapperSoapSerializer *sz = (IWrapperSoapSerializer*)wrapperSoapSerializer;
  +//	return sz->getNamespacePrefix(pNamespace);
  +//}
  +
   AXISC_STORAGE_CLASS_INFO const AxiscChar * axiscGetNamespacePrefixIWrapperSoapSerializer(
  -	AXISCHANDLE wrapperSoapSerializer, const AxiscChar * pNamespace) {
  -	IWrapperSoapSerializer *sz = (IWrapperSoapSerializer*)wrapperSoapSerializer;
  -	return sz->getNamespacePrefix(pNamespace);
  +    AXISCHANDLE wrapperSoapSerializer, const AxiscChar * pNamespace,
  +    AxiscBool * blnIsNewPrefix) {
  +    IWrapperSoapSerializer *sz = (IWrapperSoapSerializer*)wrapperSoapSerializer;
  +    
  +    bool isNewPrefix = false;
  +    const AxiscChar * returnValue = sz->getNamespacePrefix(pNamespace, isNewPrefix);
  +    *(blnIsNewPrefix) = (AxiscBool) isNewPrefix;
  +    return returnValue;
   }
   
   AXISC_STORAGE_CLASS_INFO void axiscRemoveNamespacePrefix(AXISCHANDLE wrapperSoapSerializer,
const AxiscChar * pNamespace) {
  
  
  
  1.34      +20 -6     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- BeanParamWriter.java	21 Feb 2005 06:19:21 -0000	1.33
  +++ BeanParamWriter.java	22 Feb 2005 14:14:49 -0000	1.34
  @@ -181,19 +181,33 @@
           writer.write("\t}\n");
           writer.write("\telse\n");
           writer.write("\t{\n");
  +        writer.write("\t\tbool blnIsNewPrefix = false;\n");
  +        writer.write("\t\tconst AxisChar* sPrefix = pSZ->getNamespacePrefix(Axis_URI_"
  +                    + classname
  +                    + ", blnIsNewPrefix);\n");
  +        writer.write("\t\tif (!blnIsNewPrefix)\n");
  +        writer.write("\t\t{\n");
           writer.write(
  -            "\t\tconst AxisChar* sPrefix = pSZ->getNamespacePrefix(Axis_URI_"
  -                + classname
  -                + ");\n");
  +                "\t\t\tpSZ->serialize(\"<\", Axis_TypeName_"
  +                    + classname
  +                    + ", \" xsi:type=\\\"\", sPrefix, \":\",\n");
  +            writer.write(
  +                "\t\t\t\tAxis_TypeName_"
  +                    + classname
  +                    + ", \"\\\">\", NULL);\n");
  +        writer.write("\t\t}\n");
  +        writer.write("\t\telse\n");
  +        writer.write("\t\t{\n");
           writer.write(
  -            "\t\tpSZ->serialize(\"<\", Axis_TypeName_"
  +            "\t\t\tpSZ->serialize(\"<\", Axis_TypeName_"
                   + classname
                   + ", \" xsi:type=\\\"\", sPrefix, \":\",\n");
           writer.write(
  -            "\t\t\tAxis_TypeName_"
  +            "\t\t\t\tAxis_TypeName_"
                   + classname
                   + ", \"\\\" xmlns:\", sPrefix, \"=\\\"\",\n");
  -        writer.write("\t\t\tAxis_URI_" + classname + ", \"\\\">\", NULL);\n");
  +        writer.write("\t\t\t\tAxis_URI_" + classname + ", \"\\\">\", NULL);\n");
  +        writer.write("\t\t}\n");
           writer.write("\t}\n\n");
   
           String arrayType;
  
  
  

Mime
View raw message