Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ACE+gSOAPʵÏÖ¸ßÐÔÄÜWebService Server£¨C/C++£©

1¡¢¿ª·¢»·¾³Çë²Î¿¼¡¶´î½¨ACE-5.7.4+VS2008¿ª·¢»·¾³¡·Ò»ÎÄ
2¡¢gSOAP¿â£¬ÏÂÔصØÖ·£ºhttp://gsoap2.sourceforge.net/£¬±¾ÎÄʹÓõİ汾ÊÇ£ºgsoap_2.7.15£¬gSOAPµÄ±à³Ì¿ÉÒԲο¼docĿ¼ÏµÄsoapdoc2.pdf£¬¹Ù·½ÎĵµÐ´µÄ·Ç³£Ïêϸ¡£
ÈÃÎÒÃÇ¿ªÊ¼gSOAP±àÂëÂọ́º
1¡¢´´½¨gsoap_server.h£º
//gsoap ns2 service namespace: http://localhost:9908/ccm_mimport/services.wsdl
//gsoap ns2 service location: http://localhost:9908/ccm_mimport/services
typedef char * xsd__string; // encode char * value as the xsd:string schema type
typedef int xsd__int; // encode xsd__int value as the xsd:int schema typ
struct ns2__makeCardNotifyReqBean
{
xsd__string id_makecard_order;
xsd__int card_type;
xsd__string file_name;
xsd__string start_card_serial;
xsd__string end_card_serial;
xsd__int card_count;
};
struct ns2__makeCardNotifyRspBean
{
xsd__int result; //½á¹û
xsd__string error_desc; //´íÎóÃèÊö
};
//¿¨Êý¾ÝÉú³É½á¹û֪ͨ½Ó¿Ú
int ns2__makeCardNotify(struct ns2__makeCardNotifyReqBean req, struct ns2__makeCardNotifyRspBean *rsp);

×¢£ºÍ·ÎļþÉÏÃæµÄ×¢ÊÍÓÃÓÚÅäÖ÷þÎñ·ÃÎʵØÖ·£¬¶ø·Çµ¥´¿µÄ×¢ÊÍ£»ÏêϸÅäÖÃ˵Ã÷¿ÉÒԲο¼¹Ù·½Îĵµ
2¡¢°Ñ%GSOAP_HOME%\gsoap\bin\win32Ŀ¼ÅäÖõ½ÏµÍ³%Path%À»òÕß½«Ä¿Â¼ÏµÄsoapcpp2.exeºÍwsdl2h.exeÁ½¸öÎļþÖ±½Ó¿½±´µ½gsoap_server.hËùÔÚĿ¼£»
3¡¢±àдÅú´¦ÀíÎļþ£º
echo off
del *.c *.h *.xml *.nsmap *.cpp
soapcpp2 -c -S gsoap_server.h
copy soapC.c ..\soapC.cpp
copy soapServer.c ..\soapServer.cpp
copy soapH.h ..\soapH.h
copy soapStub.h ..\soapStub.h
copy ns2.nsmap ..\gsoap_server.nsmap
echo .
echo /******************************/
echo .
echo Éú³ÉµÄns2.wsdl±ØÐëɾ³ýschemaLocation="http://schemas.xmlsoap.org/soap/encoding/"ÊôÐÔ
echo .
echo /******************************/
echo .
pause

4¡¢±àдҵÎñʵÏÖ´úÂ룺
#include <ctype.h>
#include <string>
#include <ace/OS.h>
#include <ace/OS_NS_ctype.h>
#include <ace/OS_NS_string.h>
#include "Global_Define.h"
#include "ffcs_logger.h"
#include "stdsoap2.h"
#include "soapH.h"
#include "gsoap_se


Ïà¹ØÎĵµ£º

CÓïÑÔÎļþÏà¹Ø²Ù×÷

CÓïÑÔÎļþ²Ù×÷½Ó´¥ºÜ¾ÃÁË£¬Ò»Ö±Ã»ÓÐ×ܽáÏà¹ØÄÚÈÝ£¬½ñÌìÓõ½Á˾ÍÈ¥ÕÒÁËÕÒÏà¹ØÄÚÈÝ¡£
ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold ......

C/C++ÖÐmallocºÍnewµÄÇø±ð


¡¡¡¡1£¬mallocÓëfreeÊÇC++/CÓïÑԵıê×¼¿âº¯Êý£¬new/deleteÊÇC++µÄÔËËã·û¡£ËüÃǶ¼¿ÉÓÃÓÚÉêÇ붯̬ÄÚ´æºÍÊÍ·ÅÄÚ´æ¡£
¡¡¡¡2£¬¶ÔÓÚ·ÇÄÚ²¿Êý¾ÝÀàÐ͵ĶÔÏó¶øÑÔ£¬¹âÓÃmaloc/freeÎÞ·¨Âú×㶯̬¶ÔÏóµÄÒªÇ󡣶ÔÏóÔÚ´´½¨µÄͬʱҪ×Ô¶¯Ö´Ðй¹Ô캯Êý£¬¶ÔÏóÔÚÏûÍö֮ǰҪ×Ô¶¯Ö´ÐÐÎö¹¹º¯Êý¡£ÓÉÓÚmalloc/freeÊǿ⺯Êý¶ø²»ÊÇÔËËã·û£¬²»ÔÚ±àÒëÆ ......

¡¶CÓïÑÔÉî¶ÈÆÊÎö¡·Ñ§Ï°±Ê¼ÇÈý

1.10.3£¬voidÖ¸Õë
¡¾¹æÔò 1-35¡¿Ç§ÍòСÐÄÓÖСÐÄʹÓÃvoidÖ¸ÕëÀàÐÍ¡£
°´ÕÕ ANSI(American National Standards Institute)±ê×¼£¬²»ÄÜ¶Ô voidÖ¸Õë½øÐÐËã·¨²Ù×÷£¬¼´ÏÂÁвÙ×÷¶¼ÊDz»ºÏ·¨µÄ£º
void * pvoid;
pvoid++; //ANSI£º´íÎó
pvoid += 1; //ANSI£º´íÎó
ANSI ±ê×¼Ö®ËùÒÔÕâÑùÈ϶¨£¬ÊÇÒòΪËü¼á³Ö£º½øÐÐËã·¨²Ù×÷µÄÖ¸Õë±ØÐëÊ ......

CÖ¸ÕëÉîÈëÓëÄÚ´æй©

Ö¸ÕëÊÇÒ»¸öÌØÊâµÄ±äÁ¿£¬ËüÀïÃæ´æ´¢µÄÊýÖµ±»½âÊͳÉΪÄÚ´æÀïµÄÒ»¸öµØÖ·¡£   Òª¸ãÇåÒ»¸öÖ¸ÕëÐèÒª¸ãÇåÖ¸ÕëµÄËÄ·½ÃæµÄÄÚÈÝ£ºÖ¸ÕëµÄÀàÐÍ£¬Ö¸ÕëËùÖ¸ÏòµÄ   ÀàÐÍ£¬Ö¸ÕëµÄÖµ»òÕß½ÐÖ¸ÕëËùÖ¸ÏòµÄÄÚ´æÇø£¬»¹ÓÐÖ¸Õë±¾ÉíËùÕ¼¾ÝµÄÄÚ´æÇø¡£ÈÃÎÒÃÇ·Ö±ð˵Ã÷¡£  
¡¡¡¡ÏÈÉùÃ÷¼¸¸öÖ¸Õë·Å×Å×öÀý×Ó£º   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ