dicka 2005/03/04 12:57:39
Modified: c/include/axis/client Call.hpp Stub.hpp
c/src/cbindings/client CallC.cpp StubC.cpp
c/src/engine/client Call.cpp Stub.cpp
c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
ClientStubWriter.java
Log:
Removing setSOAPMethodAttribute and associated methods from Stub interface, and placing
onto Call interface. Including update to WSDL2Ws tool.
PR: AXISCPP-482
Submitted by: Adrian Dick
Revision Changes Path
1.22 +22 -0 ws-axis/c/include/axis/client/Call.hpp
Index: Call.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/client/Call.hpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Call.hpp 4 Mar 2005 14:54:55 -0000 1.21
+++ Call.hpp 4 Mar 2005 20:57:38 -0000 1.22
@@ -252,6 +252,28 @@
int AXISCALL initialize(PROVIDERTYPE nStyle);
int AXISCALL invoke();
+ /**
+ * Sets an Attribute to the SOAPMethod, using the given Attribute data.
+ * You must ensure the prefix has a valid namespace declared, otherwise an
+ * invalid SOAP message will be produced.
+ * It is safer to use setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar
*pPrefix, const AxisChar* pUri, const AxisChar *pValue)
+ *
+ * @param pLocalname The local name of the Attribute.
+ * @param pPrefix The prefix of the Attribute.
+ * @param pValue The value of the Attribute.
+ */
+ void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const
AxisChar *pValue);
+
+ /**
+ * Sets an Attribute to the SOAPMethod, using the given Attribute data.
+ *
+ * @param pLocalname The local name of the Attribute.
+ * @param pPrefix The prefix of the Attribute.
+ * @param pUri The namespace uri of the Attribute.
+ * @param pValue The value of the Attribute.
+ */
+ void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const
AxisChar* pUri, const AxisChar *pValue);
+
/* Method for adding complex parameters */
void AXISCALL addCmplxParameter(void* pObject, void* pSZFunct,
void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace);
1.18 +0 -93 ws-axis/c/include/axis/client/Stub.hpp
Index: Stub.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/client/Stub.hpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Stub.hpp 4 Mar 2005 14:54:55 -0000 1.17
+++ Stub.hpp 4 Mar 2005 20:57:38 -0000 1.18
@@ -595,99 +595,6 @@
void setProxy(const char* pcProxyHost, unsigned int uiProxyPort);
/**
- * Sets an Attribute to the SOAPMethod, using the given Attribute data.
- * You must ensure the prefix has a valid namespace declared, otherwise an
- * invalid SOAP message will be produced.
- * It is safer to use setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar
*pPrefix, const AxisChar* pUri, const AxisChar *pValue)
- *
- * @param pLocalname The local name of the Attribute.
- * @param pPrefix The prefix of the Attribute.
- * @param pValue The value of the Attribute.
- */
- void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const
AxisChar *pValue);
-
- /**
- * Sets an Attribute to the SOAPMethod, using the given Attribute data.
- *
- * @param pLocalname The local name of the Attribute.
- * @param pPrefix The prefix of the Attribute.
- * @param pUri The namespace uri of the Attribute.
- * @param pValue The value of the Attribute.
- */
- void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const
AxisChar* pUri, const AxisChar *pValue);
-
- /**
- * Iterator initiatior for SOAP method attributes
- *
- * This method must be called first to initiate access to the list of
- * SOAP method attributes.
- *
- * @return First SOAP method attribute pointer. If there are no SOAP method
- * attributes set, returns NULL.
- */
- IAttribute* getFirstSOAPMethodAttribute();
-
- /**
- * Iterator for SOAP method attributes
- *
- * getFirstSOAPMethodAttribute() method must have been called at least once
- * before this method is called. If not behaviour is undefined.
- *
- * This method advances the iterator by one position.
- * Repeated calls always retuen the next value.
- *
- * @return Next SOAP method attribute pointer. If there are no SOAP method
- * attributes set or if iterator is at the end of the list, returns NULL.
- */
- IAttribute* getNextSOAPMethodAttribute();
-
- /**
- * Accessor for SOAP method attributes
- *
- * This method gives access to the SOAP method attribute pointer corresponding
- * to the SOAP method attribute currently being pointed by SOAP method
- * attributes iterator.
- *
- * getFirstSOAPMethodAttribute() method must have been called at least once
- * before this method is called. If not behaviour is undefined.
- *
- * This method does not advance the iterator.
- * Repeated calls always retuen the same key unless
- * getNextSOAPMethodAttribute() is called in between.
- *
- * @return Current SOAP method attribute pointer. If there are no SOAP method
- * attribute set or if iterator is at the end of the list, returns NULL.
- */
- IAttribute* getCurrentSOAPMethodAttribute();
-
- /**
- * Deletes the SOAP method attribute currently pointed to by
- * the iterator.
- */
- void deleteCurrentSOAPMethodAttribute();
-
- /**
- * Deletes the given occerance of the SOAP method attribute from
- * the current list of SOAP method attributes
- *
- * This method does a pointer comparison. It does not compare the contents
- * within objects.
- * Hence it is expected that either the pointer returned by the
- * create method or by one of the iterator methods would be used with
- * this method.
- *
- * This method does not advance the iterator in line with the deletes done.
- * In case you want to access the SOAP method attributes after using this
- * method, it is advisable to reinitialize the iterator using
- * getFirstSOAPMethodAttribute();
- * However you can use this method despite where the iterator is
- * pointing currently.
- *
- * @param pAttribute Pointer of Attribute to be deleted
- */
- void deleteSOAPMethodAttribute(IAttribute* pAttribute);
-
- /**
* Set transport timeout.
*
* @param lSeconds Timeout in seconds.
1.7 +7 -0 ws-axis/c/src/cbindings/client/CallC.cpp
Index: CallC.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/cbindings/client/CallC.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CallC.cpp 4 Mar 2005 14:54:55 -0000 1.6
+++ CallC.cpp 4 Mar 2005 20:57:38 -0000 1.7
@@ -467,4 +467,11 @@
return c->getNamespacePrefix(pNamespace);
}
+AXISC_STORAGE_CLASS_INFO void axiscSetSOAPMethodAttribute(AXISCHANDLE call, const AxiscChar
* pLocalname,
+ const AxiscChar * pPrefix, const AxiscChar * pUri,
+ const AxiscChar * pValue) {
+ Call *c = (Call*)call;
+ c->setSOAPMethodAttribute(pLocalname,pPrefix,pUri,pValue);
+}
+
}
1.6 +0 -38 ws-axis/c/src/cbindings/client/StubC.cpp
Index: StubC.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/cbindings/client/StubC.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- StubC.cpp 4 Mar 2005 14:54:55 -0000 1.5
+++ StubC.cpp 4 Mar 2005 20:57:38 -0000 1.6
@@ -25,7 +25,6 @@
Call* getCallStubC() { return getCall(); }
void applyUserPreferencesStubC() { applyUserPreferences(); }
void setSOAPHeadersStubC() { setSOAPHeaders(); }
- void setSOAPMethodAttributesStubC() { setSOAPMethodAttributes(); }
};
AXIS_CPP_NAMESPACE_END
@@ -138,38 +137,6 @@
s->setProxy(pcProxyHost,uiProxyPort);
}
-AXISC_STORAGE_CLASS_INFO void axiscSetSOAPMethodAttribute(AXISCHANDLE stub, const AxiscChar
* pLocalname,
- const AxiscChar * pPrefix, const AxiscChar * pUri,
- const AxiscChar * pValue) {
- Stub *s = (Stub*)stub;
- s->setSOAPMethodAttribute(pLocalname,pPrefix,pUri,pValue);
-}
-
-AXISC_STORAGE_CLASS_INFO AXISCHANDLE axiscGetFirstSOAPMethodAttribute(AXISCHANDLE stub)
{
- Stub *s = (Stub*)stub;
- return (AXISCHANDLE)s->getFirstSOAPMethodAttribute();
-}
-
-AXISC_STORAGE_CLASS_INFO AXISCHANDLE axiscGetNextSOAPMethodAttribute(AXISCHANDLE stub)
{
- Stub *s = (Stub*)stub;
- return (AXISCHANDLE)s->getNextSOAPMethodAttribute();
-}
-
-AXISC_STORAGE_CLASS_INFO AXISCHANDLE axiscGetCurrentSOAPMethodAttribute(AXISCHANDLE stub)
{
- Stub *s = (Stub*)stub;
- return (AXISCHANDLE)s->getCurrentSOAPMethodAttribute();
-}
-
-AXISC_STORAGE_CLASS_INFO void axiscDeleteCurrentSOAPMethodAttribute(AXISCHANDLE stub) {
- Stub *s = (Stub*)stub;
- s->deleteCurrentSOAPMethodAttribute();
-}
-
-AXISC_STORAGE_CLASS_INFO void axiscDeleteSOAPMethodAttribute(AXISCHANDLE stub, AXISCHANDLE
pAttribute) {
- Stub *s = (Stub*)stub;
- s->deleteSOAPMethodAttribute((IAttribute*)pAttribute);
-}
-
AXISC_STORAGE_CLASS_INFO void axiscSetTransportTimeout(AXISCHANDLE stub, const long lSeconds)
{
Stub *s = (Stub*)stub;
s->setTransportTimeout(lSeconds);
@@ -210,9 +177,4 @@
s->setSOAPHeadersStubC();
}
-AXISC_STORAGE_CLASS_INFO void axiscSetSOAPMethodAttributes(AXISCHANDLE stub) {
- StubC *s = (StubC*)stub;
- s->setSOAPMethodAttributesStubC();
-}
-
}
\ No newline at end of file
1.102 +20 -0 ws-axis/c/src/engine/client/Call.cpp
Index: Call.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Call.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -r1.101 -r1.102
--- Call.cpp 4 Mar 2005 14:54:55 -0000 1.101
+++ Call.cpp 4 Mar 2005 20:57:38 -0000 1.102
@@ -42,6 +42,7 @@
#include "../../soap/SoapDeSerializer.h"
#include "../../soap/HeaderBlock.h"
#include "../../common/AxisGenException.h"
+#include "../../soap/Attribute.h"
extern AXIS_CPP_NAMESPACE_PREFIX AxisConfig* g_pConfig;
@@ -816,3 +817,22 @@
return m_pIWSSZ->getNamespacePrefix(pNamespace);
}
+void Call::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix,
const AxisChar *pValue)
+{
+ setSOAPMethodAttribute(pLocalname,pPrefix,NULL,pValue);
+}
+
+void Call::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix,
+ const AxisChar *pUri, const AxisChar *pValue)
+{
+ IAttribute* pAttribute;
+ if (NULL!=pUri)
+ {
+ pAttribute = new Attribute((std::list<Attribute*>)NULL, pLocalname, pPrefix,
pUri, pValue);
+ }
+ else
+ {
+ pAttribute = new Attribute((std::list<Attribute*>)NULL, pLocalname, pPrefix,
pValue);
+ }
+ m_pIWSSZ->setSOAPMethodAttribute(((Attribute*)pAttribute)->clone());
+}
\ No newline at end of file
1.40 +0 -106 ws-axis/c/src/engine/client/Stub.cpp
Index: Stub.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Stub.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Stub.cpp 4 Mar 2005 17:01:06 -0000 1.39
+++ Stub.cpp 4 Mar 2005 20:57:38 -0000 1.40
@@ -227,7 +227,6 @@
void Stub::applyUserPreferences()
{
setSOAPHeaders();
- setSOAPMethodAttributes();
}
void Stub::setProxy(const char* pcProxyHost, unsigned int uiProxyPort)
@@ -235,111 +234,6 @@
m_pCall->setProxy(pcProxyHost, uiProxyPort);
}
-void Stub::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix,
const AxisChar *pValue)
-{
- setSOAPMethodAttribute(pLocalname,pPrefix,NULL,pValue);
-}
-
-void Stub::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix,
- const AxisChar *pUri, const AxisChar *pValue)
-{
- //Check if there is an attribute with the same local name is already set
- IAttribute* pAttribute = this->getFirstSOAPMethodAttribute();
- while( pAttribute )
- {
- if( strcmp(pAttribute->getLocalName(), pLocalname) == 0 )
- {
- //found an attibute alredy set with same name
- if(strcmp(pAttribute->getPrefix(), pPrefix) == 0 )
- {
- this->deleteCurrentSOAPMethodAttribute();
- break;
- }
- }
- pAttribute = this->getNextSOAPMethodAttribute();
- }
-
- if (NULL!=pUri)
- pAttribute = new Attribute((std::list<Attribute*>)NULL, pLocalname, pPrefix, pUri,
pValue);
- else
- pAttribute = new Attribute((std::list<Attribute*>)NULL, pLocalname, pPrefix, pValue);
- m_vSOAPMethodAttributes.push_back(pAttribute);
- m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
-}
-
-IAttribute* Stub::getFirstSOAPMethodAttribute()
-{
- m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
- if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
- return NULL;
- else
- return (*m_viCurrentSOAPMethodAttribute);
-}
-
-IAttribute* Stub::getNextSOAPMethodAttribute()
-{
- //already at the end?
- if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
- return NULL;
-
- m_viCurrentSOAPMethodAttribute++;
-
- if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
- return NULL;
- else
- return (*m_viCurrentSOAPMethodAttribute);
-}
-
-IAttribute* Stub::getCurrentSOAPMethodAttribute()
-{
- if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
- return NULL;
- else
- return (*m_viCurrentSOAPMethodAttribute);
-}
-
-
-void Stub::setSOAPMethodAttributes()
-{
- SoapSerializer *pSerializer = NULL;
- if (m_pCall)
- pSerializer = m_pCall->getSOAPSerializer();
- if (pSerializer)
- {
- for (unsigned int i = 0; i < m_vSOAPMethodAttributes.size(); i++)
- {
- pSerializer->setSOAPMethodAttribute(((Attribute*)m_vSOAPMethodAttributes[i])->clone());
- }
- }
-}
-
-void Stub::deleteCurrentSOAPMethodAttribute()
-{
- if (m_viCurrentSOAPMethodAttribute != m_vSOAPMethodAttributes.end())
- {
- delete(*m_viCurrentSOAPMethodAttribute);
- m_vSOAPMethodAttributes.erase(m_viCurrentSOAPMethodAttribute);
- m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
- }
-}
-
-void Stub::deleteSOAPMethodAttribute(IAttribute* pAttribute)
-{
- vector <IAttribute*>::iterator currentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
- bool bDone = false;
- while( !bDone && currentSOAPMethodAttribute != m_vSOAPMethodAttributes.end())
- {
- if(pAttribute == *currentSOAPMethodAttribute)
- {
- delete (*currentSOAPMethodAttribute);
- m_vSOAPMethodAttributes.erase(currentSOAPMethodAttribute);
- m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
- bDone = true;
- }
- currentSOAPMethodAttribute++;
- }
-}
-
void Stub::setTransportTimeout(const long lSeconds)
{
if (m_pTransport)
1.76 +2 -2 ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
Index: ClientStubWriter.java
===================================================================
RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- ClientStubWriter.java 4 Mar 2005 14:54:56 -0000 1.75
+++ ClientStubWriter.java 4 Mar 2005 20:57:38 -0000 1.76
@@ -479,7 +479,7 @@
if ("string".equals(elementType))
{
writer.write(
- "\tsetSOAPMethodAttribute(\""
+ "\tm_pCall->setSOAPMethodAttribute(\""
+ param.getParamName()
+ "\", \"\", Value"
+ i
@@ -494,7 +494,7 @@
writer.write(
"\t\tsprintf(buffer,\"%d\", Value" + i + ");\n");
writer.write(
- "\t\tsetSOAPMethodAttribute(\""
+ "\t\tm_pCall->setSOAPMethodAttribute(\""
+ param.getParamName()
+ "\", \"\", buffer);\n");
writer.write("\t}\n");
|