first commit

This commit is contained in:
2025-11-25 10:55:38 +07:00
commit 88ebdb465c
57 changed files with 9213 additions and 0 deletions

108
test/FileClient.cpp Normal file
View File

@@ -0,0 +1,108 @@
// FileClient.cpp : A simple xmlrpc client. Usage: FileClient serverHost serverPort xmlfile
// Reads an xmlrpc request from the specified xmlfile and calls the method on the server.
//
// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows)
#include "XmlRpc.h"
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace XmlRpc;
std::string parseRequest(std::string const& xml, XmlRpcValue& params);
int main(int argc, char* argv[])
{
if (argc != 4) {
std::cerr << "Usage: FileClient serverHost serverPort requestXmlFile\n";
return -1;
}
int port = atoi(argv[2]);
XmlRpc::setVerbosity(5);
XmlRpcClient c(argv[1], port);
//
std::ifstream infile(argv[3]);
if (infile.fail()) {
std::cerr << "Could not open file '" << argv[3] << "'.\n";
return -1;
}
// Suck in the file. This is a one-liner in good compilers (which vc++ 6 is not)...
infile.seekg(0L, std::ios::end);
long nb = infile.tellg();
infile.clear();
infile.seekg(0L);
char* b = new char[nb+1];
infile.read(b, nb);
b[nb] = 0;
std::cout << "Read file.\n";
// Find the methodName and parse the params
std::string s(b);
XmlRpcValue params;
std::string name = parseRequest(s, params);
if (name.empty()) {
std::cerr << "Could not parse file\n";
return -1;
}

96
test/FileClient.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="FileClient" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=FileClient - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "FileClient.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "FileClient.mak" CFG="FileClient - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "FileClient - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "FileClient - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "FileClient - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

164
test/FileClient.vcproj Normal file
View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="FileClient"
ProjectGUID="{C3B49855-CD45-448E-991E-3E4C9B02F465}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/FileClient.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/FileClient.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/FileClient.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/FileClient.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/FileClient.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/FileClient.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/FileClient.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/FileClient.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/FileClient.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/FileClient.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/FileClient.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/FileClient.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/FileClient.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/FileClient.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\FileClient.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

85
test/HelloClient.cpp Normal file
View File

@@ -0,0 +1,85 @@
// HelloClient.cpp : A simple xmlrpc client. Usage: HelloClient serverHost serverPort
// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib
// on windows)
#include "XmlRpc.h"
#include <iostream>
using namespace XmlRpc;
int main(int argc, char* argv[])
{
if (argc != 3) {
std::cerr << "Usage: HelloClient serverHost serverPort\n";
return -1;
}
int port = atoi(argv[2]);
//XmlRpc::setVerbosity(5);
// Use introspection API to look up the supported methods
XmlRpcClient c(argv[1], port);
XmlRpcValue noArgs, result;
if (c.execute("system.listMethods", noArgs, result))
std::cout << "\nMethods:\n " << result << "\n\n";
else
std::cout << "Error calling 'listMethods'\n\n";
// Use introspection API to get the help string for the Hello method
XmlRpcValue oneArg;
oneArg[0] = "Hello";
if (c.execute("system.methodHelp", oneArg, result))
std::cout << "Help for 'Hello' method: " << result << "\n\n";
else
std::cout << "Error calling 'methodHelp'\n\n";
// Call the Hello method
if (c.execute("Hello", noArgs, result))
std::cout << result << "\n\n";
else
std::cout << "Error calling 'Hello'\n\n";
// Call the HelloName method
oneArg[0] = "Chris";
if (c.execute("HelloName", oneArg, result))
std::cout << result << "\n\n";
else
std::cout << "Error calling 'HelloName'\n\n";
// Add up an array of numbers
XmlRpcValue numbers;
numbers[0] = 33.33;
numbers[1] = 112.57;
numbers[2] = 76.1;
std::cout << "numbers.size() is " << numbers.size() << std::endl;
if (c.execute("Sum", numbers, result))
std::cout << "Sum = " << double(result) << "\n\n";
else
std::cout << "Error calling 'Sum'\n\n";
// Test the "no such method" fault
if (c.execute("NoSuchMethod", numbers, result))
std::cout << "NoSuchMethod call: fault: " << c.isFault() << ", result = " << result << std::endl;
else
std::cout << "Error calling 'Sum'\n";
// Test the multicall method. It accepts one arg, an array of structs
XmlRpcValue multicall;
multicall[0][0]["methodName"] = "Sum";
multicall[0][0]["params"][0] = 5.0;
multicall[0][0]["params"][1] = 9.0;
multicall[0][1]["methodName"] = "NoSuchMethod";
multicall[0][1]["params"][0] = "";
multicall[0][2]["methodName"] = "Sum";
// Missing params
multicall[0][3]["methodName"] = "Sum";
multicall[0][3]["params"][0] = 10.5;
multicall[0][3]["params"][1] = 12.5;
if (c.execute("system.multicall", multicall, result))
std::cout << "\nmulticall result = " << result << std::endl;
else
std::cout << "\nError calling 'system.multicall'\n";
return 0;
}

96
test/HelloClient.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="HelloClient" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=HelloClient - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "HelloClient.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "HelloClient.mak" CFG="HelloClient - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "HelloClient - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "HelloClient - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "HelloClient - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

164
test/HelloClient.vcproj Normal file
View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="HelloClient"
ProjectGUID="{F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/HelloClient.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/HelloClient.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/HelloClient.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/HelloClient.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/HelloClient.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/HelloClient.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/HelloClient.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/HelloClient.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/HelloClient.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 &quot;c:\home\cmm\dev\sourceforge\xmlrpc++\Debug\xmlrpc.lib&quot;"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/HelloClient.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/HelloClient.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/HelloClient.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/HelloClient.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386 &quot;c:\home\cmm\dev\sourceforge\xmlrpc++\Debug\xmlrpc.lib&quot;"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/HelloClient.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\HelloClient.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

82
test/HelloServer.cpp Normal file
View File

@@ -0,0 +1,82 @@
// HelloServer.cpp : Simple XMLRPC server example. Usage: HelloServer serverPort
//
#include "XmlRpc.h"
#include <iostream>
#include <stdlib.h>
using namespace XmlRpc;
// The server
XmlRpcServer s;
// No arguments, result is "Hello".
class Hello : public XmlRpcServerMethod
{
public:
Hello(XmlRpcServer* s) : XmlRpcServerMethod("Hello", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
result = "Hello";
}
std::string help() { return std::string("Say hello"); }
} hello(&s); // This constructor registers the method with the server
// One argument is passed, result is "Hello, " + arg.
class HelloName : public XmlRpcServerMethod
{
public:
HelloName(XmlRpcServer* s) : XmlRpcServerMethod("HelloName", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::string resultString = "Hello, ";
resultString += std::string(params[0]);
result = resultString;
}
} helloName(&s);
// A variable number of arguments are passed, all doubles, result is their sum.
class Sum : public XmlRpcServerMethod
{
public:
Sum(XmlRpcServer* s) : XmlRpcServerMethod("Sum", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
int nArgs = params.size();
double sum = 0.0;
for (int i=0; i<nArgs; ++i)
sum += double(params[i]);
result = sum;
}
} sum(&s);
int main(int argc, char* argv[])
{
if (argc != 2) {
std::cerr << "Usage: HelloServer serverPort\n";
return -1;
}
int port = atoi(argv[1]);
XmlRpc::setVerbosity(5);
// Create the server socket on the specified port
s.bindAndListen(port);
// Enable introspection
s.enableIntrospection(true);
// Wait for requests indefinitely
s.work(-1.0);
return 0;
}

96
test/HelloServer.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="HelloServer" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=HelloServer - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "HelloServer.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "HelloServer.mak" CFG="HelloServer - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "HelloServer - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "HelloServer - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "HelloServer - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

164
test/HelloServer.vcproj Normal file
View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="HelloServer"
ProjectGUID="{08C4FFA8-A9E5-4EEA-9703-53C293C2F724}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/HelloServer.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/HelloServer.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/HelloServer.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/HelloServer.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/HelloServer.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/HelloServer.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/HelloServer.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/HelloServer.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/HelloServer.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/HelloServer.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/HelloServer.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/HelloServer.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/HelloServer.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/HelloServer.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\HelloServer.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

26
test/Makefile Normal file
View File

@@ -0,0 +1,26 @@
# makefile written for gnu make
CXX = /usr/local/gcc-3.1/bin/g++
SRC = ../src
CPPFLAGS = -I$(SRC)
DEBUG = -g
#OPTIMIZE = -O2
GCCWARN = -Wall -Wstrict-prototypes
CXXFLAGS = $(DEBUG) $(GCCWARN) $(OPTIMIZE) $(INCLUDES)
LIB = ../libXmlRpc.a
# Add your system-dependent network libs here
# Solaris: -lsocket -lnsl
SYSTEMLIBS =
LDLIBS = $(SYSTEMLIBS) $(LIB)
TESTS = HelloClient HelloServer TestBase64Client TestBase64Server TestValues TestXml Validator
all: $(TESTS)
$(TESTS): $(LIB)
clean:
rm -f *.o
rm -f $(TESTS)

45
test/TestBase64Client.cpp Normal file
View File

@@ -0,0 +1,45 @@
// TestBase64Client.cpp : A simple xmlrpc client that returns a png file
// encoded as base64 data to the client.
//
// Usage: TestBase64Client serverHost serverPort outputfile
// Requests a png file from the specified server and saves it in outputfile.
// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows)
#include "XmlRpc.h"
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace XmlRpc;
int main(int argc, char* argv[])
{
if (argc != 4) {
std::cerr << "Usage: TestBase64Client serverHost serverPort outputFile\n";
return -1;
}
int port = atoi(argv[2]);
//XmlRpc::setVerbosity(5);

96
test/TestBase64Client.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="TestBase64Client" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=TestBase64Client - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TestBase64Client.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TestBase64Client.mak" CFG="TestBase64Client - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TestBase64Client - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "TestBase64Client - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "TestBase64Client - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="TestBase64Client"
ProjectGUID="{1E8B725B-E898-494C-84C6-DB77EF38E6CB}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/TestBase64Client.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/TestBase64Client.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/TestBase64Client.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/TestBase64Client.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/TestBase64Client.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/TestBase64Client.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/TestBase64Client.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/TestBase64Client.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/TestBase64Client.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/TestBase64Client.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/TestBase64Client.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/TestBase64Client.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/TestBase64Client.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/TestBase64Client.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\TestBase64Client.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

68
test/TestBase64Server.cpp Normal file
View File

@@ -0,0 +1,68 @@
// TestBase64Server.cpp : Simple XMLRPC server example. Usage: TestBase64Server serverPort
//
#if defined(_MSC_VER)
# pragma warning(disable:4786) // identifier was truncated in debug info
#endif
#include <iostream>
#include <fstream>
#include <algorithm>
#include <stdlib.h>
#include "XmlRpc.h"
using namespace XmlRpc;
// The server
XmlRpcServer s;
// No arguments, result is Base64-encoded pngnow.png data.
class TestBase64 : public XmlRpcServerMethod
{
public:
TestBase64(XmlRpcServer* s) : XmlRpcServerMethod("TestBase64", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::ifstream infile("pngnow.png", std::ios::binary);
if (infile.fail())
infile.open("../pngnow.png", std::ios::binary);
if (infile.fail())
result = "Could not open file pngnow.png";
else {

96
test/TestBase64Server.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="TestBase64Server" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=TestBase64Server - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TestBase64Server.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TestBase64Server.mak" CFG="TestBase64Server - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TestBase64Server - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "TestBase64Server - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "TestBase64Server - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /Fr /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="TestBase64Server"
ProjectGUID="{D3107CC6-6300-47DE-B183-255B75CFE85A}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/TestBase64Server.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/TestBase64Server.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/TestBase64Server.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/TestBase64Server.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/TestBase64Server.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/TestBase64Server.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/TestBase64Server.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/TestBase64Server.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/TestBase64Server.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/TestBase64Server.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/TestBase64Server.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/TestBase64Server.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib Ws2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/TestBase64Server.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/TestBase64Server.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\TestBase64Server.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

233
test/TestValues.cpp Normal file
View File

@@ -0,0 +1,233 @@
// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues.
#include <stdlib.h>
#include "XmlRpcValue.h"
#include <assert.h>
#include <iostream>
using namespace XmlRpc;
void testBoolean()
{
XmlRpcValue booleanFalse(false);
XmlRpcValue booleanTrue(true);
int offset = 0;
XmlRpcValue booleanFalseXml("<value><boolean>0</boolean></value>", &offset);
offset = 0;
XmlRpcValue booleanTrueXml("<value><boolean>1</boolean></value>", &offset);
assert(booleanFalse != booleanTrue);
assert(booleanFalse == booleanFalseXml);
assert(booleanFalse != booleanTrueXml);
if (bool(booleanFalse))
assert(false);
if ( ! bool(booleanTrue))
assert(false);
}
// Int
void testInt()
{
XmlRpcValue int0(0);
XmlRpcValue int1(1);
XmlRpcValue int10(10);
XmlRpcValue int_1(-1);
int offset = 0;
XmlRpcValue int0Xml("<value><int>0</int></value>", &offset);
offset = 0;
XmlRpcValue int9Xml("<value><i4>9</i4></value>", &offset);
assert(int0 == int0Xml);
assert(int(int10) - int(int1) == int(int9Xml));
assert(9 == int(int9Xml));
assert(int(int10) + int(int_1) == int(int9Xml));
}
void testDouble()
{
// Double
XmlRpcValue d(43.7);
int offset = 0;
XmlRpcValue dXml("<value><double>56.3</double></value>", &offset);
assert(double(d) + double(dXml) == 100.0); // questionable practice...
}
void testString()
{
// String
XmlRpcValue s("Now is the time <&");
char csxml[] = "<value><string>Now is the time &lt;&amp;</string></value>";
std::string ssxml = csxml;
int offset = 0;
XmlRpcValue vscXml(csxml, &offset);
offset = 0;
XmlRpcValue vssXml(ssxml, &offset);
assert(s == vscXml);
assert(s == vssXml);
offset = 0;
XmlRpcValue fromXml(vssXml.toXml(), &offset);
assert(s == fromXml);
// Empty or blank strings with no <string> tags
std::string emptyStringXml("<value></value>");
offset = 0;
XmlRpcValue emptyStringVal1(emptyStringXml, &offset);
XmlRpcValue emptyStringVal2("");
assert(emptyStringVal1 == emptyStringVal2);
emptyStringXml = "<value> </value>";
offset = 0;
XmlRpcValue blankStringVal(emptyStringXml, &offset);
assert(std::string(blankStringVal) == " ");
}
void testDateTime()
{
// DateTime
int offset = 0;
XmlRpcValue dateTime("<value><dateTime.iso8601>19040101T03:12:35</dateTime.iso8601></value>", &offset);
struct tm &t = dateTime;
assert(t.tm_year == 1904 && t.tm_min == 12);
}
void testArray(XmlRpcValue const& d)
{
// Array
XmlRpcValue a;
a.setSize(4);
a[0] = 1;
a[1] = std::string("two");
a[2] = 43.7;
a[3] = "four";
assert(int(a[0]) == 1);
assert(a[2] == d);
char csaXml[] =
"<value><array>\n"
" <data>\n"
" <value><i4>1</i4></value> \n"
" <value> <string>two</string></value>\n"
" <value><double>43.7</double></value>\n"

95
test/TestValues.dsp Normal file
View File

@@ -0,0 +1,95 @@
# Microsoft Developer Studio Project File - Name="TestValues" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=TestValues - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TestValues.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TestValues.mak" CFG="TestValues - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TestValues - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "TestValues - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "TestValues - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe

162
test/TestValues.vcproj Normal file
View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="TestValues"
ProjectGUID="{6181BBE3-DA50-4EEE-8D52-1F4245A1D603}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/TestValues.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /YX&quot;StdAfx.h&quot; /Fp&quot;.\Release/TestValues.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TP"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\Release/TestValues.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/TestValues.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/TestValues.exe&quot; /INCREMENTAL:NO odbc32.lib odbccp32.lib /PDB:&quot;.\Release/TestValues.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/TestValues.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/TestValues.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/TestValues.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/TestValues.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/TestValues.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/TestValues.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/TestValues.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/TestValues.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\TestValues.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

253
test/TestValuesWin32.cpp Normal file
View File

@@ -0,0 +1,253 @@
// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues.
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include "XmlRpcValue.h"
#include <assert.h>
#include <iostream>
using namespace XmlRpc;
void testBoolean()
{
XmlRpcValue booleanFalse(false);
XmlRpcValue booleanTrue(true);
int offset = 0;
XmlRpcValue booleanFalseXml("<value><boolean>0</boolean></value>", &offset);
offset = 0;
XmlRpcValue booleanTrueXml("<value><boolean>1</boolean></value>", &offset);
assert(booleanFalse != booleanTrue);
assert(booleanFalse == booleanFalseXml);
assert(booleanFalse == booleanFalseXml);
if (booleanFalse)
assert(false);
if (booleanTrue)
assert( ! false);
else
assert(false);
}
// Int
void testInt()
{
XmlRpcValue int0(0);
XmlRpcValue int1(1);
XmlRpcValue int10(10);
XmlRpcValue int_1(-1);
int offset = 0;
XmlRpcValue int0Xml("<value><int>0</int></value>", &offset);
offset = 0;
XmlRpcValue int9Xml("<value><i4>9</i4></value>", &offset);
assert(int0 == int0Xml);
assert(int(int10) - int(int1) == int(int9Xml));
assert(9 == int(int9Xml));
assert(int(int10) + int(int_1) == int(int9Xml));
}
void testDouble()
{
// Double
XmlRpcValue d(43.7);
int offset = 0;
XmlRpcValue dXml("<value><double>56.3</double></value>", &offset);
assert(double(d) + double(dXml) == 100.0); // questionable practice...
}
void testString()
{
// String
XmlRpcValue s("Now is the time <&");
char csxml[] = "<value><string>Now is the time &lt;&amp;</string></value>";
std::string ssxml = csxml;
int offset = 0;
XmlRpcValue vscXml(csxml, &offset);
offset = 0;
XmlRpcValue vssXml(ssxml, &offset);
assert(s == vscXml);
assert(s == vssXml);
offset = 0;
XmlRpcValue fromXml(vssXml.toXml(), &offset);
assert(s == fromXml);
// Empty or blank strings with no <string> tags
std::string emptyStringXml("<value></value>");
offset = 0;
XmlRpcValue emptyStringVal1(emptyStringXml, &offset);
XmlRpcValue emptyStringVal2("");
assert(emptyStringVal1 == emptyStringVal2);
emptyStringXml = "<value> </value>";
offset = 0;
XmlRpcValue blankStringVal(emptyStringXml, &offset);
assert(std::string(blankStringVal) == " ");
}
void testDateTime()
{
// DateTime
int offset = 0;
XmlRpcValue dateTime("<value><dateTime.iso8601>19040101T03:12:35</dateTime.iso8601></value>", &offset);
struct tm &t = dateTime;
assert(t.tm_year == 1904 && t.tm_min == 12);
}
void testArray(XmlRpcValue const& d)
{
// Array
XmlRpcValue a;
a.setSize(4);
a[0] = 1;
a[1] = std::string("two");
a[2] = 43.7;
a[3] = "four";
assert(int(a[0]) == 1);
assert(a[2] == d);
char csaXml[] =
"<value><array>\n"
" <data>\n"
" <value><i4>1</i4></value> \n"
" <value> <string>two</string></value>\n"
" <value><double>43.7</double></value>\n"
" <value>four</value>\n"
" </data>\n"
"</array></value>";
int offset = 0;
XmlRpcValue aXml(csaXml, &offset);
assert(a == aXml);

53
test/TestXml.cpp Normal file
View File

@@ -0,0 +1,53 @@
// TestXml.cpp : Test XML encoding and decoding.
// The characters <>&'" are illegal in xml and must be encoded.
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <iostream>
// If you are using MSVC++6, you should update <string> to fix
// BUG: getline Template Function Reads Extra Character
#include <string>
#include <assert.h>
#include <stdlib.h>
#include "XmlRpcUtil.h"
using namespace XmlRpc;
int main(int argc, char* argv[])
{
// Basic tests
std::string empty;
assert(empty == XmlRpcUtil::xmlEncode(empty));
assert(empty == XmlRpcUtil::xmlDecode(empty));
assert(empty == XmlRpcUtil::xmlEncode(""));
assert(empty == XmlRpcUtil::xmlDecode(""));

96
test/TestXml.dsp Normal file
View File

@@ -0,0 +1,96 @@
# Microsoft Developer Studio Project File - Name="TestXml" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=TestXml - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "TestXml.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "TestXml.mak" CFG="TestXml - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "TestXml - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "TestXml - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "TestXml - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"

164
test/TestXml.vcproj Normal file
View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="TestXml"
ProjectGUID="{6F0C2ADA-0341-4183-8FAA-576668F1788A}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Release/TestXml.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /I &quot;..\src&quot; /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Fp&quot;.\Release/TestXml.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib odbc32.lib odbccp32.lib"
OutputFile=".\Release/TestXml.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\release"
ProgramDatabaseFile=".\Release/TestXml.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/TestXml.exe&quot; /INCREMENTAL:NO /LIBPATH:&quot;..\release&quot; xmlrpc.lib odbc32.lib odbccp32.lib /PDB:&quot;.\Release/TestXml.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/TestXml.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/TestXml.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/TestXml.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/TestXml.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\Debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/TestXml.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/TestXml.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\Debug&quot; xmlrpc.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/TestXml.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/TestXml.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\TestXml.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

207
test/Validator.cpp Normal file
View File

@@ -0,0 +1,207 @@
// Validator.cpp : XMLRPC server based on the compliancy test at validator.xmlrpc.com.
//
#include "XmlRpc.h"
using namespace XmlRpc;
#include <iostream>
XmlRpcServer s;
// One argument is passed, an array of structs, each with a member named curly with
// an integer value. Return the sum of those values.
class ArrayOfStructsTest : public XmlRpcServerMethod
{
public:
ArrayOfStructsTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.arrayOfStructsTest", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::cerr << "ArrayOfStructsTest\n";
XmlRpcValue& arg1 = params[0];
int n = arg1.size(), sum = 0;
for (int i=0; i<n; ++i)
sum += int(arg1[i]["curly"]);
result = sum;
}
} arrayOfStructsTest(&s);
// This handler takes a single parameter, a string, that contains any number of predefined
// entities, namely <, >, &, ' and ".
// The handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets,
// ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes.
// To validate, the numbers must be correct.
class CountTheEntities : public XmlRpcServerMethod
{
public:
CountTheEntities(XmlRpcServer* s) : XmlRpcServerMethod("validator1.countTheEntities", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::cerr << "CountTheEntities\n";
std::string& arg = params[0];
int ctLeftAngleBrackets = 0;
int ctRightAngleBrackets = 0;
int ctAmpersands = 0;
int ctApostrophes = 0;
int ctQuotes = 0;
int n = int(arg.length());
for (int i=0; i<n; ++i)
switch (arg[i])
{
case '<': ++ctLeftAngleBrackets; break;
case '>': ++ctRightAngleBrackets; break;
case '&': ++ctAmpersands; break;
case '\'': ++ctApostrophes; break;
case '\"': ++ctQuotes; break;
}
result["ctLeftAngleBrackets"] = ctLeftAngleBrackets;
result["ctRightAngleBrackets"] = ctRightAngleBrackets;
result["ctAmpersands"] = ctAmpersands;
result["ctApostrophes"] = ctApostrophes;
result["ctQuotes"] = ctQuotes;
}
} countTheEntities(&s);
// This handler takes a single parameter, a struct, containing at least three elements
// named moe, larry and curly, all <i4>s. Your handler must add the three numbers and
// return the result.
class EasyStructTest : public XmlRpcServerMethod
{
public:
EasyStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.easyStructTest", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::cerr << "EasyStructTest\n";
XmlRpcValue& arg1 = params[0];
int sum = int(arg1["moe"]) + int(arg1["larry"]) + int(arg1["curly"]);
result = sum;
}
} easyStructTest(&s);
// This handler takes a single parameter, a struct. Your handler must return the struct.
class EchoStructTest : public XmlRpcServerMethod
{
public:
EchoStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.echoStructTest", s) {}
void execute(XmlRpcValue& params, XmlRpcValue& result)
{
std::cerr << "EchoStructTest\n";
result = params[0];

95
test/Validator.dsp Normal file
View File

@@ -0,0 +1,95 @@
# Microsoft Developer Studio Project File - Name="Validator" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=Validator - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Validator.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Validator.mak" CFG="Validator - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Validator - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "Validator - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "Validator - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe

163
test/Validator.vcproj Normal file
View File

@@ -0,0 +1,163 @@
<?xml version="1.0" encoding = "Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
Name="Validator"
ProjectGUID="{E68AB694-4805-43EA-A96E-21B8FE285DE4}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE,_WINDOWS"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="3"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/Validator.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
AdditionalOptions="">
<IntelOptions
Optimization="2"
InlineFuncExpansion="1"
OmitFramePtrs="1"
StringPooling="1"
RuntimeLibrary="2"
BufferSecurityCheck="1"
FunctionLevelLinking="1"
AllOptions="/c /nologo /W3 /O2 /Ob1 /Oy /D &quot;WIN32&quot; /D &quot;NDEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /GF /FD /EHsc /MD /GS /Gy /Yu&quot;stdafx.h&quot; /Fp&quot;.\Release/Validator.pch&quot; /Fo&quot;.\Release/&quot; /Fd&quot;.\Release/&quot; /Gd /TP"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="odbc32.lib odbccp32.lib"
OutputFile=".\Release/Validator.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
ProgramDatabaseFile=".\Release/Validator.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Release/Validator.exe&quot; /INCREMENTAL:NO odbc32.lib odbccp32.lib /PDB:&quot;.\Release/Validator.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/Validator.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\src"
PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE,_WINDOWS"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Debug/Validator.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"
AdditionalOptions="">
<IntelOptions
Optimization="0"
MinimalRebuild="1"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
AllOptions="/c /I &quot;..\src&quot; /ZI /nologo /W3 /Od /D &quot;WIN32&quot; /D &quot;_DEBUG&quot; /D &quot;_CONSOLE&quot; /D &quot;_WINDOWS&quot; /D &quot;_MBCS&quot; /Gm /EHsc /RTC1 /MDd /Fp&quot;.\Debug/Validator.pch&quot; /Fo&quot;.\Debug/&quot; /Fd&quot;.\Debug/&quot; /Gd"
MSOriginalAdditionalOptions=""/>
</Tool>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="xmlrpc.lib WS2_32.lib odbc32.lib odbccp32.lib"
OutputFile=".\Debug/Validator.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="..\debug"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/Validator.pdb"
SubSystem="1">
<IntelOptions
AllOptions="/NOLOGO /OUT:&quot;.\Debug/Validator.exe&quot; /INCREMENTAL /LIBPATH:&quot;..\debug&quot; xmlrpc.lib WS2_32.lib odbc32.lib odbccp32.lib /DEBUG /PDB:&quot;.\Debug/Validator.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /MACHINE:I386 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
MSOriginalAdditionalOptions="/MACHINE:I386"/>
</Tool>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/Validator.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<IntelOptions
CompilerName="1"/>
</Configuration>
</Configurations>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath=".\Validator.cpp"/>
</Filter>
</Files>
<Globals/>
</VisualStudioProject>

255
test/arrayOfStructsTest.xml Normal file
View File

@@ -0,0 +1,255 @@
<?xml version="1.0"?>
<methodCall>
<methodName>validator1.arrayOfStructsTest</methodName>
<params>
<param>
<value><array>
<data>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-84</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>87</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>77</i4>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-46</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>27</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>33</i4>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-70</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>89</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>30</i4>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-90</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>42</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>6</i4>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-28</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>96</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>92</i4>
</value>
</member>
</struct>
</value>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-31</i4>
</value>
</member>
<member>
<name>larry</name>
<value>

10
test/countTheEntities.xml Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<methodCall>
<methodName>validator1.countTheEntities</methodName>
<params>
<param>

29
test/easyStructTest.xml Normal file
View File

@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<methodCall>
<methodName>validator1.easyStructTest</methodName>
<params>
<param>
<value><struct>
<member>
<name>curly</name>
<value>
<i4>-78</i4>
</value>
</member>
<member>
<name>larry</name>
<value>

9
test/echo.xml Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<methodCall>
<methodName>echo</methodName>
<params>
<param><value><string>Hello Chris</string></value></param>

261
test/echoStructTest.xml Normal file
View File

@@ -0,0 +1,261 @@
<?xml version="1.0"?>
<methodCall>
<methodName>validator1.echoStructTest</methodName>
<params>
<param>
<value><struct>
<member>
<name>substruct0</name>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-76</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>31</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>44</i4>
</value>
</member>
</struct>
</value>
</member>
<member>
<name>substruct1</name>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-9</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>42</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>57</i4>
</value>
</member>
</struct>
</value>
</member>
<member>
<name>substruct2</name>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-15</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>69</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>78</i4>
</value>
</member>
</struct>
</value>
</member>
<member>
<name>substruct3</name>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-91</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>66</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>4</i4>
</value>
</member>
</struct>
</value>
</member>
<member>
<name>substruct4</name>
<value>
<struct>
<member>
<name>curly</name>
<value>
<i4>-47</i4>
</value>
</member>
<member>
<name>larry</name>
<value>
<i4>66</i4>
</value>
</member>
<member>
<name>moe</name>
<value>
<i4>8</i4>
</value>
</member>
</struct>
</value>
</member>

1
test/pngnow.png Normal file
View File

@@ -0,0 +1 @@
‰PNG