You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2008/12/23 04:03:28 UTC

svn commit: r728856 - in /webservices/axis/trunk/c: include/axis/IWrapperSoapSerializer.hpp src/soap/SoapSerializer.cpp src/soap/SoapSerializer.h

Author: nadiramra
Date: Mon Dec 22 19:03:28 2008
New Revision: 728856

URL: http://svn.apache.org/viewvc?rev=728856&view=rev
Log:
New method to simplify things.

Modified:
    webservices/axis/trunk/c/include/axis/IWrapperSoapSerializer.hpp
    webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
    webservices/axis/trunk/c/src/soap/SoapSerializer.h

Modified: webservices/axis/trunk/c/include/axis/IWrapperSoapSerializer.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/include/axis/IWrapperSoapSerializer.hpp?rev=728856&r1=728855&r2=728856&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/IWrapperSoapSerializer.hpp (original)
+++ webservices/axis/trunk/c/include/axis/IWrapperSoapSerializer.hpp Mon Dec 22 19:03:28 2008
@@ -65,11 +65,26 @@
      * @param sLocalName local name of the method
      * @param sURI namespace URI of the method
      * @return status
+     * 
+     * @deprecated Use other flavor of createSoapMethod
      */
     virtual int AXISCALL createSoapMethod(const AxisChar* sLocalName, 
                                           const AxisChar* sURI)=0;
 
     /**
+     * Create new SOAP method, ie the first nested element within a SOAP Body.
+     * 
+     * @param sLocalName local name of the method
+     * @param sURI namespace URI of the method
+     * @param bIsWrapperStyle  whether the SOAP message to be generated is wrapper-style or not.
+     * @return status
+     * 
+     */
+    virtual int AXISCALL createSoapMethod(const AxisChar* sLocalName, 
+                                          const AxisChar* sURI,
+                                          bool  bIsWrapperStyle)=0;
+    
+    /**
      * Create a new SOAP Fault within the SOAP Body.
      * 
      * This creates a SOAP Fault with no detail element, this can be added later

Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapSerializer.cpp?rev=728856&r1=728855&r2=728856&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.cpp Mon Dec 22 19:03:28 2008
@@ -612,8 +612,18 @@
     return *this;
 }
 
+// deprecated.....
 int SoapSerializer::
-createSoapMethod( const AxisChar * sLocalName, const AxisChar * sURI)
+createSoapMethod( const AxisChar * sLocalName, 
+                  const AxisChar * sURI)
+{
+    return createSoapMethod(sLocalName, sURI, true);
+}
+
+int SoapSerializer::
+createSoapMethod( const AxisChar * sLocalName, 
+                  const AxisChar * sURI, 
+                  bool bIsWrapperStyle)
 {
     logEntryEngine("SoapSerializer::createSoapMethod")
 
@@ -629,9 +639,10 @@
     
     // Ensure everything is cleared out if using existing method object.
     pMethod->reset();
-
+    
+    pMethod->setWrapperStyle(bIsWrapperStyle);
     pMethod->setLocalName( sLocalName);
-    pMethod->setPrefix( getNamespacePrefix( sURI));
+    pMethod->setPrefix( getNamespacePrefix(sURI) );
     pMethod->setURI( sURI);
 
     logExitWithReturnCode(AXIS_SUCCESS)
@@ -958,17 +969,19 @@
     return iStatus;  
 }
 
-int SoapSerializer::serializeAsElement( const AxisChar * pName,
-                                        void * pValue, 
-                                        XSDTYPE type)
+int SoapSerializer::
+serializeAsElement( const AxisChar * pName,
+                    void * pValue, 
+                    XSDTYPE type)
 {
   return serializeAsElement( pName, NULL, pValue, type);
 }
 
-int SoapSerializer::serializeAsElement( const AxisChar * pName, 
-                                        const AxisChar * pNamespace,
-                                        void * pValue, 
-                                        XSDTYPE type) 
+int SoapSerializer::
+serializeAsElement( const AxisChar * pName, 
+                    const AxisChar * pNamespace,
+                    void * pValue, 
+                    XSDTYPE type) 
 {
     IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(pValue, type);
     int ret;
@@ -1119,19 +1132,22 @@
     return iStatus;  
 }
 
-int SoapSerializer::setBodyAsHexBinary( xsd__hexBinary body)
+int SoapSerializer::
+setBodyAsHexBinary( xsd__hexBinary body)
 {
     /* TODO */
     return AXIS_SUCCESS;
 }
 
-int SoapSerializer::setBodyAsBase64Binary( xsd__base64Binary body)
+int SoapSerializer::
+setBodyAsBase64Binary( xsd__base64Binary body)
 {
     /* TODO */    
     return AXIS_SUCCESS;
 }
 
-const AxisChar* SoapSerializer::getBodyAsString()
+const AxisChar* SoapSerializer::
+getBodyAsString()
 {
     /* TODO */    
     return NULL;
@@ -1140,9 +1156,10 @@
 /* following two functions are needed by serializer functions of complex types
  * for RPC style web services
  */
-void SoapSerializer::serializeStartElementOfType( const AxisChar * pName, 
-                                                  const AxisChar * pNamespace, 
-                                                  const AxisChar * pPrefix)
+void SoapSerializer::
+serializeStartElementOfType( const AxisChar * pName, 
+                             const AxisChar * pNamespace, 
+                             const AxisChar * pPrefix)
 {
     if( pPrefix)
     {
@@ -1163,7 +1180,8 @@
         serialize( "<", pName, ">", NULL);
 }
 
-void SoapSerializer::serializeEndElementOfType( const AxisChar * pName)
+void SoapSerializer::
+serializeEndElementOfType( const AxisChar * pName)
 {
     serialize( "</", pName, ">", NULL);
 }
@@ -1280,12 +1298,14 @@
     return returnValue;
 }
 
-IHeaderBlock * SoapSerializer::getFirstHeaderBlock()
+IHeaderBlock * SoapSerializer::
+getFirstHeaderBlock()
 {
     return m_pSoapEnvelope->m_pSoapHeader->getFirstHeaderBlock();
 }
 
-IHeaderBlock * SoapSerializer::getNextHeaderBlock()
+IHeaderBlock * SoapSerializer::
+getNextHeaderBlock()
 {
     return m_pSoapEnvelope->m_pSoapHeader->getNextHeaderBlock();
 }
@@ -1386,23 +1406,27 @@
     logExit()
 }
 
-void SoapSerializer::addNamespaceToNamespaceList( const AxisChar * pachNamespaceURI,
-                                                  const AxisChar * pachPrefix)
+void SoapSerializer::
+addNamespaceToNamespaceList( const AxisChar * pachNamespaceURI,
+                             const AxisChar * pachPrefix)
 {
     m_NsStack[pachNamespaceURI] = pachPrefix;
 }
 
-ISoapAttachment* SoapSerializer::createSoapAttachment()
+ISoapAttachment* SoapSerializer::
+createSoapAttachment()
 {
     return new SoapAttachment(m_pContentIdSet);
 }
 
-void SoapSerializer::setContentIdSet(ContentIdSet *pContentIdSet) 
+void SoapSerializer::
+setContentIdSet(ContentIdSet *pContentIdSet) 
 {
     m_pContentIdSet = pContentIdSet;
 }
 
-bool SoapSerializer::checkAttachmentAvailability()
+bool SoapSerializer::
+checkAttachmentAvailability()
 {
     map<AxisXMLString, ISoapAttachment*>::iterator itCurrAttach= m_SoapAttachments.begin();
 
@@ -1412,7 +1436,8 @@
     return false;
 }
 
-void SoapSerializer::addAttachmentParameter(ISoapAttachment* att, const char* pName, IAttribute **attributes, int nAttributes)
+void SoapSerializer::
+addAttachmentParameter(ISoapAttachment* att, const char* pName, IAttribute **attributes, int nAttributes)
 {
     if (NULL==att)
         att = static_cast<ISoapAttachment*>(new SoapAttachment(m_pContentIdSet));
@@ -1435,12 +1460,14 @@
     m_SoapAttachments[att->getAttachmentId()] = att;
 }
 
-IHeaderBlock * SoapSerializer::getCurrentHeaderBlock()
+IHeaderBlock * SoapSerializer::
+getCurrentHeaderBlock()
 {
     return m_pSoapEnvelope->m_pSoapHeader->getCurrentHeaderBlock();
 }
 
-AxisXMLString SoapSerializer::getNamespaceURL( string sNameSpace)
+AxisXMLString SoapSerializer::
+getNamespaceURL( string sNameSpace)
 {
     // Check that the namespace value is not empty.  If it is then return as
     // there is nothing to do!

Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/soap/SoapSerializer.h?rev=728856&r1=728855&r2=728856&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.h (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.h Mon Dec 22 19:03:28 2008
@@ -81,6 +81,7 @@
     int setOutputStreamForTesting(SOAPTransport* pStream);
 #endif
     int AXISCALL createSoapMethod(const AxisChar* sLocalName, const AxisChar* sURI);
+    int AXISCALL createSoapMethod(const AxisChar* sLocalName, const AxisChar* sURI, bool bIsWrapperStyle);
 
     int AXISCALL createSoapFault(const AxisChar* sLocalName, 
         const AxisChar* sURI, const AxisChar* sFaultCode,