Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

JAVA»ñµÃµ±Ç°Ê±¼ä

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ÒªÇóµÄ¸ ......

linuxϲ鿴java·¾¶

ÓÃÃüÁî whereis java¾Í¿ÉÒÔ¿´µ½ÁË
eg:
-bash-3.1$ whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /opt/jdk1.6.0_01/bin/java

Èç¹û½ö½öÏëÖªµÀjavaÖ´Ðз¾¶ÔÚÄÇÀïµÄ»° ÓÃwhich java¾Í¿ÉÒÔÁË
eg:
-bash-3.1$ which java
/usr/bin/java ......

Java±à³ÌÖеÄÒì³£´¦Àí

×÷ÕߣºÔËÆø
email: webmaster@chinaspx.com
ÈÕÆÚ£º7/1/2001 10:10:46 PM
Java±à³ÌÖеÄÒì³£´¦ÀíÊÇÒ»¸öºÜ³£¼ûµÄ»°ÌâÁË£¬¼¸ºõÈκÎһÎéÉÜÐÔµÄJava¿Î³Ì¶¼»áÌáµ½Òì³£´¦Àí¡£²»¹ý£¬ÎÒÈÏΪºÜ¶àÈËÆäʵ²¢Ã»ÓÐÕæÕýÕÆÎÕÕýÈ·´¦ÀíÒì³£Çé¿öµÄ·½·¨ºÍ²ßÂÔ£¬×î¶àÒ²¾Í²»¹ýÁ˽â¸ö´ó¸Å£¬ÖªµÀµã¸ÅÄî¡£±¾ÎľͶÔÈýÖÖ²»Í¬³Ì¶ÈºÍÖÊÁ¿µÄJavaÒì³£´¦À ......

[ת]javaÖÐbyteת»»intʱΪºÎÓë0xff½øÐÐÓëÔËËã

ÔÚÆÊÎö¸ÃÎÊÌâÇ°Çë¿´ÈçÏ´úÂë
public static String bytes2HexString(byte[] b) {
  String ret = "";
  for (int i = 0; i < b.length; i++) {
   String hex = Integer.toHexString(b[ i ] & 0xFF);
   if (hex.length() == 1) {
    hex = '0' ......

java Preferences³Ö¾Ã»¯Ê¹ÓÃʾÀý

  jdk1.4ÒýÈëÁËPreferences API£¬Ëü±È¶ÔÏóÐòÁл¯¸ü½Ó½üÓڳ־û¯£¬ÒòΪËü¿ÉÒÔ×Ô¶¯´æÈ¡ºÍ¶ÁÈ¡ÐÅÏ¢¡£PreferencesÀàËÆÓÚ¼üÖµ¶Ô£¬´æÈ¡ÔÚÒ»¸ö½Úµã²ãÎö½á¹¹ÖУ¬²»¹ýËüÖ»ÄÜ´æȡԭʼÊý¾ÝÀàÐͺÍ×Ö·û´®£¬Ã¿¸ö×Ö·û´®µÄ³¤¶È²»Äܳ¬¹ý8k¡£
import java.util.prefs.Preferences;
public class PreferencesDemo {

public static ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ