DelphiµÄWeb Services¼¼Êõ¿ª·¢¶ÌÐÅÓ¦ÓóÌÐò
Ò»ÌáÆð»ùÓÚWeb Services¼¼ÊõµÄÓ¦ÓóÌÐò¿ª·¢£¬Ò»°ãÈËÊ×ÏÈÏëµ½µÄ¿ª·¢¹¤¾ßÊÇVs.net£¬Æäʵ×÷Ϊ¿ìËÙÓ¦ÓóÌÐò¿ª·¢¹¤¾ß(RAD)µÄÀÏ´ó£¬Delphi´Ó6.0¾Í¿ªÊ¼Ö§³ÖWeb ServicesµÄ¿ª·¢ºÍÓ¦ÓÃÁË£¬±¾ÎÄͨ¹ýʹÓÃDelphi 7.0µ÷ÓÃÐÂÀË·¢ËͶÌÐŵÄWeb Service½øÐжÌÐÅÓ¦ÓóÌÐò¿ª·¢ÕâһʵÀýÏêϸµÄ½éÉÜÔÚDelphiÖÐÈçºÎ¿ª·¢»ùÓÚWeb ServicesµÄÓ¦ÓÃϵͳ¡£
µÚÒ»²½£¬×¼±¸¹¤×÷£¬Á˽âÐÂÀ˶ÌÐÅWeb Service¡£ÐÂÀË·¢ËͶÌÐŵÄWeb ServiceµØÖ·ÊÇhttp://smsinter.sina.com.cn/ws/smswebservice0101.wsdl£¬¸ÃWeb Service¾ÍÖ»ÓÐÒ»¸ö·½·¨£¬¼´string sendXml(carrier,userid,password,mobilenumber,content,msgtype)¡£¸÷¸ö²ÎÊýÈ«²¿ÎªstringÀàÐÍ£¬Æ京Òå»ù±¾ÈçÏ£¨¿ÉÄܲ»ÕýÈ·£©¡£
Carrier£ºÔËÓªÉÌÃû³Æ£¬ºÃÏñ¿ÉÒÔËæ±ãÊ䣬½¨ÒéÊäÈë“Sina”£¬Èç¹ûÊäÈëÆäËûµÄÖµ£¬ÏûÏ¢·¢Ë͵ÄÌرðÂý£»
Userid£ºÄúÔÚÐÂÀËÎÞÏßÉÏ×¢²áµÄÊÖ»úID£¬Èç¹ûÄúûÓÐÔÚhttp://sms.sina.com.cnÉÏ×¢²áÄúµÄÊÖ»ú£¬ÄãÊÇÎÞ·¨Ê¹Óñ¾Web Service·¢ËͶÌÐŵģ»
Password£ºÄúÔÚÐÂÀËÎÞÏßÉÏ×¢²áÊÖ»úʱËùʹÓõÄÃÜÂ룻
Mobilenumber£º¶Ô·½µÄÊÖ»úºÅÂ룻
Content£º·¢ËͶÌÏûÏ¢µÄÄÚÈÝ£»
Msgtype£º·¢ËͶÌÏûÏ¢µÄÀàÐÍ£¬ÎÒ¹À¼ÆÖ§³Ö²ÊÐÅ£¬²»¹ýÎÒ²»ÖªµÀÔõôʹÓã¬ËƺõËæ±ãÊäʲô¶¼¿ÉÒÔ£¬ÎÒʹÓõÄÊÇ“Text”¡£
×ʷѱê×¼Çë²Î¿´ÐÂÀËÎÞÏßÍøÕ¾ÉϵÄÏà¹Ø˵Ã÷£¬Ó¦¸ÃÊÇÒ»ÌõÒ»½ÇÇ®£¬²»¹ýÒ²»òÕßÊÇÒ»ÌõÁ½½ÇÏߣ¬¾ßÌ岻̫Çå³þ¡£ÓÉÓÚÆäºǫ́¿ÉÄÜʹÓÃÁËÏûÏ¢¶ÓÁлúÖÆ£¬ÔÚ·±Ã¦µÄʱºò£¬¿ÉÄÜ»áÓнϳ¤Ê±¼äµÄÑÓ³Ù¡£
µÚ¶þ²½£¬ÏȽ¨Á¢Ò»¸ö¿Õ°×µÄÓ¦ÓóÌÐò¡£ÔËÐÐDelphi 7£¬´ò¿ª[File]->[New]->[Application]²Ëµ¥£¬Delphi×Ô¶¯Éú³ÉÒ»¸öĬÈϵŤ³Ì¡£½«Ä¬ÈϵĴ°ÌåForm1¸ÄΪsms£¬È»ºó½«¸Ä¹¤³Ì±£´æΪsmsdemo.prj¡£
µÚÈý²½£¬ÒýÈëWeb Service¡££¬´ò¿ª[File]->[New]->[Other]²Ëµ¥£¬ÔÚµ¯³öµÄ´°¿ÚÖÐÑ¡ÔñWebServices TabÒ³Ã棬ȻºóÑ¡ÔñÆäÖеÄWSDL importerÑ¡Ïµ¥»÷OK°´Å¥µ¯³öWSDL importer Wizard´°¿Ú£¬Èçͼ2Ëùʾ¡£ÔÚÆäÉϵÄLocation of WSDL File or URL ÖÐÊäÈ룺http://smsinter.sina.com.cn/ws/smswebservice0101.wsdl £¨×¢Ò⣬ǧÍò²»ÄÜÊä´í£¡£©£¬µ¥»÷Next°´Å¥ºó£¬ÔÙµ¥»÷Finishi°´Å¥£¬Íê³ÉÀË·¢ËͶÌÐÅWeb ServiceµÄÒýÈë¡£´Ëʱ¹¤³ÌÎļþÖлáÔö¼ÓÒ»¸öÃû×ÖΪsmswebservice0101.pasµÄÎļþ£¬ÕâÊÇDelphi×Ô¶¯Éú³ÉµÄWeb ServiceÒýÈëÉêÃ÷Îļþ£¬²»ÒªÊÖ¹¤ÐÞ¸ÄËû¡£
µÚËIJ½£¬µ÷ÓÃWeb ServiceµÄ¶ÌÐÅ·¢Ëͽӿڡ£ÔÚsms´°ÌåÖУ¬ÒÀ´ÎÔö¼ÓËĸöTEdit¿Ø¼þ£¬Ò»¸öTButton¿Ø¼þ£¬Ò»¸öT
Ïà¹ØÎĵµ£º
3.2 Óû§µÇ¼·½°¸
ÔÚ½øÈëÒ»¸öϵͳʱ£¬±ØÐëÏÈÔڵǼ´°ÌåÖÐÊäÈëÕýÈ·µÄÓû§ÃûºÍÃÜÂë²ÅÄܽøÈë¡£ÕâÑù¿ÉÒÔÈ·±£ÏµÍ³µÄ°²È«ÐԺͱ£ÃÜÐÔ£¬µÇ¼´°ÌåµÄÖÆ×÷°´ÕÕϵͳµÄ´óС¼°Óô¦£¬¿ÉÒÔ·ÖΪ²»Í¬µÄµÇ¼´°ÌåÑùʽ£¬ÔÚϵͳµÚÒ»´ÎµÇ¼ǰ£¬Ê×ÏÈÒª¶Ô²Ù×÷Ô±ÐÅÏ¢½øÐÐÏàÓ¦µÄÉèÖᣱ¾½Ú½«¶ÔµÇ¼´°Ìå¼°²Ù×÷Ô±¹ÜÀí´°ÌåµÄÖÆ×÷¹ý³Ì½øÐÐÏêϸµÄ˵Ã÷ ......
3.2 Óû§µÇ¼·½°¸
ÔÚ½øÈëÒ»¸öϵͳʱ£¬±ØÐëÏÈÔڵǼ´°ÌåÖÐÊäÈëÕýÈ·µÄÓû§ÃûºÍÃÜÂë²ÅÄܽøÈë¡£ÕâÑù¿ÉÒÔÈ·±£ÏµÍ³µÄ°²È«ÐԺͱ£ÃÜÐÔ£¬µÇ¼´°ÌåµÄÖÆ×÷°´ÕÕϵͳµÄ´óС¼°Óô¦£¬¿ÉÒÔ·ÖΪ²»Í¬µÄµÇ¼´°ÌåÑùʽ£¬ÔÚϵͳµÚÒ»´ÎµÇ¼ǰ£¬Ê×ÏÈÒª¶Ô²Ù×÷Ô±ÐÅÏ¢½øÐÐÏàÓ¦µÄÉèÖᣱ¾½Ú½«¶ÔµÇ¼´°Ìå¼°²Ù×÷Ô±¹ÜÀí´°ÌåµÄÖÆ×÷¹ý³Ì½øÐÐÏêϸµÄ˵Ã÷ ......
×¢£º ʹÓôíÎ󣬻òÕßÔڸüӵĵط½Ã»Óмӣ¬¿ÉÄÜ»á³öÏÖ"privileged instruction"´íÎ󣬻òÕßµØÖ··ÃÎÊ´íÎó¡£
³£¼ûµÄµ÷ÓùßÀýÓÐregister, pascal, cdecl, stdcall, safecall¡£º¯ÊýµÄµ÷ÓùÜÀí¾ö¶¨Á˲ÎÊýÈçºÎ´«µÝ¸ø×Ó¹ý³Ì£¬²¢´Ó¶ÑÕ»ÖÐÍ˳ö£¬ÒÔ¼°¼Ä´æÆ÷ÔÚ²ÎÊý´«µÝÖеÄʹÓ㬴íÎóºÍÒì³£µÄ´¦Àí¡£DelphiÖÐĬÈϵĵ ......
Ò» DllµÄÖÆ×÷Ò»°ã²½Öè
¶þ ²ÎÊý´«µÝ
Èý DLLµÄ³õʼ»¯ºÍÍ˳öÇåÀí[Èç¹ûÐèÒª³õʼ»¯ºÍÍ˳öÇåÀí]
ËÄ È«¾Ö±äÁ¿µÄʹÓÃ
Îå µ÷Óþ²Ì¬ÔØÈë
Áù µ÷Óö¯Ì¬ÔØÈë
Æß ÔÚDLL½¨Á¢Ò»¸öTForM
°Ë ÔÚDLLÖн¨Á¢Ò»¸öTMDIChildForM
¾Å ʾÀý£º
Ê® DelphiÖÆ×÷µÄDllÓëÆäËûÓïÑԵĻìºÏ ......
¿ª·¢²½Ö裺
1¡¢´´½¨ActiveX Library¹¤³Ì¡£
2¡¢´´½¨COM Object¡£
3¡¢´´½¨Type Library£¬²¢´´½¨ÏàÓ¦½Ó¿Ú¡£
4¡¢´´½¨½Ó¿Ú¶ÔÓ¦µÄº¯ÊýºÍʵÏÖ¡£
¾ßÌåÈçÏ£º
1¡¢´´½¨COM Object¡£
new|other|activeX|com object
ÔÚClass Name(±¾ÀýÀïÀàÃûÀïÌîObject£¬¿É°´×Ô¼ºÐèÒªÌîд) ÌîдÀàÃû.(Instancing:ʵÀý´´½¨·½Ê½,Threading Model:Ï ......