Java¿ª·¢WebServiceʵÀý ¼ÆÊýÆ÷
Ò»¡¢Ç°ÑÔ
±¾Îļٶ¨ÄãÓÐÒ»¶¨µÄJ2EE¿ª·¢¾Ñ飬Õâ¸ö½Ì³ÌûÓйý¶àµÄÉæ¼°»ù´¡ÖªÊ¶ºÍ¿ª·¢Ï¸½Ú¡£Èç¹ûÔÚÔĶÁ¹ý³Ì³öÓÐʲôÎÊÌ⣬»¹ÇëÓëÎÒÁªÏµ½»Á÷¡£
Èç¹ûʹÓÃGOOGLE¡¢BAIDUµÈËÑË÷¹¤¾ß£¬ËÑË÷WebServiceµÄÏà¹Ø֪ʶ£¬¿ÉÒԲ鵽N¶àµÄÍøÒ³£¬ÎÒ¾ÍÊÇͨ¹ýÕâЩÍøÒ³µÄѧϰ£¬Öð½¥ÕÆÎÕÁËЩWebServiceµÄÏà¹Ø֪ʶ¡£ÕâÀï¶ÔÄÇЩÎÞ˽·îÏ×֪ʶµÄÈËÒ»²¢±íʾ¸Ðл¡£ ¡¡
¡¡ ÍøÉϹØÓÚWebServiceµÄÀý×Ó£¬¶àÊÇһЩ¼òµ¥µÃ²»ÄÜÔÙ¼òµ¥µÄhello worldµÄÀý×Ó£¬¼òµ¥µÃÒÔÖÁÓÚÄã¶ÔWebServiceûÓÐʲô¸Ð¾õ¡£ÓÐÁËWebServiceµÄ»ù±¾ÖªÊ¶ºó£¬ÎÒÒ»Ö±ÔÙÏ룬¿ÉÒÔ°ÑʲôÑùµÄ¼´¼òµ¥ÓÖʵÓõĶ«¶«×ö³ÉWebService£¬¿ªÕ¹Ê¾Ò»ÏÂÆ书ÄÜÌص㡣½ñÌìÖÕÓÚÏëµ½Ò»¸ö£º¼ÆÊýÆ÷£¬¼ÆÊýÆ÷ÓõñȽ϶࣬¹¦ÄܱȽ϶ÀÁ¢£¬×ö³ÉWebService¿ÉÒÔÒ»ÀÍÓÀÒÝΪ²»Í¬ÏµÍ³£¨²»¹ÜÊÇJSP»¹ASP£¬ÕâÊÇWebServiceµÄÍ»³öÓŵ㣩¡¢²»Í¬Ó¦ÓýÚÊ¡´ËÀà±àÂ빤×÷£¬¿ÉÒÔ˵ÒÔºóÔÙÒ²²»ÓÃд¼ÆÊýÆ÷ÁË¡£Ö»ÒªÓþÍÐÐÁË¡£
˵ÁËÕâô¶à·Ï»°£¬ÏÂÃæÎÒÃÇ¿ªÊ¼¡£±¾½Ì³Ì½éÉÜÒ»ÏÂWebService»·¾³´î½¨¡¢·þÎñ²¿ÊðµÄÏà¹Ø֪ʶ£¬È»ºó½éÉÜÒ»¸ö¼ÆÊýÆ÷µÄ¿ª·¢¡£
ÔËÐÐͼ£º
¶þ¡¢»ù´¡¹¤×÷
1.¿ª·¢»·¾³
¡¡¡¡ ÎÒʹÓÃaxis×öΪWeb ServiceÒýÇ棬ËüÊÇApacheµÄÒ»¸ö¿ªÔ´web serviceÒýÇæ¡£ËüÄ¿Ç°×îΪ³ÉÊìµÄ¿ªÔ´web serviceÒýÇæÖ®Ò»¡£ÏÂÃæÎÒÖ÷Òª½éÉÜÒ»ÏÂÈçºÎʹÓÃAxis´î½¨web service ·þÎñµÄ»·¾³¡£
¡¡¡¡ ¢Ù°²×°tomcat5.0Ó¦Ó÷þÎñÆ÷£¨Ò²¿ÉÒÔ×°5.5£¬²»¹ýÎÒÒ»Ö±ÔÚÓÃ5.0£©;
¡¡¡¡ ¢Ú½âѹÏÂÔØ£¨ http://ws.apache.org/Axis£©ºóµÄaxis°ü£¬½«°üÖÐaxisĿ¼¸´ÖƵ½tomcatĿ¼ÏµÄwebappsĿ¼Ï£»¡¡¡¡
¡¡¡¡ ¢Û½«axis/WEB-INF/libĿ¼ÏÂÀàÎļþ¸´ÖƵ½tomcatĿ¼ÏµÄcommon/libĿ¼Ï£»
¡¡¡¡ ¢ÜÖØÐÂÆô¶¯tomcat,·ÃÎÊhttp://localhost:8080/axis/happyaxis.jsp,Èç¹ûÄÜ·ÃÎÊ£¬±íʾ°²×°³É¹¦£»
¡¡¡¡×¢Ò⣬axisÓм¸¸ö¿ÉÑ¡µÄ°ü£¬Èçemail.jar....£¬Äã¿ÉÒÔÕÒÀ´·Åµ½tomcatĿ¼ÏµÄcommon/libĿ¼Ï£¬Èç¹û²»Ê¹ÓÃÏà¹ØµÄ¹¦ÄÜÒ²¿ÉÒÔ²»Óá£
¡¡¡¡ÕâÑù£¬¿ª·¢»·¾³¾Í´î½¨ºÃÁË¡£
2.ÈçºÎ²¿ÊðWeb Service
¡¡¡¡²¿ÊðÓÐÈýÖÖ·½Ê½£ºDynamic Invocation Interface(DII)¡¢Stubs·½Ê½¡¢Dynamic Proxy·½Ê½£»ÕâÀï¾Í½éÉÜһϼòµ¥£¬Ò²ÊÇÎÒʹÓõķ½Ê½£ºDII¡£
¡¡¡¡ DII·½Ê½ÖУ¬ÏÈдºÃ·þÎñµÄJAVAÎļþ£¨¼ÙÉèÃû×ÖΪhelloworld.java£©£¬È»ºó°ÑËü£¨×¢ÒâÊÇÔ´Îļþ£©¿½±´µ½webapps/axisĿ¼ÖУ¬ºó׺¸Ä³Éjws(´ËʱÎļþÃûΪ£ºhelloworld.jws)£¬È»ºó·ÃÎÊÁ¬½Óhttp://localhost:8080/Ax
Ïà¹ØÎĵµ£º
import java.util.Date;
import java.text.SimpleDateFormat; //ΪÁËÏÔʾʱ¼ä¶ø¼Ó
Date date = new Date(); //»ñµÃϵͳʱ¼ä.
String nowTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
//½«Ê±¼ä¸ñʽת»»³É·ûºÏTimestampÒªÇóµÄ¸ ......
Java·¢Õ¹µ½ÏÖÔÚ£¬°´Ó¦ÓÃÀ´·ÖÖ÷Òª·ÖΪÈý´ó¿é£ºJ2SE,J2MEºÍJ2EE¡£ÕâÈý¿éÏ໥²¹³ä£¬Ó¦Ó÷¶Î§²»Í¬¡£
J2SE¾ÍÊÇJava2µÄ±ê×¼°æ£¬Ö÷ÒªÓÃÓÚ×ÀÃæÓ¦ÓÃÈí¼þµÄ±à³Ì£»
J2MEÖ÷ÒªÓ¦ÓÃÓÚǶÈëÊÇϵͳ¿ª·¢£¬ÈçÊÖ»úºÍPDAµÄ±à³Ì£»
J2EEÊÇJava2µÄÆóÒµ°æ£¬Ö÷ÒªÓÃÓÚ·Ö²¼Ê½µÄÍøÂç³ÌÐòµÄ¿ª·¢£¬Èçµç×ÓÉÌÎñÍøÕ¾ºÍERPϵͳ¡£
ÏÈѧϰj2se
Ҫѧϰj2ee¾ÍÒ ......
1.ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ(OOA/OOD)¡¢É漰ģʽ(GOF£¬J2EEDP)ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÊ®·ÖÁ˽âUML£¬ÓÈÆäÊÇclass£¬object£¬interactionÒÔ¼°statediagrams¡£
¡¡¡¡2.ÄãÐèҪѧϰJAVAÓïÑԵĻù´¡ÖªÊ¶ÒÔ¼°ËüµÄºËÐÄÀà¿â(collections£¬serialization£¬streams£¬networking£¬ multithreading ......
input stream Out stream
DataInputStream DataIOutStream
BufferedInputStream BufferedOutStream
LineNumberInputStream PrintStream
PushbackInputStream
ÒÔ×Ö½ÚΪµ¼
ÏòµÄ stream
----------(ÎÞ ......
±àÕß°´£º¶ÔJavaÉçÇøÀ´Ëµ,2009ÄêÊÇÒ»¸ö¶àÊÂÖ®Ä꣺OracleµÄÊÕ¹º´øÀ´Ï£Íûµ«¸ü¶àµÄÊǵ£ÓÇ£»¶ÔJava7µÄ½¹¼±µÈ´ý£»¶ÔÊÇ·ñÐèÒª±Õ°üµÄ³Ö
ÐøÕùÒ飻ÆäËûÊÕ¹º¶Ô¿ªÔ´ÉçÇøµÄÓ°Ïì±¾ÎÄÔ×÷ÕßJames SugrueÁªºÏJavaÉçÇøµÄÆäËûÈýλºËÐÄ¿ª·¢Õ߶Ô2009ÄêµÄJava½øÐÐÁËÅ̵㡣
James SugrueÊÇJavaLobbyºÍEclipseZoneµÄ±à¼£¬Ò»Î»Eclipse¿ª·¢Õߣ¬Jav ......