當前位置:首頁 » 網頁前端 » eclipsewebserver
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

eclipsewebserver

發布時間: 2022-09-04 14:09:01

Ⅰ java eclipse 發布web service出錯

查一下你啟動 webserver JVM 的命令行,看看是不是包含了 「 c 」 這樣的字樣。看這意思像是找不到這個叫「c」的操作。

Ⅱ eclipse 怎樣配置java webservice

用eclipse創建一個WebService應用非常方便,步驟如下:
1.安裝WebService插件。
2.安裝一個web伺服器。我這里用的是Tomcat。
3.創建一個Webservice服務。在eclipse中創建一個動態的web工程。New->Project->Dynamic Web Project。創建完成後,寫一個service類,比如:
public class LogonService {
public int checkUserRight(String userId, String password) {
//假設進行資料庫操作
if (password != null && "fred".equals(userId)) {
return 1;
}
return 0;
}
}
public int checkUserRight(String userId, String password)就是我們要調用的遠程方法。
4.在這個類的文件名上點擊右鍵,選擇」Web Services"->「Create Web Service」,就會出現下面的界面:

要選上TestClient(下面的那個圖片上),這樣創建Service的同時,會創建一個Service的test工程。
5.點擊next,

選擇方法名稱,
6.點擊"next",點擊「Start Server」,就會啟動Tomcat,並將工程部署上去。

7.如果點擊「Launch」會打開剛才創建的WebService的測試界面,可以進行測試。

8.這時候,會出現測試創建代理類的界面,代理類會創建在自動生成的測試工程中,也就是LogonWebServiceTest工程中。

9.點擊「next」,會自動生成代理類,並出現選擇測試方法的界面。你可以選擇相應的方法,這樣eclipse會生成相應的頁面。

10.點擊"Finish"就可以了,這時,會自動啟動一個頁面

點擊左邊相應的方法,就可以進行測試了。

註:遇到的問題
執行時報錯:D:\MyDrivers\software\apache-tomcat-7.0.50\bin\tcnative-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
解決方法:把tomcat\bin 目錄下的tcnative-1.dll復制到jdk\bin目錄下
查看Tomcat是多少位:cmd—>cd 目錄下—>catalina version 就可以查看到
查看JDK是多少位:cmd—>java version 下面有顯示就是64位,沒有就是32位的

Ⅲ 在eclipse中web service中 出現這種情況,怎麼解決

用eclipe自帶的webservice,要在web service工程下,你應該先建一個web Service的工程,如果新建 工程 選項卡中沒有,那麼推薦你使用eclipse ee或者MyEclipse。
或者你不用eclipse的web service自動生成,自己寫相應的服務和客服端也可以

Ⅳ eclipse怎麼生成webservice客戶端

在eclipse創建webservice的方法:1、在Eclipse的菜單欄中,Window --> Preferences --> Web Service --> Axis2 Perferences,在Axis2 runtime location中選擇Axis2解壓縮包的位置,設置好後,點"OK"即行。

2、新建一個webservice:
(1)新建一個Java Project,命名為"WebServiceTest1"
(2)新建一個class,命名為"CalculateService",完整代碼如下:
package e.sjtu.webservice;
/**
* 計算器運算
* @author rongxinhua
*/
public class CalculateService {
//加法
public float plus(float x, float y) {
return x + y;
}
//減法
public float minus(float x, float y) {
return x - y;
}
//乘法
public float multiply(float x, float y) {
return x * y;
}
//除法
public float divide(float x, float y) {
if(y!=0)
{
return x / y;
}
else
return -1;
}
}
(3)在"WebServiceTest1"項目上new --> other,找到"Web Services"下面的"Web Service";

(4)下一步(next),在出現的Web Services對象框,在Service implementation中點擊"Browse",進入Browse Classes對象框,查找到我們剛才寫的寫的CalculateService類。(如下圖)。點擊"ok",則回到Web Service話框。

(5)在Web Service對話框中,將Web Service type中的滑塊,調到"start service「的位置,將Client type中的滑塊調到"Test client"的位置。

(6)在Web Service type滑塊圖的右邊有個"Configuration",點擊它下面的選項,進入ServiceDeployment Configuration對象框,在這里選擇相應的Server(我這里用Tomcat6.0)和Web Serviceruntime(選擇Apache Axis2),如下圖:

(7)點OK後,則返回到Web Service對話框,同理,Client type中的滑塊右邊也有"Configuration",也要進行相應的置,步驟同上。完成後,Next --> next即行。進入到Axis2 Web Service Java Bean Configuration,我們選擇Generate a default services.xml,如下圖所示:

(8)到了Server startup對話框,有個按鍵"start server"(如下圖),點擊它,則可啟動Tomcat伺服器了。

(9)等啟完後,點擊"next -- > next",一切默認即行,最後,點擊完成。最後,出現如下界面:(Web Service Explorer),我們在這里便可測試我們的Web服務。(使用瀏覽器打開的話使用如下地址:127.0.0.1:19189/wse/wsexplorer/wsexplorer.jsp?org.eclipse.wst.ws.explorer=3)。如下圖所示:

Ⅳ eclipse 怎麼打開webservice exp

開發前配置:在Eclipse的菜單欄中,Window --> Preferences --> Web Service --> Axis2 Perferences,在Axis2 runtime location中選擇Axis2解壓縮包的位置,設置好後,點"OK"即行。

新建一個Java Project,命名為"WS_01",在"WS_01"項目上new --> other,找到"Web Services"下面的"Web Service";

在出現的Web Services對象框,在Service implementation中點擊"Browse",進入Browse Classes對象框,查找到我們剛才寫的寫的CalculateService類。(如下圖)。點擊"ok",則回到
Web Service話框。

在Web Service對話框中,將Web Service type中的滑塊,調到"start service「的位置,將Client type中的滑塊調到"Test client"的位置。

在Web Service type滑塊圖的右邊有個"Configuration",點擊它下面的選項,進入Service Deployment Configuration對象框,在這里選擇相應的Server(我這里用Tomcat6.0)和Web Service runtime(選擇Apache Axis2)

點OK後,則返回到Web Service對話框,同理,Client type中的滑塊右邊也有"Configuration",也要進行相應的置,步驟同上。完成後,Next --> next即行。到了Server startup對話框,有個按鍵"start server",點擊它,則可啟動Tomcat伺服器了。

等啟完後,點擊"next -- > next",一切默認即行,最後,點擊完成。最後,出現如下界面:(Web Service Explorer),我們在這里便可測試我們的Web服務

Ⅵ eclipse 創建webservice項目失敗如圖

在eclipse創建webservice的方法:1、在Eclipse的菜單欄中,Window-->Preferences-->WebService-->Axis2Perferences,在Axis2runtimelocation中選擇Axis2解壓縮包的位置,設置好後,點"OK"即行。2、新建一個webservice:(1)新建一

Ⅶ 怎麼在eclipse中訪問webservice

在eclipse創建webservice的方法:

1、在Eclipse的菜單欄中,Window --> Preferences --> Web Service -->Axis2Perferences,在Axis2runtime location中選擇Axis2解壓縮包的位置,設置好後,點"OK"即行。

Ⅷ java如何通過eclipse安裝axis2來調用webservice

通過eclipse安裝axis2來調用webservice的方法:

1、在eclipse的菜單欄中選擇 window-->preferences-->web service -->axis2 preferences 在axis2 runtime 下的 axis2 runtime location中指定解壓目錄

點擊 start server 啟動剛剛部署的web項目 --->next 直到 finish 此時部署就已經完成了。

4、在axis-test中編寫客戶端代碼並調用伺服器程序

package com.hualom.axis.client;


import javax.xml.namespace.QName;


import org.apache.axis2.AxisFault;

import org.apache.axis2.addressing.EndpointReference;

import org.apache.axis2.client.Options;

import org.apache.axis2.rpc.client.RPCServiceClient;


public class OprationClient {

/**

* @param args

* @throws AxisFault

*/

public static void main(String[] args) throws AxisFault {

// 使用RPC方式調用WebService

RPCServiceClient serviceClient = new RPCServiceClient();

Options options = serviceClient.getOptions();

// 指定調用WebService的URL

EndpointReference targetEPR = new EndpointReference("http://localhost:8080/axis2-testServer/services/OprationServiceImpl");

options.setTo(targetEPR);

// 指定要調用的計算機器中的方法及WSDL文件的命名空間:impl.service.axis.hualom.com 服務類的包名稱。

QName searchResult = new QName("http://impl.service.axis.hualom.com","search");

QName noSearchResult = new QName("http://impl.service.axis.hualom.com","noSearch");

// 設置發送到伺服器的內容

Object[] opAddEntryArgs = new Object[] { "你好 server"};

// 指定返回值的類型

Class[] classes = new Class[] { String.class };

// 調用伺服器開放的介面並且返回結果 如果沒有返回值可以直接調用 serviceClient.invokeRobust(opName, opAddEntryArgs)

System.out.println(serviceClient.invokeBlocking(searchResult,opAddEntryArgs, classes)[0]);

}

}

Ⅸ 如何在Eclipse中自動生成WebService代理類

1.工具:eclipse3.3或者是帶有webservice插件的eclipse
2. 首先用瀏覽器訪問webservice的站點,接著保存打開的頁面,後綴為.wsdl。
3.把保存好的文件拷入eclipse的工程中。
4.eclipse:file----new---other----webservice----web service client,選擇之前拷貝到eclipse中的.wsdl文件,點擊finish.
這樣eclipse就幫我們自動生成了web service的客戶端,接下來只需在程序中調用即可。
在程序中調用eclipse自動生成的web service客戶端:
String endpoint = "伺服器的webservice地址";
YourWebServiceNameProxy ywsnp = new YourWebServiceNameProxy ();
ywsnp.xxx方法(入參);

如:
String enpoint = "ipTranslatorWebService.asmx?wsdl";
TranslatorWebServiceSoapProxy translatorWebServiceSoapProxy = new TranslatorWebServiceSoapProxy();
String[] result =translatorWebServiceSoapProxy.getEnCnTwoWayTranslator("貓");

Ⅹ 如何在eclipse創建webservice

在eclipse創建webservice的方法:

1、在Eclipse的菜單欄中,Window --> Preferences --> Web Service --> Axis2Perferences,在Axis2 runtime location中選擇Axis2解壓縮包的位置,設置好後,點"OK"即行。