new method Call:clearSOAPMethodAttributes()
-------------------------------------------

                 Key: AXISCPP-1010
                 URL: http://issues.apache.org/jira/browse/AXISCPP-1010
             Project: Axis-C++
          Issue Type: Improvement
          Components: Client - API
    Affects Versions:  1.6 Beta
         Environment: WIN2K VS6SP6 JDK1.5.0:07
            Reporter: Franz Fehringer


I invented a new method Call:clearSOAPMethodAttributes() to avoid double 
serializing of the same attributes at operation level.
The relevant svn diffs are given below.
An example scenario

ppt->getCall()->initialize(CPP_DOC_PROVIDER);
ppt->getCall()->setTransportProperty(SOAPACTION_HEADER , "#SearchRooms");
ppt->getCall()->setSOAPVersion(SOAP_VER_1_1);
ppt->getCall()->setOperation("SearchRoomsRequest", 
"http://www.pegs-pegstour.com/API/XMLSchema/1.0.1";);
ppt->getCall()->clearSOAPMethodAttributes();
ppt->getCall()->setSOAPMethodAttribute("returnRateNotes", "", "false");
ppt->getCall()->setSOAPMethodAttribute("returnAllocationRemaining", "", "true");
ppt->getCall()->setSOAPMethodAttribute("includeOnRequest", "", "true");
ppt->getCall()->setSOAPMethodAttribute("includeNonSeamless", "", "false");
ppt->getCall()->setSOAPMethodAttribute("checkAvailabilityLevel", "", "ROOM");

$ pwd
/cd/d/Quellen/SVN/axis/c/include

Index: axis/client/Call.hpp
===================================================================
--- axis/client/Call.hpp        (Revision 480584)
+++ axis/client/Call.hpp        (Arbeitskopie)
@@ -250,6 +250,8 @@
                                  const AxisChar * pUri,
                                  const AxisChar * pValue);
 
+    void clearSOAPMethodAttributes();
+
     /**
      * Method for adding complex parameters to the engine, ready to be 
serialised.
      *   An example of this method (taken from the automatically generated 
stubs

$ pwd            
/cd/d/Quellen/SVN/axis/c/src/soap

Index: SoapSerializer.h
===================================================================
--- SoapSerializer.h    (Revision 480584)
+++ SoapSerializer.h    (Arbeitskopie)
@@ -197,6 +197,8 @@
        IHeaderBlock* getNextHeaderBlock();
 
        int setSOAPMethodAttribute(Attribute* pAttribute);
+       void clearSOAPMethodAttributes();
+
        SoapMethod* getSOAPMethod();
     IHeaderBlock* createHeaderBlock(const AxisChar *pachLocalName,
         const AxisChar *pachUri);

Index: SoapMethod.h
===================================================================
--- SoapMethod.h        (Revision 480584)
+++ SoapMethod.h        (Arbeitskopie)
@@ -89,12 +89,19 @@
     virtual ~SoapMethod();
 
   /**
-    * This methos will clear up all the current out params in preperation of a 
+    * This method will clear up all the current out params in preparation of a 
     * new method call
     */
     void clearOutParams();
+
+  /**
+    * This method will clear up all the current attributes in preparation of a 
+    * new method call
+    */
+    void clearAttributes();
 };
 
 AXIS_CPP_NAMESPACE_END
 
 #endif
+

ndex: SoapSerializer.cpp
===================================================================
--- SoapSerializer.cpp  (Revision 480584)
+++ SoapSerializer.cpp  (Arbeitskopie)
@@ -1021,6 +1021,15 @@
     return AXIS_FAIL;
 }
 
+void SoapSerializer::clearSOAPMethodAttributes()
+{
+    if (m_pSoapEnvelope && m_pSoapEnvelope->m_pSoapBody &&
+        m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)
+    {
+        m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->clearAttributes();
+    }
+}
+
 int SoapSerializer::serializeAnyObject( AnyType * pAnyObject)
 {
     for( int i = 0; i < pAnyObject->_size; i++)

Index: SoapMethod.cpp
===================================================================
--- SoapMethod.cpp      (Revision 480584)
+++ SoapMethod.cpp      (Arbeitskopie)
@@ -225,5 +225,18 @@
     m_OutputParams.clear();
 }
 
+void SoapMethod::clearAttributes()
+{
+    if (m_attributes.empty())
+        return;
+
+    list<Attribute*>::iterator it;
+
+    for (it = m_attributes.begin(); it != m_attributes.end(); ++it)
+       delete *it;
+
+    m_attributes.clear();
+}
+
 AXIS_CPP_NAMESPACE_END
 
$ pwd
/cd/d/Quellen/SVN/axis/c/src/engine/client

Index: Call.cpp
===================================================================
--- Call.cpp    (Revision 480584)
+++ Call.cpp    (Arbeitskopie)
@@ -1088,6 +1088,11 @@
     m_pIWSSZ->setSOAPMethodAttribute( ((Attribute *) pAttribute)->clone());
 }
 
+void Call::clearSOAPMethodAttributes()
+{
+    m_pIWSSZ->clearSOAPMethodAttributes();
+}
+
 xsd__string Call::getFaultAsXMLString()
 {
     return m_pIWSDZ->getFaultAsXMLString();
@@ -1229,4 +1234,4 @@
         it++;
     }
     m_soapFaults.clear();
-}
\ Kein Zeilenvorschub am Ende der Datei
+}
Index: Stub.cpp
===================================================================
--- Stub.cpp    (Revision 480584)
+++ Stub.cpp    (Arbeitskopie)
@@ -39,6 +39,7 @@
     m_pCall->setProtocol (eProtocol);
     m_pTransport = m_pCall->getTransport ();
     m_pTransport->setEndpointUri( pcEndPointUri);
+    m_viCurrentSOAPHeaderBlock = m_vSOAPHeaderBlocks.end();
     
     // SSL channel related initilizations
     char * pcSSLChannelInfo = g_pConfig->getAxisConfProperty( 
AXCONF_SECUREINFO);


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to