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 su...@apache.org on 2003/09/29 05:32:36 UTC

cvs commit: ws-axis/c/src/server/simple_axis_server SimpleAxisServer.cpp

susantha    2003/09/28 20:32:36

  Modified:    c/src/server/simple_axis_server SimpleAxisServer.cpp
  Log:
  Changed code so that AxisEngine initialization and uninitialization happens only once
  
  Revision  Changes    Path
  1.5       +35 -30    ws-axis/c/src/server/simple_axis_server/SimpleAxisServer.cpp
  
  Index: SimpleAxisServer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/server/simple_axis_server/SimpleAxisServer.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SimpleAxisServer.cpp	27 Sep 2003 08:33:28 -0000	1.4
  +++ SimpleAxisServer.cpp	29 Sep 2003 03:32:36 -0000	1.5
  @@ -28,35 +28,6 @@
   const char *pcHttpBody;
   int iClntSocket;
   
  -int executeWork() {
  -
  -	Ax_soapstream* str = (Ax_soapstream*)malloc(sizeof(Ax_soapstream));
  -	str->trtype = APTHTTP;
  -	str->sessionid = "somesessionid";
  -	str->so.http.ip_method = AXIS_HTTP_POST;
  -	str->str.ip_stream = "is";
  -	str->str.op_stream = "os";
  -	str->so.http.ip_headers = (Ax_header*)malloc(sizeof(Ax_header));
  -//	str->so.http.ip_headers->headername = SOAPACTIONHEADER;
  -//	str->so.http.ip_headers->headervalue = "\"Calculator\"";	
  -	str->so.http.ip_headercount = 0;
  -	str->so.http.uri_path = "http://someurl/axis/Calculator";
  -
  -	//DEBUG line
  -	//printf("soap request :\n %s\n", echoBuffer);
  -//	wprintf(L"soap request :\n %s\n", ip);
  -
  -	initialize_module(1, WSDDFILEPATH);
  -	
  -	process_request(str);	
  -	
  -	uninitialize_module();
  -	free(str->so.http.ip_headers);
  -	free(str);
  -
  -	return 0;
  -}
  -
   int send_response_bytes(const char * res, const void* opstream) 
   {	
   	//printf("calling send_response_bytes");
  @@ -96,6 +67,36 @@
   	return 0;
   }
   
  +int executeWork() {
  +
  +	Ax_soapstream* str = (Ax_soapstream*)malloc(sizeof(Ax_soapstream));
  +	str->trtype = APTHTTP;
  +	str->sessionid = "somesessionid";
  +	str->so.http.ip_method = AXIS_HTTP_POST;
  +	str->str.ip_stream = "is";
  +	str->str.op_stream = "os";
  +	str->so.http.ip_headers = (Ax_header*)malloc(sizeof(Ax_header));
  +//	str->so.http.ip_headers->headername = SOAPACTIONHEADER;
  +//	str->so.http.ip_headers->headervalue = "\"Calculator\"";	
  +	str->so.http.ip_headercount = 0;
  +	str->so.http.uri_path = "http://someurl/axis/Calculator";
  +
  +	//set transport
  +	str->transport.pSendFunct = send_response_bytes;
  +	str->transport.pGetFunct = get_request_bytes;
  +	str->transport.pSendTrtFunct = (AXIS_SEND_TRANSPORT_INFORMATION)send_transport_information;
  +	//DEBUG line
  +	//printf("soap request :\n %s\n", echoBuffer);
  +//	wprintf(L"soap request :\n %s\n", ip);
  +
  +	process_request(str);	
  +
  +	free(str->so.http.ip_headers);
  +	free(str);
  +
  +	return 0;
  +}
  +
   void printError() {
   
   	#ifdef WIN32
  @@ -275,7 +276,9 @@
   		}
   	}
   	///////////////
  -
  +	
  +	initialize_module(1, WSDDFILEPATH);
  +	
   	while (running) {
   		FD_ZERO(&sockSet);
   		FD_SET(servSock[0], &sockSet);	
  @@ -301,6 +304,8 @@
   		//DEBUG info
   		//printf("end of main while\n");
   	}
  +
  +	uninitialize_module();
   
   	/* Close sockets */
       for (iPort = 0; iPort < noPorts; iPort++) {