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 di...@apache.org on 2005/03/22 16:55:40 UTC

cvs commit: ws-axis/c/include/axis/client Stub.hpp

dims        2005/03/22 07:55:40

  Modified:    c/include/axis/client Stub.hpp
  Log:
  Making getCall public allows one to write code using the lower level API directly. See example that can invoke Google Search API's doSpellingSuggestion method.
  
      Stub *pStub = new Stub("http://api.google.com/search/beta2", APTHTTP1_1);
      Call *pCall = pStub->getCall();
      pCall->initialize(CPP_RPC_PROVIDER);
  
  	if (NULL==pCall->getTransportProperty("SOAPAction",false))
  	{
  		pCall->setTransportProperty(SOAPACTION_HEADER , "urn:GoogleSearchAction");
  	}
  	pCall->setSOAPVersion(SOAP_VER_1_1);
  	pCall->setOperation("doSpellingSuggestion", "urn:GoogleSearch");
  	pCall->addParameter((void*)"xxxxxxxxxxxxxxxxxxx", "key", XSD_STRING);
  	pCall->addParameter((void*)"conection", "phrase", XSD_STRING);
  	if (AXIS_SUCCESS == pCall->invoke())
  	{
  		if(AXIS_SUCCESS == pCall->checkMessage("doSpellingSuggestionResponse", "urn:GoogleSearch"))
  		{
  			cout << "doSpellingSuggestionResponse returns:"  << pCall->getElementAsString("_return", 0);
  		}
  	}
  	pCall->unInitialize();
      delete pStub;
  
  Revision  Changes    Path
  1.19      +6 -6      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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Stub.hpp	4 Mar 2005 20:57:38 -0000	1.18
  +++ Stub.hpp	22 Mar 2005 15:55:40 -0000	1.19
  @@ -646,6 +646,12 @@
       */
       const char* getPassword();
   
  +  /**
  +    * Call object of the Stub. This is the point of access to the internals
  +    * of the Axis engine.
  +    */
  +    Call *getCall() { return m_pCall; }
  +
     protected:
     /**
       * Apply user set preferences to each call made on the Stub object.
  @@ -669,12 +675,6 @@
       void setSOAPMethodAttributes();
   
     /**
  -    * Call object of the Stub. This is the point of access to the internals
  -    * of the Axis engine.
  -    */
  -    Call *getCall() { return m_pCall; }
  -
  -  /**
       * Set Authorization header for basic authentication
       */
       void setAuthorizationHeader();