gpt4 book ai didi

java - WebSphere 8.0 的 Eclipse Web 服务

转载 作者:行者123 更新时间:2023-11-29 08:47:53 24 4
gpt4 key购买 nike

我正在尝试使用 Eclipse 创建 Web 服务以托管在 WebSphere 8.0 上。

package peter.td.com;

import javax.jws.*;

@WebService
public class First01 {
@WebMethod
public int Addition(int a, int b, int c)
{
return a+b+c;
}
}

我做了 export(.ear) 并获取了 EAR 文件并将其部署在 WAS 8.0。
当我执行 http://localhost:9080/WebService01 时:它给我一个找不到页面的错误。

我环顾四周,找不到任何好的示例来创建 Web 服务以托管在 WebSphere 上。我正在使用 Eclipse IDE。

请分享或显示我可以使用 Eclipse IDE 为 WAS 8.0 创建 WebService 的任何教程链接。

最佳答案

您的网址不正确。它应该是 http://localhost:9080/context-root/First01Service默认情况下,context-root 是您的 Web 项目名称。在 Eclipse 中获得正确的 url 和测试服务的最简单方法是将项目添加到服务器,然后展开项目中的“服务”文件夹,右键单击您的 Web 服务并选择使用 Web 服务资源管理器进行测试。

关于java - WebSphere 8.0 的 Eclipse Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24213029/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com