??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>
q次Q到是CXF的SERVER和CLIENT都可以正帔R信了。但我不说也知道啦,PERL又出问题?
W三步,
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:
]]>comet的实Cl:q里
其中的原理在于维护HTTP长连接,q里有介l?/a>
摘录一部分Q说明其原理Q?/p>
PushletZHTTP,q种技术常常用在多媒体视频、通讯应用中,比如QuickTime。与装蝲HTTP面之后马上关闭HTTPq接的做法相反,Pushlet采用HTTP方式将新数据源源不断地推送到clientQ再此期间HTTPq接一直保持打开。有兛_何在Java中实现这UKeep-alive的长q接请参看Sun提供?u>《HTTP Persistent Connection?/a>?u>W3C的《HTTP1.1规范》?br>CZ1
我们利用HTTP开发一个JSP面Q因为它易于部vQ而且它在web server中也是作为servlet对待的)Q此面在一个定时器循环中不断地发送新的HTML内容lclientQ?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>");
}
%>
在Pushlet源代码中提供了此面Qexamples/basics/push-html-stream.jspQ。上面的面q不是十分有用,因ؓ在我们刷新页面时Q新内容机械地、持l不断地被添加到面中,而不是server端更新的内容?br>CZ2
现在让我们步入Pushlet工作机理中一探究竟。通过q行Pushlet的示例源代码Qexamples/basics/ push-js-stream.htmlQ,我们会看到这个每3U刷Cơ的面。那么它是如何实现的呢?
此示例中包含了三个文Ӟpush-js-stream.html、push-js-stream-pusher.jsp、push-js-stream-display.html?
其中push-js-stream.html是主框架文gQ它以HTML Frame的Ş式包含其它两个页面?br> push-js-stream-pusher.jsp是一个JSPQ它执行在server端,此文件内容如下:
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>