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Öк¯ÊýÃû³Æ²»Í¬¡£È»¶ødllµÄµ¼³öº¯Êýͨ³£ÊDZê×¼C¶¨ÒåµÄ£¬Èñê×¼C±àдµÄdllº¯Êý¶¨ÒåÔÚCºÍC++±àÒëÆ÷϶¼ÄܱàÒëͨ¹ý£¬Í¨³£»áʹÓÃÒÔϵĸñʽ£º£¨Õâ¸ö¸ñʽÔںܶà³ÉÊìµÄ´úÂëÖкܳ£¼û£©
#ifdef __cplusplus extern "C"
{
#endif
// ......
¡¡¡¡1£¬mallocÓëfreeÊÇC++/CÓïÑԵıê×¼¿âº¯Êý£¬new/deleteÊÇC++µÄÔËËã·û¡£ËüÃǶ¼¿ÉÓÃÓÚÉêÇ붯̬ÄÚ´æºÍÊÍ·ÅÄÚ´æ¡£
¡¡¡¡2£¬¶ÔÓÚ·ÇÄÚ²¿Êý¾ÝÀàÐ͵ĶÔÏó¶øÑÔ£¬¹âÓÃmaloc/freeÎÞ·¨Âú×㶯̬¶ÔÏóµÄÒªÇ󡣶ÔÏóÔÚ´´½¨µÄͬʱҪ×Ô¶¯Ö´Ðй¹Ô캯Êý£¬¶ÔÏóÔÚÏûÍö֮ǰҪ×Ô¶¯Ö´ÐÐÎö¹¹º¯Êý¡£ÓÉÓÚmalloc/freeÊǿ⺯Êý¶ø²»ÊÇÔËËã·û£¬²»ÔÚ±àÒëÆ ......
Èç¹ûÒ»¸ö±äÁ¿ÄãÐèÒª¼¸ÖÖ¿ÉÄÜ´æÔÚµÄÖµ£¬ÄÇô¾Í¿ÉÒÔ±»¶¨Òå³ÉΪö¾ÙÀàÐÍ¡£Ö®ËùÒÔ½Ðö¾Ù¾ÍÊÇ˵½«±äÁ¿»òÕ߽жÔÏó¿ÉÄÜ´æÔÚµÄÇé¿öÒ²¿ÉÒÔ˵ÊÇ¿ÉÄܵÄÖµÒ»Ò»Àý¾Ù³öÀ´¡£
¡¡¡¡¾Ù¸öÀý×ÓÀ´ËµÃ÷Ò»°É£¬ÎªÁËÈôó¼Ò¸üÃ÷°×Ò»µã£¬±ÈÈçÒ»¸öǦ±ÊºÐÖÐÓÐÒ»Ö§±Ê£¬µ«ÔÚûÓдò¿ªÖ®Ç°Äã²¢²»ÖªµÀËüÊÇʲô±Ê£¬¿ÉÄÜÊÇǦ±ÊÒ²¿ÉÄÜÊǸֱʣ¬ÕâÀïÓÐÁ½ÖÖ¿ÉÄÜ£¬Ä ......
Python 3 Êä³öÖض¨ÏòʹÓÃC/C++
By:gddsky
Ä¿±ê
Ï£Íû½«Python 3µÄÊä³öÖض¨Ïòµ½×Ô¶¨ÒåµÄÊä³öÄ¿±ê¡£
ºËÐÄ
PythonʹÓÃsys.stdout¡¢sys.stderr×öÊä³öÄ¿±ê£¬Ö»ÒªÎÒÃÇÌæ»»ÕâÁ½¸öÖµ¾Í¿ÉÒÔÖض¨Ïòµ½ÎÒÃÇ×Ô¶¨ÒåÄ¿±ê¡£Ìæ»»µÄÖµµÄ¹æÔòÔÚPythonµÄÎĵµÖÐsys (module)µÄsys.stdoutÉÏÃæ˵Ã÷Ö»ÒªÌí¼ÓÒ»¸öwriteº¯Êý¾Í¿ÉÒÔ ......
from:×ÞöεÄרÀ¸
ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
&n ......