axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ros...@apache.org
Subject cvs commit: ws-axis/c/src/wsdd WSDDDeployment.h WSDDDeployment.cpp
Date Thu, 16 Oct 2003 12:31:06 GMT
roshan      2003/10/16 05:31:05

  Modified:    c/src/wsdd WSDDDeployment.h WSDDDeployment.cpp
  Log:
  added code to support deployment tool
  
  Revision  Changes    Path
  1.10      +3 -2      ws-axis/c/src/wsdd/WSDDDeployment.h
  
  Index: WSDDDeployment.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdd/WSDDDeployment.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WSDDDeployment.h	15 Oct 2003 06:11:30 -0000	1.9
  +++ WSDDDeployment.h	16 Oct 2003 12:31:05 -0000	1.10
  @@ -74,17 +74,18 @@
   #include "WSDDService.h"
   #include "WSDDHandler.h"
   #include "WSDDTransport.h"
  +#include "../common/IDeployerUtils.h"
   
   #include <list>
   
   using namespace std;
   
  -class WSDDDeployment  
  +class WSDDDeployment : public IDeployerUtils
   {
   	friend class WSDDDocument;
   public:
   	int LoadWSDD(const AxisChar* sWSDD);
  -	int UpdateWSDD(const AxisChar* sWSDDNew);
  +	int UpdateWSDD(const AxisChar* sWSDDNew, string sServiceName, string sDllPath, Axis_ArrayTag
inArray);
   	const AxisChar* GetLibName(int nLibId);
   	const WSDDService* GetService(const AxisChar* sServiceName);
   	const WSDDHandlerList* GetGlobalRequestFlowHandlers();
  
  
  
  1.12      +149 -3    ws-axis/c/src/wsdd/WSDDDeployment.cpp
  
  Index: WSDDDeployment.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdd/WSDDDeployment.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSDDDeployment.cpp	4 Oct 2003 17:22:52 -0000	1.11
  +++ WSDDDeployment.cpp	16 Oct 2003 12:31:05 -0000	1.12
  @@ -58,6 +58,7 @@
    *
    *
    * @author Sanjaya Singharage
  + * @author Roshan Weerasuriya (roshan@jkcs.slt.lk, roshan@opensource.lk)
    *
    */
   
  @@ -68,6 +69,7 @@
   #include "WSDDDeployment.h"
   #include "WSDDDocument.h"
   #include "../common/GDefine.h"
  +#include "../common/AxisConfig.h"
   
   extern unsigned char chEBuf[1024];
   //////////////////////////////////////////////////////////////////////
  @@ -147,9 +149,153 @@
   	return SUCCESS;
   }
   
  -int WSDDDeployment::UpdateWSDD(const AxisChar* sWSDDNew)
  +int WSDDDeployment::UpdateWSDD(const AxisChar* sWSDDNew, string sServiceName, string sDllPath,
Axis_ArrayTag inAllowedMethodsArray)
   {
  -	//TODO
  +	printf("entered again to UpdateWSDD \n");
  +	printf("sServiceName = %s \n", sServiceName.c_str());
  +	printf("sDllPath = %s \n", sDllPath.c_str());	
  +
  +	const AxisChar* pAchServiceName;
  +	const AxisChar* pAchLibName;
  +	list<AxisString> lstAllowedMethods;
  +
  +	WSDDServiceMap::iterator itCurrService;
  +
  +	FILE* file;
  +	int iStatus = SUCCESS;
  +
  +	do {
  +		file = fopen("C:/Axis/conf/server.wsdd", "w");
  +		if(file) {
  +			printf("opened the file successfully\n");
  +		} else {
  +			printf("FAILED: couldn't open the file successfully\n\n");
  +			iStatus = FAIL;
  +			break;
  +		}
  +
  +		int iWriteResult = 0;
  +		
  +		iWriteResult = fputs("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", file);
  +		if (iWriteResult<0) {
  +			printf("writing to the file is UNSUCCESSFULL\n");
  +			iStatus = FAIL;
  +			break;
  +		} else {
  +			printf("writing to the file is SUCCESSFULL\n");
  +		}
  +
  +		iWriteResult = fputs("<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\n",
file);
  +		if (iWriteResult<0) {
  +			printf("writing to the file is UNSUCCESSFULL\n");
  +			iStatus = FAIL;
  +			break;
  +		} else {
  +			printf("writing to the file is SUCCESSFULL\n");
  +		}
  +
  +		if(m_DeployedServices)
  +		{
  +			for(itCurrService=m_DeployedServices->begin()
  +					;itCurrService!=m_DeployedServices->end();itCurrService++)
  +			{
  +				const WSDDService* pWSDDService = (*itCurrService).second;
  +				AxisChar achTmpChar[1000] = {0};
  +				pAchServiceName = pWSDDService->GetServiceName();
  +				pAchLibName = pWSDDService->GetLibName();
  +				lstAllowedMethods = pWSDDService->getAllowedMethods();				
  +								
  +				printf("pAchServiceName = %s\n", pAchServiceName);
  +				printf("pAchLibName = %s\n", pAchLibName);
  +				
  +				strcat(achTmpChar, " <service name=\"");
  +				strcat(achTmpChar, pAchServiceName);
  +				strcat(achTmpChar, "\" provider=\"java:RPC\">\n");
  +				strcat(achTmpChar, "  <parameter name=\"className\" value=\"");
  +				strcat(achTmpChar, pAchLibName);
  +				strcat(achTmpChar, "\"/>\n");
  +				strcat(achTmpChar, "  <parameter name=\"allowedMethods\" value=\"");	
  +				
  +				list<AxisString>::iterator iteAllowedMethods = lstAllowedMethods.begin();
  +				while (iteAllowedMethods != lstAllowedMethods.end()) {	
  +					
  +					printf("sAllowedMethod = %s\n", (*iteAllowedMethods).c_str());					
  +					const AxisChar* tmpChar = (*iteAllowedMethods).c_str();
  +					strcat(achTmpChar, tmpChar);
  +					if(iteAllowedMethods != lstAllowedMethods.end()) {
  +						strcat(achTmpChar, " ");
  +					}
  +										
  +					iteAllowedMethods++;
  +				}
  +
  +				strcat(achTmpChar, "\"/>\n </service>\n");
  +
  +				iWriteResult = fputs(achTmpChar, file);
  +				if (iWriteResult<0) {
  +					printf("writing to the file is UNSUCCESSFULL\n");
  +					iStatus = FAIL;
  +					break;
  +				} else {
  +					printf("writing to the file is SUCCESSFULL\n");
  +				}				
  +			}
  +		}
  +
  +		/*
  +		 *New web service details which is to deploy
  +		 */
  +		AxisChar achTmpChar[1000] = {0};
  +		strcat(achTmpChar, " <service name=\"");
  +		strcat(achTmpChar, sServiceName.c_str());
  +		strcat(achTmpChar, "\" provider=\"java:RPC\">\n");
  +		strcat(achTmpChar, "  <parameter name=\"className\" value=\"");
  +		strcat(achTmpChar, sDllPath.c_str());
  +		strcat(achTmpChar, "\"/>\n");
  +		strcat(achTmpChar, "  <parameter name=\"allowedMethods\" value=\"");
  +
  +		string* sAllowedMethods = (string*)inAllowedMethodsArray.m_Array;
  +		for (int i=0; i<inAllowedMethodsArray.m_Size; i++ ) {
  +			printf("Allowed method = %s\n", (sAllowedMethods[i]).c_str());
  +			strcat(achTmpChar, (sAllowedMethods[i]).c_str());
  +			if(i != ((inAllowedMethodsArray.m_Size)-1)) {
  +				strcat(achTmpChar, " ");
  +			}
  +			i++;
  +		}
  +
  +		strcat(achTmpChar, "\"/>\n </service>\n");
  +
  +		iWriteResult = fputs(achTmpChar, file);
  +		if (iWriteResult<0) {
  +			printf("writing to the file is UNSUCCESSFULL\n");
  +			iStatus = FAIL;
  +			break;
  +		} else {
  +			printf("writing to the file is SUCCESSFULL\n");
  +		}		
  +		
  +		/*
  +		 *--------------------------------------------
  +		 */
  +
  +		
  +		iWriteResult = fputs("</deployment>", file);
  +		if (iWriteResult<0) {
  +			printf("writing to the file is UNSUCCESSFULL\n");
  +			iStatus = FAIL;
  +			break;
  +		} else {
  +			printf("writing to the file is SUCCESSFULL\n");
  +		}
  +		
  +		
  +	} while (0);
  +
  +	fclose(file);
  +
  +	LoadWSDD("C:/Axis/conf/server.wsdd");
  +
   	return SUCCESS;
   }
   
  @@ -236,4 +382,4 @@
   int WSDDDeployment::RemoveHandler(bool bGlobal, bool bRequestFlow, WSDDHandler* pHandler,
AXIS_PROTOCOL_TYPE protocol)
   {
   	return SUCCESS;	
  -}
  +}
  \ No newline at end of file
  
  
  

Mime
View raw message