You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/08/02 11:47:56 UTC
cvs commit: ws-axis/c/src/soap SoapDeSerializer.cpp SoapDeSerializer.h
samisa 2005/08/02 02:47:56
Modified: c/src/engine/client ClientAxisEngine.cpp
c/src/engine/server ServerAxisEngine.cpp
c/src/soap SoapDeSerializer.cpp SoapDeSerializer.h
Log:
Added modification to drop the mandaroty need for SOAPAction HTTP header on server side.
Now the method name is picked from the SOAP message.
Fix for AXISCPP-773
Revision Changes Path
1.33 +1 -0 ws-axis/c/src/engine/client/ClientAxisEngine.cpp
Index: ClientAxisEngine.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/ClientAxisEngine.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ClientAxisEngine.cpp 5 Jul 2005 09:33:32 -0000 1.32
+++ ClientAxisEngine.cpp 2 Aug 2005 09:47:55 -0000 1.33
@@ -231,6 +231,7 @@
}
m_pDZ->getHeader ();
+ m_pDZ->getBody ();
}
while (0);
1.31 +23 -3 ws-axis/c/src/engine/server/ServerAxisEngine.cpp
Index: ServerAxisEngine.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/server/ServerAxisEngine.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ServerAxisEngine.cpp 21 Mar 2005 09:28:47 -0000 1.30
+++ ServerAxisEngine.cpp 2 Aug 2005 09:47:55 -0000 1.31
@@ -172,7 +172,21 @@
/* Get the operation name from transport information Ex: from
* SOAPAction header
*/
- AxisString sOperation = pStream->getTransportProperty(OPERATION_NAME);
+ if (AXIS_SUCCESS != m_pDZ->getHeader ())
+ {
+ AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR);
+ break; // do .. while(0)
+ }
+ if (AXIS_SUCCESS != m_pDZ->getBody ())
+ {
+ AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR);
+ break; // do .. while(0)
+ }
+ //AxisString sOperation = pStream->getTransportProperty(OPERATION_NAME);
+ AxisString sOperation = m_pDZ->getMethodNameToInvoke();
+
if (sOperation.empty ())
{
AXISTRACE1("CLIENT_SOAP_NO_SOAP_METHOD", CRITICAL);
@@ -272,13 +286,19 @@
* header may be added to the Deserializer ONLY IF there is a CAN BE
* a handler in this soap processor to handle it.
*/
- if (AXIS_SUCCESS != m_pDZ->getHeader ())
+ /*if (AXIS_SUCCESS != m_pDZ->getHeader ())
+ {
+ AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
+ throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR);
+ break; // do .. while(0)
+ }
+ if (AXIS_SUCCESS != m_pDZ->getBody ())
{
AXISTRACE1 ("CLIENT_SOAP_SOAP_CONTENT_ERROR", CRITICAL);
throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR);
- //m_pSZ->setSoapFault (SoapFault::getSoapFault (CLIENT_SOAP_SOAPCONTENTERROR));
break; // do .. while(0)
}
+*/
/*
* Invoke all handlers including the webservice
* in case of failure coresponding stream fault message will be set
1.173 +17 -3 ws-axis/c/src/soap/SoapDeSerializer.cpp
Index: SoapDeSerializer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -r1.172 -r1.173
--- SoapDeSerializer.cpp 26 Jul 2005 04:36:33 -0000 1.172
+++ SoapDeSerializer.cpp 2 Aug 2005 09:47:56 -0000 1.173
@@ -407,6 +407,9 @@
/* Set any attributes/namspaces to the SoapBody object */
m_pNode = NULL; /* This is to indicate that node is identified
* and used */
+
+ // peek for the method name
+ m_strMethodNameToInvoke = m_pParser->peek();
return AXIS_SUCCESS;
}
}
@@ -421,11 +424,11 @@
const AxisChar * pNamespace)
{
/* check and skip the soap body tag */
- if (AXIS_SUCCESS != getBody ())
+ /*if (AXIS_SUCCESS != getBody ())
{
//return AXIS_FAIL;
throw AxisGenException (SERVER_UNKNOWN_ERROR);
- }
+ }*/
if (!m_pNode)
{
@@ -2990,6 +2993,17 @@
ISoapAttachment** SoapDeSerializer::getAllAttachments(int *pAttchArraySize)
{
return m_pInputStream->getAllAttachments(pAttchArraySize);
-}
+}
+
+
+const char* SoapDeSerializer::getMethodNameToInvoke()
+{
+ return m_strMethodNameToInvoke.c_str();
+}
+
+void SoapDeSerializer::setMethodNameToInvoke(const char* methodName)
+{
+ m_strMethodNameToInvoke = methodName;
+}
AXIS_CPP_NAMESPACE_END
1.46 +5 -1 ws-axis/c/src/soap/SoapDeSerializer.h
Index: SoapDeSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- SoapDeSerializer.h 6 Jul 2005 18:00:31 -0000 1.45
+++ SoapDeSerializer.h 2 Aug 2005 09:47:56 -0000 1.46
@@ -66,14 +66,18 @@
PROVIDERTYPE m_ProviderType;
SOAPTransport* m_pInputStream;
+ string m_strMethodNameToInvoke;
+
private:
int AXISCALL getArraySize(const AnyElement* pElement);
- int getBody();
public:
int init();
int getVersion();
SoapEnvelope* getEnvelope();
int getHeader();
+ int getBody();
+ const char* getMethodNameToInvoke();
+ void setMethodNameToInvoke(const char*);
/**
* This method allows to peek for the name of the next element in XML stream.
* Useful in supporting "all" & "choice" WSDL constructs.