当前位置:首页 » 网页前端 » 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"即行。