java soap + tomcat ¿ª·¢
²»´øjavaBeanµÄSOAPµ÷ÓÃ
Ê×ÏÈ£¬ÏÂÔØsoap.war£¬javamail.jar£¬activation.jar£¬soap.jar£¬xerces.jar£¬È»ºó¾ÍÊÇÅäÖû·¾³£¬ÈçºÎÅäÖþͲ»Ï¸ËµÁË¡£
°Ñsoap.warÈÓµ½tomcatµÄwebappsÏ£¬Æô¶¯tomcat£¬·ÃÎÊhttp://127.0.0.1:8080/soap£¬³öÏÖHello! Welcome to Apache-SOAP. ¾Í˵Ã÷»·¾³´î½¨ºÃÁË¡£
Ê×ÏȽ¨Á¢¸öjavaÏîÄ¿£¬°üÃû½Ðsoap£¬ÀàÃû½ÐSOAPService£¬Õâ¸ö¾ÍÊÇÒªÔ¶³Ìµ÷ÓõÄÀà
SOAPService.java£º
package soap;
public class SOAPService
{
public Person sayHi(String name)
{
return "Hello! " + name;
}
}
È»ºó´ò¿ªsoapµÄ¹ÜÀíÒ³Ã棬http://127.0.0.1:8080/soap/admin
ÔÚ¹ÜÀíÒ³Ãæµã»÷“Deploy”°´Å¥£¬ÅäÖò¿ÊðÕâ¸öÀ࣬Ìîд»ù±¾ÐÅÏ¢ÈçÏ£º
ID urn:HelloWorld_SOAPService
Scope Application
Provider Type java
Provider Class soap.SOAPService
Use Static Class no
Methods sayHi
ÅäÖúú󣬱àдsoapµÄµ÷ÓÃÀàSOAPClient
SOAPClient.java
package com.kt.test;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Vector;
import org.apache.soap.Constants;
import org.apache.soap.Fault;
import org.apache.soap.SOAPE
Ïà¹ØÎĵµ£º
JavaỊ̈߳ºÐÂÌØÕ÷-ÐźÅÁ¿
JavaµÄÐźÅÁ¿Êµ¼ÊÉÏÊÇÒ»¸ö¹¦ÄÜÍê±ÏµÄ¼ÆÊýÆ÷£¬¶Ô¿ØÖÆÒ»¶¨×ÊÔ´µÄÏû·ÑÓë»ØÊÕÓÐןÜÖØÒªµÄÒâÒ壬ÐźÅÁ¿³£³£ÓÃÓÚ¶àÏ̵߳ĴúÂëÖУ¬²¢Äܼà¿ØÓжàÉÙÊýÄ¿µÄÏ̵߳ȴý»ñÈ¡×ÊÔ´£¬²¢ÇÒͨ¹ýÐźÅÁ¿¿ÉÒÔµÃÖª¿ÉÓÃ×ÊÔ´µÄÊýÄ¿µÈµÈ£¬ÕâÀï×ÜÊÇÔÚÇ¿µ÷“ÊýÄ¿”¶þ×Ö£¬µ«²»ÄÜÖ¸³öÀ´ÓÐÄÄЩÔڵȴý£¬ÄÄЩ×ÊÔ ......
°æȨÉùÃ÷£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://as112255.blogbus.com/logs/38662785.html
package com.softeem.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐ ......
synchronized£º ͬ²½µÄ
synchronizedÔÚ²Ù×÷ÉÏÓÐÁ½ÖÖÓ°Ïì¶ÔÏóµÄÇé¿ö£º
1) ÔÚij¸ö¶ÔÏóʵÀýÄÚ£¬synchronized method(){}¿ÉÒÔ·ÀÖ¹¶à¸öÏß³Ìͬʱ·ÃÎÊÕâ¸ö¶ÔÏóµÄsynchronized·½·¨£¨Èç¹ûÒ»¸ö¶ÔÏóÓжà¸ösynchronized·½·¨£¬Ö»ÒªÒ»¸öÏ̷߳ÃÎÊÁËÆäÖеÄÒ»¸ösynchronized·½·¨£¬ÆäËüÏ̲߳»ÄÜͬʱ·ÃÎÊÕâ¸ö¶ÔÏóÖÐÈκÎÒ»¸ösynchronized·½·¨£ ......
/**
* Õâ¶Î³ÌÐò²¢²»ÄÑ£¬Ó¦¸ÃºÜºÃ¿´¶®£¬ÎҰѹý³Ì´óÖ½²Ò»Ï£¬Ê×ÏÈÄãµÄÄÔ×ÓÀïÏȸ¡ÏÖÒ»¸öÊý×éºÍÈý¸öÖ¸Õ룬
* µÚÒ»¸öÖ¸Õë³ÆΪpÖ¸Õ룬ÔÚÕû¸ö¹ý³Ì½áÊø֮ǰËüÀÎÀεÄÖ¸ÏòµÚÒ»¸öÊý£¬µÚ¶þ¸öÖ¸ÕëºÍµÚÈý¸öÖ¸Õë·Ö±ðΪloÖ¸ÕëºÍhiÖ¸Õ룬
* ·Ö±ðÖ¸Ïò×î×ó±ßµÄÖµºÍ×îÓұߵÄÖµ¡£loÖ¸ÕëºÍhiÖ¸Õë´ÓÁ½±ßͬ ......
½ñÌìÓöµ½Ò»¸öÒªÉú³ÉÒ»¸öÏÂÀÁбí¿òµÄÎÊÌ⣬ÎÒµÄÏë·¨ÊÇ£º½«Êý¾Ý¿âÄÚµÄËùÓÐÊý¾Ý¶¼´æ´¢µ½Ò»¸öListÀïÃ棬ÔÙÔÚǰ̨±éÀúÕû¸ölist¡£
Ö´ÐÐЧ¹ûͼ£º
Ë®¹û
→Æ»¹û
→→Æ»¹ûϵÁÐ1
→→Æ»¹ûϵÁÐ2
→→Æ»¹ûϵÁÐ3
→→Æ»¹ûϵÁÐ4
→Àæ
→ÌÒ×Ó
ѧϰÓÃÆ·
→±Ê
→→Ǧ±Ê ......