ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal ClientStubWriter.java
Date Fri, 04 Mar 2005 14:54:56 GMT
whitlock    2005/03/04 06:54:56

  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/transport SOAPTransport.h
               c/src/transport/axis3 HTTPTransport.cpp HTTPTransport.hpp
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        ClientStubWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        ClientStubWriter.java
  Log:
  AXISCPP-499 "No soapaction means handlers can't be called"
  This fixes the problem where there may not be a soapaction in the wsdl, because the (non-C++)
server does not require one. If there is no soapaction, handlers cannot be called since they
driven by the soapaction. Soapaction is set by the generated stubs based on the value in the
wsdl. This fix only sets the soapaction in the generated stubs if it has not already been
set. This allows the client application to override the value in the wsdl. If the client application
does not set soapaction and the wsdl doesn't either, then the generated stub will still set
it to "" since it is mandatory. This fix also adds in getTransportProperty on various classes
since it is now needed by the generated stubs.
  
  Revision  Changes    Path
  1.21      +1 -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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Call.hpp	18 Feb 2005 11:11:16 -0000	1.20
  +++ Call.hpp	4 Mar 2005 14:54:55 -0000	1.21
  @@ -233,6 +233,7 @@
       void AXISCALL setSOAPVersion(SOAP_VERSION version);
       int AXISCALL setTransportProperty(AXIS_TRANSPORT_INFORMATION_TYPE type,
           const char* value);
  +	const char* AXISCALL getTransportProperty(const char *key, bool response=true);
   	int AXISCALL setHandlerProperty(AxisChar* name, void* value, int len);
   	/**
   	 * set the protocol that the underlying transport will use. 
  
  
  
  1.17      +11 -0     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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Stub.hpp	25 Feb 2005 13:07:39 -0000	1.16
  +++ Stub.hpp	4 Mar 2005 14:54:55 -0000	1.17
  @@ -277,6 +277,17 @@
       */
       void AXISCALL setTransportProperty(const char *pcKey, const char *pcValue);
   
  +  /**
  +    * Get a transport property.
  +	* 
  +	* Returns the value of a transport property based on a key.
  +	*
  +	* @param key the property's name to search for
  +	* @param response set to true searches the response message for the property
  +	*                 set to false searches the send message for the property
  +	* @return the value of the property or NULL if it was not found.
  +	*/
  +	const char* AXISCALL getTransportProperty(const char *key, bool response=true);
   
     /**
       * Iterator initiatior for transport property keys
  
  
  
  1.6       +6 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CallC.cpp	18 Feb 2005 11:11:16 -0000	1.5
  +++ CallC.cpp	4 Mar 2005 14:54:55 -0000	1.6
  @@ -47,6 +47,12 @@
   	return c->setTransportProperty((AXIS_TRANSPORT_INFORMATION_TYPE)type, value);
   }
   
  +AXISC_STORAGE_CLASS_INFO const char * axiscGetTransportPropertyCall(AXISCHANDLE call, const
char *key, 
  +	AxiscBool response) {
  +	Call *c = (Call*)call;
  +	return c->getTransportProperty(key, (bool) response);
  +}
  +
   AXISC_STORAGE_CLASS_INFO int axiscSetHandlerPropertyCall(AXISCHANDLE call, AxiscChar *
name, 
   	void * value, int len) {
   	Call *c = (Call*)call;
  
  
  
  1.5       +6 -0      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StubC.cpp	24 Feb 2005 15:13:08 -0000	1.4
  +++ StubC.cpp	4 Mar 2005 14:54:55 -0000	1.5
  @@ -58,6 +58,12 @@
   	s->setTransportProperty(pcKey,pcValue);
   }
   
  +AXISC_STORAGE_CLASS_INFO const char * axiscGetTransportPropertyStub(AXISCHANDLE stub, const
char *key, 
  +	AxiscBool response) {
  +	Stub *s = (Stub*)stub;
  +	return s->getTransportProperty(key, (bool) response);
  +}
  +
   AXISC_STORAGE_CLASS_INFO const char * axiscGetFirstTransportPropertyKey(AXISCHANDLE stub)
{
   	Stub *s = (Stub*)stub;
   	return s->getFirstTransportPropertyKey();
  
  
  
  1.101     +6 -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.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- Call.cpp	4 Mar 2005 13:32:49 -0000	1.100
  +++ Call.cpp	4 Mar 2005 14:54:55 -0000	1.101
  @@ -361,6 +361,12 @@
       return iSuccess;
   }
   
  +const char* Call::getTransportProperty(const char *key, bool response) 
  +{
  +	if (m_pTransport) return m_pTransport->getTransportProperty(key,response);
  +	else return NULL;
  +}
  +
   int Call::setHandlerProperty(AxisChar* name, void* value, int len)
   {
   	// Unfortunately we have to cache the handler properties here
  
  
  
  1.38      +4 -0      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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- Stub.cpp	25 Feb 2005 13:07:39 -0000	1.37
  +++ Stub.cpp	4 Mar 2005 14:54:55 -0000	1.38
  @@ -76,6 +76,10 @@
           m_pTransport->setTransportProperty(pcKey, pcValue);
   }
   
  +const char* Stub::getTransportProperty(const char *key, bool response) 
  +{
  +	return m_pCall->getTransportProperty(key,response);
  +}
   
   const char* Stub::getFirstTransportPropertyKey()
   {
  
  
  
  1.16      +3 -1      ws-axis/c/src/transport/SOAPTransport.h
  
  Index: SOAPTransport.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/SOAPTransport.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- SOAPTransport.h	28 Feb 2005 15:31:05 -0000	1.15
  +++ SOAPTransport.h	4 Mar 2005 14:54:55 -0000	1.16
  @@ -256,10 +256,12 @@
        * @brief Gets any transport property in the arrived message
        *
        * @param pcKey The key of the transport property to get.
  +	 * @param response gets a property from the response message when true and
  +	 *                 from the send message when false
        * @return Value of the transport property if available. Returns null
        *         if unavailable.
        */
  -    virtual const char* getTransportProperty(const char* pcKey)=0;
  +    virtual const char* getTransportProperty(const char* pcKey, bool response=true)=0;
       /**
        * Sets a SOAP attachment to be sent with outgoing message. This
        * attachment is usually the base64 or hex encoded character buffer
  
  
  
  1.20      +7 -4      ws-axis/c/src/transport/axis3/HTTPTransport.cpp
  
  Index: HTTPTransport.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPTransport.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HTTPTransport.cpp	4 Mar 2005 13:31:13 -0000	1.19
  +++ HTTPTransport.cpp	4 Mar 2005 14:54:56 -0000	1.20
  @@ -1420,15 +1420,18 @@
       m_pActiveChannel->setSocket( uiNewSocket);
   }
   
  -const char * HTTPTransport::getTransportProperty( const char * pcKey) throw (HTTPTransportException)
  +const char * HTTPTransport::getTransportProperty( const char * pcKey, bool response) throw
(HTTPTransportException)
   {
       std::string strKeyToFind = std::string( pcKey);
  +	std::vector < std::pair < std::string, std::string > > *hdrs=NULL;
  +	if (response) hdrs = &m_vResponseHTTPHeaders;
  +	else hdrs = &m_vHTTPHeaders;
   
  -    for( unsigned int i = 0; i < m_vResponseHTTPHeaders.size(); i++)
  +    for( unsigned int i = 0; i < hdrs->size(); i++)
   	{
  -		if( m_vResponseHTTPHeaders[i].first == strKeyToFind)
  +		if( (*hdrs)[i].first == strKeyToFind)
   		{
  -			return ((string) m_vResponseHTTPHeaders[i].second).c_str();
  +			return (*hdrs)[i].second.c_str();
   		}
       }
   
  
  
  
  1.8       +1 -1      ws-axis/c/src/transport/axis3/HTTPTransport.hpp
  
  Index: HTTPTransport.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPTransport.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HTTPTransport.hpp	28 Feb 2005 15:30:33 -0000	1.7
  +++ HTTPTransport.hpp	4 Mar 2005 14:54:56 -0000	1.8
  @@ -54,7 +54,7 @@
       int						setTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE, const char *) throw
(HTTPTransportException);
       const char *			getTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE) throw (HTTPTransportException);
       int						setTransportProperty( const char *, const char *) throw (HTTPTransportException);
  -    const char *			getTransportProperty( const char * pcKey) throw (HTTPTransportException);
  +    const char *			getTransportProperty( const char * pcKey, bool response=true) throw
(HTTPTransportException);
       void					setSessionId( const char * pcSessionId);
       const char *			getSessionId();
       const char *			getServiceName ();
  
  
  
  1.74      +3 -0      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- ClientStubWriter.java	1 Mar 2005 07:01:51 -0000	1.73
  +++ ClientStubWriter.java	4 Mar 2005 14:54:56 -0000	1.74
  @@ -409,10 +409,13 @@
           {
               writer.write(";\n");
           }
  +        writer.write("\tif (NULL==m_pCall->getTransportProperty(\"SOAPAction\",false))\n");
  +        writer.write("\t{\n");
           writer.write(
               "\t\tm_pCall->setTransportProperty(SOAPACTION_HEADER , \""
                   + minfo.getSoapAction()
                   + "\");\n");
  +        writer.write("\t}\n");
           writer.write("\t\tm_pCall->setSOAPVersion(SOAP_VER_1_1);\n");
           //TODO check which version is it really.
           writer.write(
  
  
  
  1.75      +4 -1      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.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- ClientStubWriter.java	1 Mar 2005 07:01:51 -0000	1.74
  +++ ClientStubWriter.java	4 Mar 2005 14:54:56 -0000	1.75
  @@ -452,10 +452,13 @@
           {
               writer.write(";\n");
           }
  +        writer.write("\tif (NULL==m_pCall->getTransportProperty(\"SOAPAction\",false))\n");
  +        writer.write("\t{\n");
           writer.write(
  -            "\tm_pCall->setTransportProperty(SOAPACTION_HEADER , \""
  +            "\t\tm_pCall->setTransportProperty(SOAPACTION_HEADER , \""
                   + minfo.getSoapAction()
                   + "\");\n");
  +        writer.write("\t}\n");
           writer.write("\tm_pCall->setSOAPVersion(SOAP_VER_1_1);\n");
           //TODO check which version is it really.
           writer.write(
  
  
  

Mime
View raw message