Óà C ʵÏÖ WebService
http://www.vckbase.com/document/viewdoc/?id=1711
×÷ÕߣºÇóÊdzà×Ó
Ò»¡¢ÏµÍ³»·¾³
Linux ²Ù×÷ϵͳ kernel2.4.2£¬°²×° gsoap2.6 µ½Ä¿Â¼/usr/local/gsoap
¶þ¡¢gSOAP µÄ¼òҪʹÓÃÀý×Ó
¡¡¡¡ÏÂÃæÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£¬ÊµÏÖÒ»¸ö¼Ó·¨ÔËËãµÄ WebService£¬¾ßÌ幦ÄÜÊÇ¿Í»§¶Ë£¨client£©ÊäÈë num1 ºÍ num2£¬·þÎñÆ÷¶Ë£¨server£©·µ»Ø num1 ºÍ num2 Ïà¼ÓµÄ½á¹û sum¡£
1¡¢Ê×ÏÈ£¬ÎÒÃÇÐèÒª×öµÄÊÇдһ¸öº¯ÊýÉùÃ÷Îļþ£¬À´¶¨Òå½Ó¿Úº¯Êý ns__add£¬ÎļþÃû×ÖΪ add.h£¬ÄÚÈÝÈçÏ£º
//gsoap ns service name: add
//gsoap ns service namespace: http://mail.263.net/add.wsdl
//gsoap ns service location: http://mail.263.net
//gsoap ns service executable: add.cgi
//gsoap ns service encoding: encoded
//gsoap ns schema namespace: urn:add
int ns__add( int num1, int num2, int* sum );
2¡¢È»ºóÎÒÃÇÐèÒª´´½¨Îļþ Makefile£¬´Ó¶øÀûÓà gsoapcpp2 ¹¤¾ßÓÉ add.h Éú³ÉһЩ .xml Îļþ¡¢.c ÎļþºÍ .h Îļþ£¬ÕâЩÎļþ¾ùΪ×Ô¶¯Éú³É£¬MakefileµÄÄÚÈÝÈçÏ£º
GSOAP_ROOT=/usr/local/gsoap
WSNAME=add
CC=g++ -g -DWITH_NONAMESPACES
INCLUDE=-I $(GSOAP_ROOT)
SERVER_OBJS=$(WSNAME)C.o $(WSNAME)Server.o stdsoap2.o
CLIENT_OBJS=$(GSOAP_ROOT)/env/envC.o $(WSNAME)ClientLib.o stdsoap2.o
ALL_OBJS=${WSNAME}server.o $(WSNAME)C.o $(WSNAME)Server.o ${WSNAME}test.o \
${WSNAME}client.o $(WSNAME)ClientLib.o
#×ܵÄÄ¿±ê
all:server
${WSNAME}.wsdl:${WSNAME}.h
$(GSOAP_ROOT)/soapcpp2 -p$(WSNAME) -i -n -c ${WSNAME}.h
stdsoap2.o:$(GSOAP_ROOT)/stdsoap2.c
$(CC) -c $?
#±àÒëÒ»ÑùÉú³É¹æÔòµÄ.oÎļþ
$(ALL_OBJS):%.o:%.c
$(CC) -c $? $(INCLUDE)
#±àÒë·þÎñÆ÷¶Ë
server:Makefile ${WSNAME}.wsdl ${WSNAME}server.o $(SERVER_OBJS)
$(CC) ${WSNAME}server.o $(SERVER_OBJS) -o ${WSNAME}server
#±àÒë¿Í»§¶Ë
client:Makefile ${WSNAME}.wsdl ${WSNAME}client.c ${WSNAME}test.c $(ALL_OBJS) stdsoap2.o
$(CC) ${WSNAME}test.o ${WSNAME}client.o $(CLIENT_OBJS) -o ${WSNAME}test
cl:
rm -f *.o *.xml *.a *.wsdl *.nsmap $(WSNAME)H.h $(WSNAME)C.c $(WSNAME)Server.c $(WSNAME)Client.c \
$(WSNAME)Stub.* $(WSNAME)$(WSNAME)Proxy.* $(WSNAME)$(WSNAME)Object.* $(WSNAME)ServerLib.c \
$(WSNAME)ClientLib.c $(WSNAME)server ns.xs
Ïà¹ØÎĵµ£º
¸´ÔÓµÄC\C++ÉùÃ÷£¬³£³öÏÖÔÚѧУµÄ¿¼¾í£¬ÃæÊÔÌâ»òÊÇÅ£ÈËÀÏÍâµÄ´úÂëÖС£
ÎÒÃÇÔÚʵ¼ÊµÄ¹¤×÷ÖУ¬Ó¦¸Ã¾¡¿ÉÄÜÉÙʹÓø´ÔÓµÄÉùÃ÷¡£¸´ÔÓµÄÉùÃ÷£¬»áÈÃÔĶÁÄú´úÂëµÄÈ˺ÜÊÇÓôÃÆ¡£
ËäÈ»²»Ê¹ÓÃÕâÖÖ¸´ÔÓµÄÉùÃ÷£¬µ«»¹ÊÇÓ¦¸Ã°Ñ½«ÈçºÎ½âÎöÕâÖÖ¸´ÔÓµÄÉùÃ÷µÄ·½·¨¼ÇÔÚÐÄÖС£
ËùÒÔ£¬ÎÒ°ÑÕâÖÖ·½·¨¼Ç¼ÏÂÀ´£¬ÒÔ±¸²»Ê±Ö®Ðè¡£
ÈëÃÅÌâ
1) Ò»¸öÕûÐ ......
9Ô¶¼¿ì½áÊøÁË£¬Ö®Ç°Ò»Ö±Ã¦µ½Ð´×Ô¼ºµÄ¶«Î÷¼ÓÉÏÉÏ°à¡£»ù±¾Ã»ÓÐʱ¼äÑо¿Ï»ã±àºÍC C++·½ÃæµÄ¸ÐÐËȤµÄ¶«Î÷¡£ÔÙÔõô˵Â9Ô»¹ÊǵÃдһƪÈö£¬ÒÔºóÿÔÂÖÁÉÙһƪ°É¡£¸ø×Ô¼º¶¨ÁË£¬Ï£Íû´ó¼Ò¼à¶½¡£ºÙºÙ£¡
ÕâƪÎÄÕ¾ÍÀ´Ì¸Ì¸Æ½³£ºÜ³£¼ûµÄHOOK¼¼Êõ£¬ÕâÀïÄØ¡£Ð´µÃ±È½Ï¼òµ¥£¬·½·¨ºÜ¶à¡£Ö»½²ÔÀí£¡Ï£Íû´óÄñÃDZðÍÂÎÒ¿ÚË®¹þ - -¡£ºÃ£¡ÇÐÈëÕ ......
C²Ù×÷·ûµÄÓÅÏȼ¶ºÍ¹ØÁª¹æÔò
²Ù×÷·û
¹ØÁª¹æÔò
¹ØÁª²Ù×÷·û () [] -> .
´Ó×óµ½ÓÒ
Ò»Ôª²Ù×÷·û ! – ++ -- + - (type) * & sizeof
´ÓÓÒµ½×ó
³Ë·¨ºÍ³ý·¨ * / %
´Ó×óµ½ÓÒ
¼Ó·¨ºÍ¼õ·¨ + -
´Ó× ......
Ç¿ÖÆÀàÐÍת»»ÊÇͨ¹ýÀàÐÍת»»ÔËËãÀ´ÊµÏֵġ£ÆäÒ»°ãÐÎʽΪ£º (ÀàÐÍ˵Ã÷·û) (±í´ïʽ) Æ书ÄÜÊǰѱí´ïʽµÄÔËËã½á¹ûÇ¿ÖÆת»»³ÉÀàÐÍ˵Ã÷·ûËù±íʾµÄÀàÐÍ¡£ÀýÈ磺 (float) a °Ñaת»»ÎªÊµÐÍ(int)(x+y) °Ñx+yµÄ½á¹ûת»»ÎªÕûÐÍÔÚʹÓÃÇ¿ÖÆת»»Ê±Ó¦×¢ÒâÒÔÏÂÎÊÌ⣺
1.ÀàÐÍ˵Ã÷·ûºÍ±í´ïʽ¶¼±ØÐë¼ÓÀ¨ºÅ(µ¥¸ö±äÁ¿¿ÉÒÔ²»¼ÓÀ¨ºÅ)£¬Èç°Ñ(int) ......
C/C++»ù±¾ÖªÊ¶£¨×ªÔØ£©
0
ÍƼö±¾ÎĵÄд×÷Ä¿µÄ²¢²»ÔÚÓÚÌṩC/C++³ÌÐòÔ±ÇóÖ°ÃæÊÔÖ¸µ¼£¬¶øÖ¼ÔÚ´Ó¼¼ÊõÉÏ·ÖÎöÃæÊÔÌâµÄÄÚº¡£ÎÄÖеĴó¶àÊýÃæÊÔÌâÀ´×Ô¸÷´óÂÛ̳£¬²¿·ÖÊÔÌâ½â´ðÒ²²Î¿¼ÁËÍøÓѵÄÒâ¼û¡£
¡¡¡¡Ðí¶àÃæÊÔÌâ¿´ËƼòµ¥£¬È´ÐèÒªÉîºñµÄ»ù±¾¹¦²ÅÄܸø³öÍêÃÀµÄ½â´ð¡£ÆóÒµÒªÇóÃæÊÔÕßдһ¸ö×î¼òµ¥µÄstrcpyº¯Êý¶¼¿É¿´³öÃæÊÔ ......