📄 common_table.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
// $Id: common_table.cpp,v 1.3 2001/09/11 11:45:53 rosimildo Exp $
//
// Copyright (c) 2001 Exor International Inc. All rights reserved.
//
// MODULE DESCRIPTION: A sample module to show how to use a global
// table to concentrate all entry points to be registered to a
// eSoap server.
//
// MODIFICATION/HISTORY:
//
// $Log: common_table.cpp,v $
// Revision 1.3 2001/09/11 11:45:53 rosimildo
// changed copyright from Technopoint to Exit; updated version to 0.9
//
// Revision 1.2 2001/04/26 03:13:39 rosimildo
// Initial debug of the TimeInstant and Binary.
// Added these methods to the interop test.
//
// Revision 1.1 2001/04/19 17:30:26 rosimildo
// Added Support for CGI processes.
//
//
// Created 2001/02/08 Rosimildo da Silva, ConnectTel Inc.
// [rdasilva@connecttel.com]
//
/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <assert.h>
#include "soap_server.h"
#include "soap_envelope.h"
/* must be the last include */
#ifdef MEMWATCH
#include <memwatch.h>
#endif
// callbacks to implement the SOAP validator...
extern int validator_countTheEntities( esoap::MethodDataBlock *mdata );
extern int validator_easyStructTest( esoap::MethodDataBlock *mdata );
extern int validator_echoStructTest( esoap::MethodDataBlock *mdata );
extern int validator_manyTypesTest( esoap::MethodDataBlock *mdata );
extern int validator_moderateSizeArrayCheck( esoap::MethodDataBlock *mdata );
extern int validator_nestedStructTest( esoap::MethodDataBlock *mdata );
extern int validator_simpleStructReturnTest( esoap::MethodDataBlock *mdata );
// callbacks to implement the Interop test suite
extern int echoString( esoap::MethodDataBlock *mdata );
extern int echoInteger( esoap::MethodDataBlock *mdata );
extern int echoFloat( esoap::MethodDataBlock *mdata );
extern int echoVoid( esoap::MethodDataBlock *mdata );
extern int echoStringArray( esoap::MethodDataBlock *mdata );
extern int echoFloatArray( esoap::MethodDataBlock *mdata );
extern int echoIntegerArray( esoap::MethodDataBlock *mdata );
extern int echoStruct( esoap::MethodDataBlock *mdata );
extern int echoStructArray( esoap::MethodDataBlock *mdata );
extern int echoDate( esoap::MethodDataBlock *mdata );
extern int echoBase64( esoap::MethodDataBlock *mdata );
// sample methods...
extern int methodAdd( esoap::MethodDataBlock *mdata );
extern int methodAddArray( esoap::MethodDataBlock *mdata );
extern int supportedTypes( esoap::MethodDataBlock *mdata );
extern int methodMemCheck( esoap::MethodDataBlock *mdata );
// structure to hold each entry...
struct EsoapMethodEntry
{
const char *name; // method's name
int ( *method ) ( esoap::MethodDataBlock * ); // function pointer.
};
static EsoapMethodEntry esoapCommonMethodsTable[] =
{
// some generic simple tests for the esoapclient program....
{ "add", methodAdd },
{ "addArray", methodAddArray },
{ "getSupportedTypes", supportedTypes },
{ "memoryCheck", methodMemCheck },
// SOAP validator methods
{ "countTheEntities", validator_countTheEntities },
{ "easyStructTest", validator_easyStructTest },
{ "echoStructTest", validator_echoStructTest },
{ "manyTypesTest", validator_manyTypesTest },
{ "moderateSizeArrayCheck", validator_moderateSizeArrayCheck },
{ "nestedStructTest", validator_nestedStructTest },
{ "simpleStructReturnTest", validator_simpleStructReturnTest },
// SOAP Interop methods
{ "echoString", echoString },
{ "echoInteger", echoInteger },
{ "echoFloat", echoFloat },
{ "echoVoid", echoVoid },
{ "echoStringArray", echoStringArray },
{ "echoIntegerArray", echoIntegerArray },
{ "echoFloatArray", echoFloatArray },
{ "echoStruct", echoStruct },
{ "echoStructArray", echoStructArray },
{ "echoDate", echoDate },
{ "echoBase64", echoBase64 },
// last entry to stop loop.
{ 0, 0 }
};
/**
* This function registers this table of methods to the eSoap
* server.
*/
void registerCommonMethods()
{
EsoapMethodEntry *entry = esoapCommonMethodsTable;
while( entry->name && entry->method )
{
esoap::Server::instance()->getRegistry().addMethod( entry->name,
new FunctionCallback< esoap::MethodDataBlock >( entry->method ) );
entry++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -