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 2007/02/02 03:33:50 UTC
svn commit: r502450 - in /webservices/axis/trunk/c: include/axis/client/
src/cbindings/client/ src/engine/client/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/
tests/auto_build/testcases/output/
Author: nadiramra
Date: Thu Feb 1 18:33:49 2007
New Revision: 502450
URL: http://svn.apache.org/viewvc?view=rev&rev=502450
Log:
AXISCPP-925 - exception occurs when one-way call is made
Modified:
webservices/axis/trunk/c/include/axis/client/Call.h
webservices/axis/trunk/c/include/axis/client/Call.hpp
webservices/axis/trunk/c/src/cbindings/client/CallC.cpp
webservices/axis/trunk/c/src/engine/client/Call.cpp
webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp
webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.h
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndElementName_ServerResponse.expected
Modified: webservices/axis/trunk/c/include/axis/client/Call.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/include/axis/client/Call.h?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/include/axis/client/Call.h (original)
+++ webservices/axis/trunk/c/include/axis/client/Call.h Thu Feb 1 18:33:49 2007
@@ -213,6 +213,16 @@
int axiscCallInitialize(AXISCHANDLE call, AXISC_PROVIDERTYPE nStyle);
/**
+ * @see axiscCallSendAndReceive
+ * @deprecated use axiscCallSendAndReceive
+ * @return If the invocation is successful, then AXIS_SUCCESS is returned,
+ * otherwise AXIS_FAIL is returned.
+ * @note This method may thrown an exception.
+ */
+AXISC_STORAGE_CLASS_INFO
+int axiscCallInvoke(AXISCHANDLE call);
+
+/**
* This is the main entry point into the Axis engine. Calling this method
* will begin the sequence that serialises the message, invokes that request
* handlers, transmits the request message and then wait for the response
@@ -223,8 +233,19 @@
* @note This method may thrown an exception.
*/
AXISC_STORAGE_CLASS_INFO
-int axiscCallInvoke(AXISCHANDLE call);
+int axiscCallSendAndReceive(AXISCHANDLE call);
+/**
+ * This is the main entry point into the Axis engine. Calling this method
+ * will begin the sequence that serialises the message, invokes that request
+ * handlers, transmits the request message. No response is expected and
+ * no response handlers are called.
+ * @return If the invocation is successful, then AXIS_SUCCESS is returned,
+ * otherwise AXIS_FAIL is returned.
+ * @note This method may thrown an exception.
+ */
+AXISC_STORAGE_CLASS_INFO
+int axiscCallSend(AXISCHANDLE call);
/**
* Sets an Attribute to the SOAPMethod, using the given Attribute data.
Modified: webservices/axis/trunk/c/include/axis/client/Call.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/include/axis/client/Call.hpp?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/include/axis/client/Call.hpp (original)
+++ webservices/axis/trunk/c/include/axis/client/Call.hpp Thu Feb 1 18:33:49 2007
@@ -214,11 +214,35 @@
* handlers, transmits the request message and then wait for the response
* message, calls the response handlers and then deserialises the response
* message.
+ * @deprecated Use sendAndReceive method instead of this method.
* @return If the invocation is successful, then AXIS_SUCCESS is returned,
* otherwise AXIS_FAIL is returned.
* @note This method may thrown an exception.
*/
- int AXISCALL invoke();
+ int AXISCALL invoke() { return sendAndReceive(); }
+
+ /**
+ * This is the main entry point into the Axis engine. Calling this method
+ * will begin the sequence that serialises the message, invokes that request
+ * handlers, transmits the request message and then wait for the response
+ * message, calls the response handlers and then deserialises the response
+ * message.
+ * @return If the invocation is successful, then AXIS_SUCCESS is returned,
+ * otherwise AXIS_FAIL is returned.
+ * @note This method may thrown an exception.
+ */
+ int AXISCALL sendAndReceive();
+
+ /**
+ * This is the main entry point into the Axis engine. Calling this method
+ * will begin the sequence that serialises the message, invokes that request
+ * handlers, transmits the request message. No response
+ * message is expected and no response handlers are invoked.
+ * @return If the invocation is successful, then AXIS_SUCCESS is returned,
+ * otherwise AXIS_FAIL is returned.
+ * @note This method may thrown an exception.
+ */
+ int AXISCALL send();
/**
* Sets an Attribute to the SOAPMethod, using the given Attribute data.
Modified: webservices/axis/trunk/c/src/cbindings/client/CallC.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/cbindings/client/CallC.cpp?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/client/CallC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/client/CallC.cpp Thu Feb 1 18:33:49 2007
@@ -307,13 +307,43 @@
AXISC_STORAGE_CLASS_INFO
int axiscCallInvoke(AXISCHANDLE call)
{
+ return axiscCallSendAndReceive(call);
+}
+
+AXISC_STORAGE_CLASS_INFO
+int axiscCallSendAndReceive(AXISCHANDLE call)
+{
+ Call *c = (Call*)call;
+
+ try
+ {
+ return c->sendAndReceive();
+ }
+ catch ( AxisException& e )
+ {
+
+ processException(c, e);
+ }
+ catch ( ... )
+ {
+
+
+ axiscAxisInvokeExceptionHandler(-1, "Unrecognized exception thrown.", NULL, NULL);
+ }
+
+ return -1;
+}
+
+AXISC_STORAGE_CLASS_INFO
+int axiscCallSend(AXISCHANDLE call)
+{
Call *c = (Call*)call;
try
{
- return c->invoke();
+ return c->send();
}
catch ( AxisException& e )
{
Modified: webservices/axis/trunk/c/src/engine/client/Call.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/Call.cpp?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Call.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Call.cpp Thu Feb 1 18:33:49 2007
@@ -185,9 +185,16 @@
pName, pNamespace);
}
-int Call::invoke()
+int Call::sendAndReceive()
{
- m_nStatus = m_pAxisEngine->process( m_pTransport);
+ m_nStatus = m_pAxisEngine->process( m_pTransport, false);
+
+ return m_nStatus;
+}
+
+int Call::send()
+{
+ m_nStatus = m_pAxisEngine->process( m_pTransport, true);
return m_nStatus;
}
Modified: webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.cpp Thu Feb 1 18:33:49 2007
@@ -56,6 +56,12 @@
int ClientAxisEngine::
process (SOAPTransport* pSoap)
{
+ return process(pSoap, false);
+}
+
+int ClientAxisEngine::
+process (SOAPTransport* pSoap, bool noResponse)
+{
int Status = AXIS_FAIL;
const WSDDService* pService = NULL;
@@ -131,7 +137,7 @@
// Invoke all handlers and then the remote webservice
// we generate response in the same way even if this has failed
- Status = invoke (m_pMsgData);
+ Status = invoke (m_pMsgData, noResponse);
}
while (0);
@@ -162,6 +168,12 @@
int ClientAxisEngine::
invoke (MessageData* pMsg)
{
+ invoke(pMsg, false);
+}
+
+int ClientAxisEngine::
+invoke (MessageData* pMsg, bool noResponse)
+{
enum AE_LEVEL { AE_START = 1, AE_SERH, AE_GLH, AE_TRH, AE_SERV };
int Status = AXIS_FAIL;
int level = AE_START;
@@ -206,14 +218,17 @@
if (AXIS_SUCCESS != (Status = m_pDZ->setInputStream (m_pSoap)))
break;
- // version not supported set status to fail
- int nSoapVersion = m_pDZ->getVersion ();
- if (nSoapVersion == VERSION_LAST)
- Status = AXIS_FAIL;
-
- m_pDZ->getHeader ();
- m_pDZ->getBody ();
+ // Get header and body only if we are expecting a response
+ if (!noResponse)
+ {
+ // version not supported set status to fail
+ int nSoapVersion = m_pDZ->getVersion ();
+ if (nSoapVersion == VERSION_LAST)
+ Status = AXIS_FAIL;
+ m_pDZ->getHeader ();
+ m_pDZ->getBody ();
+ }
}
while (0);
@@ -229,6 +244,10 @@
case AE_SERV:
// everything success
Status = AXIS_SUCCESS;
+
+ // If no response expected, break out.
+ if (noResponse)
+ break;
case AE_TRH:
// After invoking the transport handlers (at actual service invokation) it has failed
Modified: webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.h?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.h (original)
+++ webservices/axis/trunk/c/src/engine/client/ClientAxisEngine.h Thu Feb 1 18:33:49 2007
@@ -39,9 +39,11 @@
MessageData* getMessageData ();
ClientAxisEngine ();
virtual ~ ClientAxisEngine ();
+ virtual int process (SOAPTransport* pSoap, bool noResponse);
virtual int process (SOAPTransport* pSoap);
protected:
+ virtual int invoke (MessageData* pMsg, bool noResponse);
virtual int invoke (MessageData* pMsg);
virtual void onFault (MessageData* pMsg);
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java Thu Feb 1 18:33:49 2007
@@ -545,13 +545,16 @@
writer.write("\n");
- writer.write("\tif (AXISC_SUCCESS == axiscCallInvoke(call))\n\t{\n");
+
if (minfo.getOutputMessage () != null)
{
+ writer.write("\tif (AXISC_SUCCESS == axiscCallSendAndReceive(call))\n\t{\n");
writer.write("\t\tif(AXISC_SUCCESS == axiscCallCheckMessage(call, \""
+ minfo.getOutputMessage().getLocalPart() + "\", \""
+ minfo.getOutputMessage().getNamespaceURI() + "\"))\n\t\t{\n");
}
+ else
+ writer.write("\tif (AXISC_SUCCESS == axiscCallSend(call))\n\t{\n");
if (isAllTreatedAsOutParams)
{
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Thu Feb 1 18:33:49 2007
@@ -543,13 +543,16 @@
writer.write("\n");
- writer.write ("\tif (AXIS_SUCCESS == m_pCall->invoke())\n\t{\n");
+
if (minfo.getOutputMessage () != null)
{
+ writer.write ("\tif (AXIS_SUCCESS == m_pCall->sendAndReceive())\n\t{\n");
writer.write ("\t\tif(AXIS_SUCCESS == m_pCall->checkMessage(\""
+ minfo.getOutputMessage ().getLocalPart () + "\", \""
+ minfo.getOutputMessage ().getNamespaceURI () + "\"))\n\t\t{\n");
}
+ else
+ writer.write ("\tif (AXIS_SUCCESS == m_pCall->send())\n\t{\n");
if (isAllTreatedAsOutParams)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndElementName_ServerResponse.expected
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndElementName_ServerResponse.expected?view=diff&rev=502450&r1=502449&r2=502450
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndElementName_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndElementName_ServerResponse.expected Thu Feb 1 18:33:49 2007
@@ -2,27 +2,11 @@
Server: WebSphere Application Server/5.1
Content-Type: text/xml; charset=utf-8
Content-Language: en-GB
-Transfer-Encoding: chunked
-
-0b1
-<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
-<SOAP-ENV:Body>
-</SOAP-ENV:Body>
-</SOAP-ENV:Envelope>
-0
+Content-Length: 0
HTTP/1.1 200 OK
Server: WebSphere Application Server/5.1
Content-Type: text/xml; charset=utf-8
Content-Language: en-GB
-Transfer-Encoding: chunked
-
-0b1
-<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
-<SOAP-ENV:Body>
-</SOAP-ENV:Body>
-</SOAP-ENV:Envelope>
-0
+Content-Length: 0
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org