¿Æ¼¼ÐÐÕß

ÐÐÕßѧԺ תÐÍ˽¶­»á ¿Æ¼¼ÐÐÕßרÌⱨµÀ Íøºì´óÕ½¿Æ¼¼ÐÐÕß

֪ʶ¿â

֪ʶ¿â °²È«µ¼º½

ÖÁ¶¥ÍøÈí¼þƵµÀ»ù´¡Èí¼þASMX2.0¡¢WSE3.0ºÍWCFÎÊÌâ½â´ð(¶þ)

ASMX2.0¡¢WSE3.0ºÍWCFÎÊÌâ½â´ð(¶þ)

  • ɨһɨ
    ·ÖÏíÎÄÕµ½Î¢ÐÅ

  • ɨһɨ
    ¹Ø×¢¹Ù·½¹«ÖÚºÅ
    ÖÁ¶¥Í·Ìõ

¡¡Microsoft® .NET Framework 2.0 °æͨ¹ý¼¸¸öÓÐȤµ«¿ÉÄÜÁîÈËÀ§»óµÄ·½Ê½ÖØËÜÁË Web ·þÎñµÄÇ°¾°¡£

×÷ÕߣºÖìÏÈÖÒ±àÒë À´Ô´£ºITר¼ÒÍø 2008Äê6ÔÂ7ÈÕ

¹Ø¼ü×Ö£º WCF WSE ASM net Windows

  • ÆÀÂÛ
  • ·ÖÏí΢²©
  • ·ÖÏíÓʼþ
¡¡Microsoft® .NET Framework 2.0 °æͨ¹ý¼¸¸öÓÐȤµ«¿ÉÄÜÁîÈËÀ§»óµÄ·½Ê½ÖØËÜÁË Web ·þÎñµÄÇ°¾°¡£Òò´Ë£¬±¾ÔÂÎÒ´òËã½â´ðһЩÓë ASP.NET Web Services (ASMX) 2.0¡¢Web Services Enhancements (WSE) 3.0 ºÍ Windows® Communication Foundation (WCF)(WinFX® µÄÒ»²¿·Ö)ÓйصÄ×î³£¼ûÎÊÌâ¡££¨²é¿´±¾ÎĵÚÒ»²¿·Ö£©

¡¡¡¡ÎÊ:ºÎʱӦ¸Ã½« WSE Óë ASMX ½áºÏʹÓ㬺ÎʱӦ¸Ãµ¥¶ÀʹÓà ASMX?ÎÒÏ£Íû½«Õâ¸öÎÊÌâŪµÃ¸üÇå³þЩ¡£

¡¡¡¡´ð:ASMX 2.0 Ö§³Ö WS-I Basic Profile 1.1 ºÍ SOAP 1.2¡£ÕâÒâζ×Å£¬ËüÖ§³Ö XML 1.0¡¢XML ¼Ü¹¹¶¨Òå (XSD)¡¢Web ·þÎñÃèÊöÓïÑÔ (WSDL)¡¢SOAP 1.1¡¢SOAP 1.2 ÒÔ¼°±àÒëʱµÄ»ù±¾ÅäÖÃÎļþÒ»ÖÂÐÔÑéÖ¤¡£WSE 3.0 ͨ¹ýÌṩ¶ÔijЩ¸ü¸ß¼¶µÄ WS-* ЭÒéµÄÖ§³Ö£¬À´²¹³ä ASMX 2.0 µÄ¹¦ÄÜ¡£Ä¿Ç°£¬µ±ÄúÐèҪʹÓÃÒÔÏÂÒ»¸ö»ò¶à¸ö¹¦ÄÜÀ´ÔöÇ¿ ASMX ·þÎñʱ£¬Í¨³£»áʹÓà WSE 3.0:

  • ¡¡¡¡•»ùÓÚÏûÏ¢µÄ°²È«ÐÔ (WS-Security)
  • ¡¡¡¡•¸ßЧµÄ¶þ½øÖÆÊý¾Ý´«Êä (MTOM)
  • ¡¡¡¡•¿ÉÑ¡µÄËÞÖ÷»·¾³
  • ¡¡¡¡•×Ô¶¨ÒåÉùÃ÷ÐÔ²ßÂԹܵÀ

¡¡¡¡»ùÓÚÏûÏ¢µÄ°²È«ÐÔºÍ MTOM ÊÇÈËÃÇÔÚ ASMX ÏîÄ¿ÖÐÆôÓà WSE µÄÁ½¸öÖ÷ÒªÔ­Òò¡£»¹ÓÐÒ»¸öºÃÏûÏ¢ÊÇ£¬Äú²»±ØÐ޸ķþÎñÂß¼­¾Í¿ÉÒÔÕâÑù×ö¡£WSE 3.0 ͨ¹ý ASMX ÌṩµÄÀ©Õ¹µãÀ´ÀûÓà ASMX¡£ÕâʹÄúÄܹ»ÀûÓø÷ÖÖ WSE 3.0 ¹¦ÄÜ£¬¶ø²»±Øѧϰеıà³ÌÄ£ÐÍ ¡ª ÄúÐèÒª×öµÄ¾ÍÊÇÔËÐÐ WSE ÉèÖù¤¾ß²¢Ñ¡ÔñËùÐèµÄÑ¡Ïî¡£

¡¡¡¡ÔÚ ASMX ÏîÄ¿ÖÐÆôÓà WSE 3.0 µÄÁíÒ»¸öÔ­ÒòÊÇ£¬ÒªÀûÓÃËüµÄ²ßÂԹܵÀÀ©Õ¹ÐÔÄ£ÐÍ¡£WSE ʹÄúÄܹ»²åÈë¶Ô½øÈëºÍÀ뿪ÖÕ½áµãµÄ SOAP ÏûÏ¢Ö´ÐÐÔ¤´¦ÀíºÍºóÐø´¦ÀíµÄɸѡÆ÷¡£¸ÃÀ©Õ¹µã±È ASMX SOAPExtension ¿ò¼Ü¸üÒ×ÓÚʹÓã¬ÒòΪËüÌṩµÄ¹¦ÄÜ¿ÉÒÔ´´½¨Äܹ»Óë WSE ÌṩµÄÏÖÓÐÉùÃ÷ÐÔ°²È«²ßÂÔÏà½áºÏµÄ×Ô¶¨ÒåÉùÃ÷ÐÔ²ßÂÔ¡£Äú¾ö¶¨¡°ÆôÓá±WSE ¿ÉÄÜÖ»ÊÇΪÁ˾ßÓиÃÀ©Õ¹Ñ¡Ï»òÕßÖÁÉÙÊÇΪÁËʹÓøĽøµÄ SOAP ÏûÏ¢Õï¶Ï¸ú×Ù¹¦ÄÜ¡£

¡¡¡¡ÓÐÁË WSE 2.0£¬´ó¶àÊý¿ª·¢ÈËÔ±ÔÚÐèÒª½øÐÐ×Ô¶¨ÒåËÞÖ÷ʱ¾ÍÅ×ÆúÁË ASMX¡£ÏÖÔÚ£¬WSE 3.0 ʹÄúÄܹ»Ö´ÐÐ ASMX ÀàÐ͵Ä×Ô¶¨ÒåËÞÖ÷£¬Õâ¾Í¸üûÓÐÎÊÌâÁË¡£µ¼ÖÂÄúµ¥¶ÀʹÓà WSE ÏûÏ¢´¦Àí API µÄÖ÷ÒªÇé¿öÊÇ£¬ÐèҪʵÏÖ¿ÉÑ¡µÄÏûÏ¢½»»»Ä£Ê½£¬ÀýÈ磬˫¹¤Í¨ÐÅ¡¢¶à²¥»ò·¢²¼/¶©ÔÄÇé¿ö¡£ÏûÏ¢´¦ÀíÀà SOAPSender ºÍ SOAPReceiver ʹÄúÄܹ»ÊµÏÖÈκÎÀàÐ͵ĸ߼¶ÏûÏ¢´¦Àíģʽ¡£

ÎÊ:µ±ÎÒÔÚ Web Õ¾µãÖÐÆôÓà WSE 3.0 ºó£¬ÔÚÅäÖÃÎļþÖÐÔÙÒ²¿´²»µ½ WSE SOAPExtension ÁË¡£Ïà·´£¬ÎÒ¿´µ½ÁËÒ»¸ö SOAPServerProtocolFactory¡£ÄÇÊÇʲô?

¡¡¡¡´ð:ĬÈÏÇé¿öÏ£¬¿ÉÒÔʹÓü¸¸ö²»Í¬µÄ·þÎñÆ÷ЭÒéµ÷Óà ASMX ÖÕ½áµã£¬°üÀ¨ HTTPSOAP¡¢HTTPSOAP12¡¢HTTPGet¡¢HTTPPost¡¢HTTPPostLocalhost ºÍ Documentation¡£Äú¿ÉÒÔÔÚ Web.config ÖÐÆôÓûò½ûÓÃÆäÖÐÈκÎÒ»¸öЭÒé¡£.NET Framework 2.0 ÖеÄĬÈÏ ASMX ÅäÖÃÈçÏÂËùʾ:

<WebServices>
   <protocols>
      <clear />
      <add name="HTTPSOAP12" />
      <add name="HTTPSOAP" />
      <add name="HTTPPostLocalhost" />
      <add name="Documentation" />
   </protocols>
   ...
</WebServices>

¡¡¡¡Ã¿¸öЭÒ鶼ÆÚÍû²»Í¬ÀàÐ굀 HTTP ÏûÏ¢£¬²¢ÊµÏÖ²»Í¬µÄ ASMX µ÷ÓÃЭÒé¡£ÀýÈ磬¶ÔÓÚ HTTPSOAP£¬´«ÈëµÄ HTTP ÓÐЧ¸ºÔؽ«Ê¼ÖÕ°üº¬ £¬¶ø¶ÔÓÚ HTTPGet£¬Êý¾ÝÔÚ²éѯ×Ö·û´®Öд«ÈëÇÒ HTTP ÓÐЧ¸ºÔØΪ¿Õ¡£Ç°ÕßÔÚÏìÓ¦Öзµ»Ø SOAP Ðŷ⣬¶øºóÕßÖ»·µ»Ø´¿ XML¡£

¡¡¡¡ÎªÁË´¦ÀíÕâЩ²îÒ죬ASMX ´¦Àí³ÌÐò (System.Web.Services.Protocols.WebServiceHandler) ʹÓÃÃûΪ ServerProtocol µÄÀàÀ´´¦Àí´«ÈëµÄÏûÏ¢¡£»¹Óм¸¸öÅÉÉú×Ô ServerProtocol µÄÀ࣬°üÀ¨ SOAPServerProtocol ºÍ HTTPGetServerProtocol¡£ÕâЩÀཫӳÉäµ½ÅäÖÃÎļþÖеIJ»Í¬Ð­Òé¡£ASMX ´¦Àí³ÌÐò»á¼ì²é´«ÈëµÄ HTTP ÏûÏ¢£¬²¢Ñ¡ÔñºÏÊ浀 ServerProtocol ÀàÐÍ¡£´ÓÄÇʱÆð£¬ServerProtocol ʵÀý¾Í¿ªÊ¼¹ÜÀíµ÷ÓòÙ×÷µÄ¹ý³Ì¡£ÔÚµ÷Óùý³ÌÖУ¬SOAPExtension ¿ò¼Ü¾ÍÊÇËü¹ÜÀíµÄÄÚÈÝÖ®Ò»¡£

¡¡¡¡SOAPExtension ¿ò¼ÜÊÇÒ»¸öÀ©Õ¹µã£¬ÒԱ㿪·¢ÈËÔ±ÔÚ ASMX ´¦Àí³ÌÐòºÍÄ¿±ê WebMethod Ö®¼ä²åÈë´úÂ롣ʵ¼ÊÉÏ£¬ËüÌṩÁËÒ»ÖÖÓÃÓÚת»»´«ÈëÏûÏ¢Á÷ºÍ´«³öÏûÏ¢Á÷µÄ»úÖÆ¡£Èç¹ûÄúÐèÒªÐÞ¸Ä SOAPExtension ÖеÄÏûÏ¢£¬Ôò±ØÐëÌṩһ¸ö½«´«µÝµ½Á´ÖÐÏÂÒ»¸öÀ©Õ¹µÄÐÂÁ÷(ÔÚÒ»¿ªÊ¼¼´Óë SOAPExtension.ChainStream °ó¶¨ÔÚÒ»Æð)¡£Òò´Ë£¬½«Öظ´ÒÔϹý³Ì:SOAPExtension ½ÓÊÕÁ÷£¬½øÐзÖÎö£¬Ö´ÐÐËüµÄÈÎÎñ£¬È»ºóдÈëÏÂÒ»¸ö SOAPExtension ½«¶ÁÈ¡µÄÁ÷¡£

¡¡¡¡WSE 2.0 ÍêÈ«×÷Ϊ SOAPExtension ¶øʵÏֵġ£Ôڸü¶±ðʵÏÖ WSE µÄÒ»¸öÎÊÌâÊÇ£¬Ëü»áÔÚÁ÷¼¶±ðµ¼Ö´óÁ¿µÄÐòÁл¯/·´ÐòÁл¯ÏµÍ³¿ªÏú¡£ÒƵ½ WSE 3.0£¬WSE С×éÏ£Íûͨ¹ý½«³éÏó²ãÉÏÒƲ¢±àд×Ô¼ºµÄ SOAPServerProtocol ʵÏÖÀ´ÓÅ»¯ËûÃÇµÄ SOAP ´¦ÀíÄ£ÐÍ¡£Òò´Ë£¬ËûÃÇѯÎÊ ASMX С×éÊÇ·ñÄܹ»Í¨¹ý ASMX 2.0 ÖеÄÅäÖÃÀ´Ì滻ĬÈ쵀 SOAPServerProtocol¡£ASMX ¿ª·¢ÈËÔ±Ìṩһ¸öÃûΪ µÄÐÂÅäÖÃÔªËØ£¬ÈκÎÈ˶¼¿ÉÒÔʹÓÃËüÀ´Ìṩ×Ô¼ºµÄʵÏÖ(ËäÈ»ÎÒÃDz»¹ÄÀøÕâô×ö)¡£ASMX ´¦Àí³ÌÐò»á¶ÁÈ¡¸ÃÀàÐÍ£¬²¢ÓÃËüÀ´´´½¨ÏàÓ¦ SOAPServerProtocol ÀàÐ͵ÄʵÀýÒÔ´¦ÀíеÄÇëÇó¡£WSE 3.0 ½«Ê¹Óøùҹ³£¬²¢Ê¹Óà Microsoft.Web.Services3.WSEProtocol À´Ì滻ĬÈ쵀 SOAPServerProtocol Àà¡£

¡¡¡¡WSEProtocol ¿ÉÒÔÔÚͬһ¸öÀàÖйÜÀí SOAPExtension »úÖÆºÍ WSE ¹ÜµÀ£¬´Ó¶ø¼õÉÙÁËһЩÁ÷Ħ²Á¡£WSE 3.0 ÈÔȻʹÓà SOAPExtension(ÃûΪ WSEProtocolExtension)£¬µ«Ëü´ÓÀ´²»ÔÚÅäÖÃÎļþÖгöÏÖ£¬ÕâÊÇÒòΪ WSEProtocol ÔÚÆô¶¯Ê±¶¯Ì¬²åÈëËü(ÒÔÈ·±£ËüʼÖÕ´æÔÚ)¡£WSEProtocolExtension Ö»¸ºÔðʶ±ðºÍ·ÖÎö MTOM ºÍ XML 1.0 Á÷;ÆäËûÊÂÇé¾ùÓÉ WSEProtocol ʵÏÖÀ´Íê³É¡£

¡¡¡¡Òò´Ë£¬¼òµ¥Ëµ£¬ ÊÇ WSE 3.0 ½«×ÔÉíÈÚÈë ASMX 2.0 µÄ·½Ê½¡£WSE 3.0 ÈÔȻʹÓà SOAPExtension£¬Ôڸð汾ÖУ¬ËüÖ»ÊDz»ÔÚÖ´ÐÐÈÎÎñµÄ¾ö²ßµØ¡£

¡¡ÎÊ:Èç¹ûÔÚÎÒ×Ô¼ºµÄÓ¦ÓóÌÐòÖгÐÔØ ASMX À࣬»á¶Ô HTTPContext.Current Ôì³ÉʲôӰÏì?SOAPExtension ÓÖÈçºÎÄØ?

¡¡¡¡´ð:Òź¶µÄÊÇ£¬ASMX Éè¼ÆÓë ASP.NET ½ôÃܵØñîºÏÔÚÒ»Æð¡£ÀýÈ磬µ± Visual Studio® ´´½¨Ð嵀 ASMX Ààʱ£¬ÔÚĬÈÏÇé¿öÏ»á´Ó System.Web.Services.WebService ÅÉÉú¡£Õâ»áͨ¹ýÐ嵀 ASMX ÀàÉϵÄÊôÐÔÀ´¹«¿ª¸÷ÖÖ System.Web.HTTPContext ÊôÐÔ£¬´Ó¶ø¹ÄÀøËüÃÇÔÚ WebMethod ÖеÄʹÓá£Ä³Ð©¿ª·¢ÈËÔ±»¹Ï°¹ßÓÚͨ¹ý HTTPContext.Current ÏÔʽʹÓà HTTP ÉÏÏÂÎÄ¡£

¡¡¡¡µ±ÄúʹÓà WSE 3.0 ÖÐµÄ SOAPReceivers ³ÐÔØÒ»¸ö ASMX Ààʱ£¬ÕâÖÖÀàÐ͵ĴúÂë¾Í²»ÔÙ¹¤×÷ÁË¡£±¾Àý£¬ÄúµÄ´úÂëÔÚ IIS ºÍ ASP.NET HTTP ¹ÜµÀÖ®ÍâÖ´ÐС£HTTPContext.Current ½«Ê¼ÖÕΪ¿Õ£¬Òò´ËÕâ¿ÉÄÜÒªÇóÄúÐÞ¸ÄÏÖÓÐµÄ WebMethod Âß¼­¡£Í¨³££¬Èç¹ûÄú´òËãÔÚ ASP.NET Ö®ÍâµÄËÞÖ÷»·¾³ÖÐÖØÓøÃÀàÐÍ£¬ÔòÓ¦¸Ã±ÜÃâÔÚ WebMethod ´úÂëÖÐÒÀÀµ HTTP ¹ÜµÀÖеÄÈκÎÄÚÈÝ¡£

¡¡¡¡´ËÍ⣬ÔÚʹÓà SOAPReceivers ×÷ΪËÞÖ÷ʱ£¬¾Í²»ÄÜÔÙÒÀÀµ HTTPModule »ò SOAPExtension ΪÄúÖ´ÐÐÈÎÎñÁË¡£ÒòΪÏÖÔÚÄúÔÚ ASMX ´¦Àí³ÌÐòÖ®ÍâÖ´ÐУ¬ËùÒÔÕâЩý½é½«²»ÔÙÆð×÷Óá£

¡¡¡¡ÎÊ:ÎÒÔÚ WSE 3.0 ÉèÖù¤¾ßÖÐÕÒ²»µ½ Filters Ñ¡Ï¡£ÈçºÎ·ÃÎÊËüÄØ?

¡¡¡¡´ð:Filters Ñ¡Ï²»ÔÙλÓÚ WSE 3.0 ÉèÖù¤¾ßÖУ¬ÒòΪ ÔªËØÒѾ­´Ó WSE 3.0 ÅäÖò¿·ÖÖÐÒƳýÁË¡£ÔÚ WSE 2.0 ÖУ¬ÄúʹÓà ԪËØÀ´¶¨Òåͨ¹ýɸѡÆ÷¹¹½¨¹ÜµÀµÄ·½Ê½¡£Ä¬ÈÏÇé¿öÏ°üº¬µÄÒ»¸öɸѡÆ÷ÊDzßÂÔɸѡÆ÷¡£²ßÂÔɸѡÆ÷²é¿´ÁíÒ»¸öÅäÖÃÎļþ(²ßÂÔÎļþ)£¬ÒÔ±ã¸ù¾ÝÆä¶ÏÑÔ(ÀàËÆÓÚɸѡÆ÷)À´¾ö¶¨ÈçºÎ´¦Àí´«ÈëºÍ´«³öµÄÏûÏ¢¡£

¡¡¡¡ÔÚ WSE 3.0 ÖУ¬ÕâÁ½¸ö¸ÅÄîÒÑͳһ¡£Òò´Ë£¬ÏÖÔڵIJßÂÔÓɶÏÑÔ×é³É£¬²¢ÇÒÿ¸ö¶ÏÑÔ¶¼»áÔڹܵÀÖвåÈë WSE ɸѡÆ÷¡£Äú½«¶ÏÑԷŵ½²ßÂÔÖУ¬ÒÔ¿ØÖÆɸѡÆ÷¹ÜµÀÔÚÔËÐÐʱÈçºÎ¹¹½¨ºÍ×éÖ¯¡£Òò´Ë£¬Èç¹ûÄúÏ£ÍûÔڹܵÀÖвåÈë×Ô¶¨ÒåɸѡÆ÷£¬ÔòÓ¦¸Ã±àдɸѡÆ÷À࣬±àдʹÓÃÐÂɸѡÆ÷µÄ²ßÂÔ¶ÏÑÔÀ࣬ÔÚ²ßÂÔÖÐʹÓöÏÑÔÀ࣬Ȼºó½«¸Ã²ßÂÔÓ¦ÓÃÓÚ·þÎñ¡£ÔÚ WSE 3.0 ÖУ¬ÕýÊDzßÂÔ¿ò¼ÜÇý¶¯×ŹܵÀ£¬Òò´Ë¾Í²»ÔÙÐèÒª²¿·Ö¡£

¡¡ÎÊ:WSE 3.0 Ö§³ÖÄÄЩ´«Êä?±àд×Ô¶¨Òå´«ÊäºÜÄÑÂð?

¡¡¡¡´ð:WSE 3.0 Ö§³Ö HTTP ºÍ TCP¡£WSE Ìṩһ¸ö×Ô¶¨Òå´«Êä¿ò¼Ü£¬ÒÔÔÊÐíµÚÈý·½²åÈë×Ô¼ºµÄ´«ÊäʵÏÖ¡£×Ô´Ó WSE 2.0 ·¢²¼ÒÔºó£¬Ò»Ð©¿ª·¢ÈËÔ±ÌṩÁËʾÀý WSE ´«ÊäÀ´ÑÝʾÈçºÎÍê³É´Ë²Ù×÷¡£ÆäÖÐÒ»¸ö¿ÉÓÃÓÚ Microsoft ÏûÏ¢¶ÓÁзþÎñÆ÷ (MSMQ)¡¢SMTPºÍ UDP¡£ËùÓÐÕâЩ´«Êä¾ùÕë¶Ô WSE 2.0 ±àд£¬µ«Êǽ«ËüÃÇÒÆÖ²µ½ WSE 3.0 ҲûʲôÎÊÌâ¡£

¡¡¡¡ÒÔÏ´úÂëÌṩһ¸öʹÓà SMTP ´«ÊäÔÚ¿ØÖÆ̨ӦÓóÌÐòÖÐËÞÖ÷·þÎñµÄʾÀý:

SOAPReceivers.Add(new Uri("SOAP.SMTP://test@skonnard.com"),
    typeof(ExpenseReportService));
Console.ReadLine();

¡¡¡¡È»ºó£¬ÔÚ¿Í»§¶Ë£¬ÄúÖ»ÐèÔÚµ÷Ó÷½·¨Ç°Ö¸¶¨ SMTP µØÖ·¼´¿É£¬ÈçÏÂËùʾ:

ExpenseReportServiceWSE svc = new ExpenseReportServiceWSE();
svc.Url = "SOAP.SMTP://test@skonnard.com";
svc.Submit(report);

¡¡¡¡ÏÖÔÚ£¬¿Í»§¶Ë½«Ïò test@skonnard.com µç×ÓÓʼþµØÖ··¢ËÍÏûÏ¢£¬½ÓÊÕÆ÷½«´Óͬһ¸öµØÖ·½ÓÊÕÏûÏ¢¡£¸ÃʾÀýÖбȽÏÓÐȤµÄÊÇ£¬¿Í»§¶ËºÍ½ÓÊÕÆ÷²»ÔÙÐèҪͬʱÔËÐС£Çë×¢Ò⣬ÔÚʹÓÃ×Ô¶¨Òå´«Êäʱ£¬¿ª·¢ÈËÔ±ÌåÑé²»»áÊܵ½Ó°Ïì¡£Äú±ØÐë×öµÄÒ»¼þÊÂÊÇ£¬Í¨¹ý½« Ó³ÉäÌí¼Óµ½ WSE ÅäÖò¿·ÖÀ´¸æËß WSE ÈçºÎ´¦Àí¡°SOAP.SMTP¡±Ð­Òé·½°¸£¬ÈçÏÂËùʾ:

<Microsoft.Web.services3>
  <messaging>
    <transports>
      <add scheme="SOAP.SMTP" type="SOAPSMTPTransport,SOAPSMTP"/>
    </transports>
  </messaging>
  ...
</Microsoft.Web.services3>

¡¡¡¡¸ÃÔªËؽ«Ð­Òé·½°¸Ó³Éäµ½Ò»¸ö´Ó ISOAPTransport ÅÉÉúµÄÀà¡£µ±µ÷Óà SOAPReceivers.Add ʱ£¬Ëü»á´ÓÅäÖò¿·Ö²éÕÒÓ³Éäµ½Ö¸¶¨Ð­Òé·½°¸µÄÀàÐÍ¡£È»ºó£¬Ëü»áʵÀý»¯Ö¸¶¨µÄÀàÐÍ£¬²¢Ê¹Óà ISOAPTransport ·½·¨Éú³ÉÊäÈëºÍÊä³öͨѶÐŵÀ¡£¿Í»§¶ËÒ²»á·¢ÉúͬÑùµÄ²Ù×÷¡£ÕâЩÐŵÀ»á¶ÔÆäÓà API Òþ²ØËùÓд«ÊäʵÏÖµÄϸ½Ú¡£

¡¡¡¡Òò´Ë£¬±àд×Ô¶¨Òå WSE ´«ÊäÐèҪʵÏÖÈý¸öÀà:Ò»¸öÓÃÓÚ½¨Ä£´«Êä (ISOAPTransport)£¬ÁíÍâÁ½¸öÓÃÓÚ½¨Ä£ÊäÈë/Êä³öÐŵÀ(ISOAPInputChannel ºÍ ISOAPOutputChannel)¡£´«Êä¿ÉÌṩÐŵÀ²¢¹ÜÀíËùÓÐÐŵÀ¹²ÏíµÄ×ÊÔ´£¬¶øÐŵÀÖ÷ÒªÓÃÓÚͨ¹ý´«Êä·¢ËÍ/½ÓÊÕÏûÏ¢¡£ÕâÀÄú´¦ÀíµÄÊǵͼ¶±ð´«Êäϸ½Ú£¬Òò´ËÓеãÀ§ÄÑ¡£Á˽âÆ乤×÷·½Ê½µÄ×î¼Ñ·½·¨ÊÇ£¬ÑÝÁ·ÎÒÔÚÇ°ÃæÌáµ½µÄÏÖÓÐ WSE ´«ÊäʾÀý¡£

¡¡ÎÊ:ÎÒÄÜʹÓá°Add Web Reference¡±Îª×Ô¶¨ÒåËÞÖ÷µÄ WSE 3.0 ·þÎñÉú³É´úÀíÂð?

¡¡¡¡´ð:Èç¹ûÄúÔÚʹÓà TCP ½øÐÐͨѶµÄ Windows ·þÎñÖгÐÔØ·þÎñ£¬Ôò¼ìË÷ WSDL µÄΨһ·½·¨¾ÍÊÇʹÓà WSEWSDL3.exe ¹¤¾ß¡£¸Ã¹¤¾ß»áÏòÇëÇóÆäÔªÊý¾ÝµÄ·þÎñ·¢ËÍ SOAP ÏûÏ¢£¬²¢¸ù¾ÝÔÚ SOAP ÏìÓ¦ÏûÏ¢Öзµ»ØµÄ WSDL Éú³É´úÀí¡£

¡¡¡¡µ«ÊÇ£¬Èç¹ûÏàͬµÄ·þÎñҲͨ¹ý ASP.NET (HTTP) À´³ÐÔØ£¬Ôò¿ÉÒÔʹÓà Visual Studio Öеıê×¼¡°Add Web Reference¡±ÃüÁî(»ò WSDL.exe)À´Éú³É´úÀí(ÔÚ´Ë֮ǰ£¬ÇëÈ·±£ÄúÔÚ¿Í»§¶ËÓ¦ÓóÌÐòÖÐÆôÓÃÁË WSE£¬ÒÔ±ã»ñµÃ WSE ´úÀí)¡£Éú³ÉµÄ WSE ´úÀí¿ÉÒÔÓÃÓÚÈκΠWSE ´«Ê䣬¶ø²»½ö½öÊÇ HTTP¡£Ö»Ðèͨ¹ý Url »ò Destination ÊôÐÔ½«´úÀíµÄµØÖ·¸ü¸ÄΪ TCP µØÖ·£¬Ëü¾Í¿ÉÒÔÏñͨ¹ý WSEWSDL3.exe Éú³ÉµÄ´úÀíÒ»Ñù¹¤×÷ÁË¡£

¡¡¡¡ÎÊ:Ó