1 /*
2  * EasySoap++ - A C++ library for SOAP (Simple Object Access Protocol)
3  * Copyright (C) 2001 David Crowley; SciTegic, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #include "WhichToolkitHandler.h"
21 
22 //
23 //  Return information about our toolkit
24 //
25 //
26 // Added an optional feature, not part of the validation test. We try to
27 // call a handler called whichToolkit. It takes no parameters and returns
28 // a struct containing the following elements, all strings: toolkitDocsUrl,
29 // toolkitName, toolkitVersion, toolkitOperatingSystem. If the call works,
30 // and all the elements are returned, we construct the string in the
31 // "software" column of the readout using this information. In previous
32 // versions we read the HTTP header for this information, often yielding
33 // the name of the server, and not the SOAP toolkit being used.
34 
35 void
whichToolkit(const SOAPMethod &,SOAPMethod & response)36 WhichToolkitHandler::whichToolkit(const SOAPMethod&, SOAPMethod& response)
37 {
38 	//response.SetName("whichToolkitResult");
39 	SOAPParameter& param = response.AddParameter("Result");
40 
41 	param.AddParameter("toolkitDocsUrl") << (const char *)EASYSOAP_HOMEPAGE;
42 	param.AddParameter("toolkitName") << (const char *)EASYSOAP_STRING;
43 	param.AddParameter("toolkitVersion") << (const char *)EASYSOAP_VERSION_STRING;
44 	param.AddParameter("toolkitOperatingSystem") <<
45 	// TODO: This is a bit broken...
46 #ifdef _WIN32
47 		(const char *)"Windows 2000";
48 #else
49 		(const char *)"Linux";
50 #endif
51 	param.SetIsStruct();
52 }
53