




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
PAGEPAGE1南昌航空大學實驗報告課程名稱:網絡操作系統準考證號:036811100078姓名:周文飛指導老師:李國忠一、實訓目的1.本次實訓側重于培養學生綜合運用知識的能力。2.利用Apache建立WEB服務,并實現網頁頁面的初始規劃。3.利用MYSQL建立后臺數據庫,實現數據的有效管理。4.利用PHP連接前臺交互窗體和后臺數據庫,實現前、后臺數據鏈接。5.此方案在實際工作中應用廣泛,掌握此方案的架設方法可以直接應用于Linux環境下的WEB服務器管理。。二、實訓準備 安裝有Linux操作系統的計算機,含有Apache、MYSQL、PHP安裝文件包的Linux安裝光盤,安裝有Windows的計算機以便驗證跨系統平臺的運行狀況,存檔磁盤和其他記錄用品。三、操作流程1.創建HelloWorld接口類\o"查看源碼"查看源碼\o"打印"打印\o"?"?1packagecom.googlecode.garbagecan.cxfstudy.helloworld;2importjavax.jws.WebParam;3importjavax.jws.WebResult;4importjavax.jws.WebService;5@WebService6publicinterfaceHelloWorld{7
public@WebResult(name="String")StringsayHi(@WebParam(name="text")Stringtext);8}
2.創建HelloWorld實現類\o"查看源碼"查看源碼\o"打印"打印\o"?"?1packagecom.googlecode.garbagecan.cxfstudy.helloworld;2publicclassHelloWorldImplimplementsHelloWorld{3
publicStringsayHi(Stringname){4
Stringmsg="Hello"+name+"!";5
System.out.println("Server:"+msg);6
returnmsg;7
}8}
3.修改web.xml文件\o"查看源碼"查看源碼\o"打印"打印\o"?"?01<!DOCTYPEweb-appPUBLIC02
"-//SunMicrosystems,Inc.//DTDWebApplication2.3//EN"03
"/dtd/web-app_2_3.dtd">04<web-app>05
<display-name>cxfstudy</display-name>06
<servlet>07
<servlet-name>cxf</servlet-name>08
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>09
<load-on-startup>1</load-on-startup>10
</servlet>11
<servlet-mapping>12
<servlet-name>cxf</servlet-name>13
<url-pattern>/ws/*</url-pattern>14
</servlet-mapping>15
<listener>16
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>17
</listener>18
19
<context-param>20
<param-name>contextConfigLocation</param-name>21
<param-value>classpath*:**/spring.xml</param-value>22
</context-param>23
24</web-app>
4.創建spring配置文件并放在classpath路徑下\o"查看源碼"查看源碼\o"打印"打印\o"?"?01<?xmlversion="1.0"encoding="UTF-8"?>02<beansxmlns="/schema/beans"03
xmlns:xsi="/2001/XMLSchema-instance"xmlns:jaxws="/jaxws"04
xsi:schemaLocation="/schema/beans/schema/beans/spring-beans.xsd
05/jaxws/schemas/jaxws.xsd">06
<importresource="classpath:META-INF/cxf/cxf.xml"/>07
<importresource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>08
<importresource="classpath:META-INF/cxf/cxf-servlet.xml"/>09
<jaxws:endpointid="helloworld"implementor="com.googlecode.garbagecan.cxfstudy.helloworld.HelloWorldImpl"address="/HelloWorld"/>10
11
<!--Forclienttest-->12
<jaxws:clientid="helloworldClient"address="http://localhost:9000/ws/HelloWorld"serviceClass="com.googlecode.garbagecan.cxfstudy.helloworld.HelloWorld"/>
13</beans>
5.創建測試類\o"查看源碼"查看源碼\o"打印"打印\o"?"?01packagecom.googlecode.garbagecan.cxfstudy.helloworld;02importorg.springframework.context.ApplicationContext;03importorg.springframework.context.support.ClassPathXmlApplicationContext;04publicclassSpringClient{05
publicstaticvoidmain(String[]args){06
ApplicationContextcontext=newClassPathXmlApplicationContext("spring.xml");07
HelloWorldhelloworld=(HelloWorld)context.getBean("helloworldClient");08
System.out.println(helloworld.sayHi("kongxx"));09
}10}
6
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中國加納籽提取物項目創業計劃書
- 中國科學與工程計算軟件項目創業計劃書
- 中國骨科植入金屬材料項目創業計劃書
- 中國內蒙古園林綠化項目創業計劃書
- 畢業聯歡會活動策劃書
- 樂理模擬試題及答案
- 商務合作保密協議條款及聲明書
- 數據驅動的機械制造優化策略研究-洞察闡釋
- 2025承諾擔保合同全文
- 小學三年級語文上冊語文教案7篇
- 司法鑒定的奧秘智慧樹知到期末考試答案2024年
- 講述“活著”的中國法制史智慧樹知到期末考試答案2024年
- 廣東開放大學《集裝箱班輪運輸業務與法律》終結性考試復習題庫(附答案)
- 倉儲部作業指導手冊
- 健康生活方式指導員培訓
- 2024屆北京市海淀清華附中物理高二下期末達標檢測模擬試題含解析
- 社會工作學習資料
- 燃氣用不銹鋼集成管道技術規程
- 肝內膽管癌護理查房課件
- 抖音培訓課件
- JGJT350-2015 保溫防火復合板應用技術規程
評論
0/150
提交評論