锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
<bean id="nodeSvcImpl" class="com.exchangebit.nms.magic.NodeSvcImpl">
<property name="notifyClient" ref="notifyClient"/>
</bean>
<jaxws:endpoint
id="nodeSvc"
implementor="#nodeSvcImpl"
address="/NodeSvc">
</jaxws:endpoint>
榪欐錛屽埌鏄疌XF鐨凷ERVER鍜孋LIENT閮藉彲浠ユ甯擱氫俊浜嗐備絾鎴戜笉璇翠篃鐭ラ亾鍟︼紝PERL鍙堝嚭闂浜?
絎笁姝ワ紝
XML tutorial:
http://www.w3schools.com/xml/default.asp
SOAP tutorial:
http://www.w3schools.com/soap/default.asp
WSDL tutorial:
http://www.w3schools.com/wsdl/default.asp
WEB Service tutorial:
http://www.w3schools.com/webservices/default.asp
comet鐨勫疄鐜頒粙緇嶏細(xì)榪欓噷
鍏朵腑鐨勫師鐞嗗湪浜庣淮鎶TTP闀胯繛鎺ワ紝榪欓噷鏈変粙緇?/a>
鎽樺綍涓閮ㄥ垎錛岃鏄庡叾鍘熺悊錛?/p>
Pushlet鍩轟簬HTTP嫻侊紝榪欑鎶鏈父甯哥敤鍦ㄥ濯掍綋瑙嗛銆侀氳搴旂敤涓紝姣斿QuickTime銆備笌瑁呰澆HTTP欏甸潰涔嬪悗椹笂鍏抽棴HTTP榪炴帴鐨勫仛娉曠浉鍙嶏紝Pushlet閲囩敤HTTP嫻佹柟寮忓皢鏂版暟鎹簮婧愪笉鏂湴鎺ㄩ佸埌client錛屽啀姝ゆ湡闂碒TTP榪炴帴涓鐩翠繚鎸佹墦寮銆傛湁鍏沖浣曞湪Java涓疄鐜拌繖縐岾eep-alive鐨勯暱榪炴帴璇峰弬鐪婼un鎻愪緵鐨?u>銆奌TTP Persistent Connection銆?/a>鍜?u>W3C鐨勩奌TTP1.1瑙勮寖銆嬨?br>紺轟緥1
鎴戜滑鍒╃敤HTTP嫻佸紑鍙戜竴涓狫SP欏甸潰錛堝洜涓哄畠鏄撲簬閮ㄧ講錛岃屼笖瀹冨湪web server涓篃鏄綔涓簊ervlet瀵瑰緟鐨勶級錛屾欏甸潰鍦ㄤ竴涓畾鏃跺櫒寰幆涓笉鏂湴鍙戦佹柊鐨凥TML鍐呭緇檆lient錛?pre>
<%
int i = 1;
try {
while (true) {
out.print("<h1>"+(i++)+"</h1>");
out.flush();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
out.print("<h1>"+e+"</h1>");
}
}
} catch (Exception e) {
out.print("<h1>"+e+"</h1>");
}
%>
鍦≒ushlet婧愪唬鐮佷腑鎻愪緵浜嗘欏甸潰錛坋xamples/basics/push-html-stream.jsp錛夈備笂闈㈢殑欏甸潰騫朵笉鏄崄鍒嗘湁鐢紝鍥犱負(fù)鍦ㄦ垜浠埛鏂伴〉闈㈡椂錛屾柊鍐呭鏈烘鍦般佹寔緇笉鏂湴琚坊鍔犲埌欏甸潰涓紝鑰屼笉鏄痵erver绔洿鏂扮殑鍐呭銆?br>紺轟緥2
鐜板湪璁╂垜浠鍏ushlet宸ヤ綔鏈虹悊涓竴鎺㈢┒绔熴傞氳繃榪愯Pushlet鐨勭ず渚嬫簮浠g爜錛坋xamples/basics/ push-js-stream.html錛夛紝鎴戜滑浼?xì)鐪嬪埌杩欎釜姣?縐掑埛鏂頒竴嬈$殑欏甸潰銆傞偅涔堝畠鏄浣曞疄鐜扮殑鍛紵
姝ょず渚嬩腑鍖呭惈浜嗕笁涓枃浠訛細(xì)push-js-stream.html銆乸ush-js-stream-pusher.jsp銆乸ush-js-stream-display.html銆?
鍏朵腑push-js-stream.html鏄富妗嗘灦鏂囦歡錛屽畠浠TML Frame鐨勫艦寮忓寘鍚叾瀹冧袱涓〉闈€?br> push-js-stream-pusher.jsp鏄竴涓狫SP錛屽畠鎵ц鍦╯erver绔紝姝ゆ枃浠跺唴瀹瑰涓嬶細(xì)
7: <%
8: /** Start a line of JavaScript with a function call to parent frame. */
9: String jsFunPre = "<script language=JavaScript >parent.push('";
10:
11: /** End the line of JavaScript */
12: String jsFunPost = "')</script> ";
13:
14: int i = 1;
15: try {
16:
17: // Every three seconds a line of JavaScript is pushed to the client
18: while (true) {
19:
20: // Push a line of JavaScript to the client
21: out.print(jsFunPre+"Page "+(i++)+jsFunPost);
22: out.flush();
23:
24: // Sleep three secs
25: try {
26: Thread.sleep(3000);
27: } catch (InterruptedException e) {
28: // Let client display exception
29: out.print(jsFunPre+"InterruptedException: "+e+jsFunPost);
30: }
31: }
32: } catch (Exception e) {
33: // Let client display exception
34: out.print(jsFunPre+"Exception: "+e+jsFunPost);
35: }
36: %>
<script LANGUAGE="JavaScript">
var pageStart="<HTML><HEAD></HEAD><BODY BGCOLOR=blue TEXT=white><H2>Server pushes: <para>";
var pageEnd="</H2></BODY></HTML>";
// Callback function with message from server.
// This function is called from within the hidden JSP pushlet frame
function push(content) {
// Refresh the display frame with the content received
window.frames['displayFrame'].document.writeln(pageStart+content+pageEnd);
window.frames['displayFrame'].document.close();
}
</script>
<!-- frame to display the content pushed by the pushlet -->
<!-- Hidden frame with the pushlet that pushes lines of JavaScript-->
</FRAMESET>
<H1>WAIT...</H1>