轴网络服务错误

发布于 2024-09-10 21:29:24 字数 1252 浏览 3 评论 0原文

我编写了一个简单的java文件Calculator.java,如下所示

public class Calculator {
    public int add(int a, int b) {
        return a+b;
    }
    public int subtract(int a, int b) {
        return a-b;
    }
}

现在,我将其重命名为Calculator.jws并将其放在我的Web应用程序的根目录中。 (与 WEB-INF 目录位于同一目录中)。当我尝试使用 http://localhost:8680/webappcontextroot/Calculator.jws 我收到一条消息,显示

“此处有一个 Web 服务。单击查看 WSDL”

当我单击链接查看 WSDL 文件时,出现错误,

AXIS 错误

无法生成 WSDL!

此位置没有 SOAP 服务

当我编写客户端来调用 Web 服务时,出现 Axis 错误

- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
Exception in thread "main" AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.NoService
 faultSubcode: 
 faultString: The AXIS engine could not find a target service to invoke!  targetService is null
 faultActor: 
 faultNode: 
 faultDetail: 
    {http://xml.apache.org/axis/}hostname:D78D46BS

AXIS 引擎找不到要调用的目标服务! targetService is null

WSDL 文件似乎丢失;但 oreilly 教程告诉您只需将 java 文件复制到 .jws 文件并将其放入您的 Web 应用程序中,Web 服务就可以使用了。

有人可以帮我解决这个问题吗?

I have written a simple java file Calculator.java as below

public class Calculator {
    public int add(int a, int b) {
        return a+b;
    }
    public int subtract(int a, int b) {
        return a-b;
    }
}

Now, i renamed it to Calculator.jws and put it in my web application's root directory. (in the same directory as the WEB-INF directory). When i try to access this webservice using http://localhost:8680/webappcontextroot/Calculator.jws i get a message saying

"There is a Web Service here. Click to see the WSDL"

When i click on the link to see the WSDL file i get an error,

AXIS error

Could not generate WSDL!

There is no SOAP service at this location

When i wrote a client to invoke the web service, i get an Axis fault

- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
Exception in thread "main" AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.NoService
 faultSubcode: 
 faultString: The AXIS engine could not find a target service to invoke!  targetService is null
 faultActor: 
 faultNode: 
 faultDetail: 
    {http://xml.apache.org/axis/}hostname:D78D46BS

The AXIS engine could not find a target service to invoke! targetService is null

The WSDL file seems to be missing; but the oreilly tutorial tells all you have to do is just copy your java file to a .jws file and put it in your webapp and the webservice is ready to use.

Can someone help me with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情何以堪。 2024-09-17 21:29:25

仅根据错误消息,您的类路径中似乎缺少 mailapi.jar 和activation.jar 库。将它们放在 axis.jar 所在的同一文件夹中,然后重新启动 Web 服务器。

solely on the error message, it seems that your are missing mailapi.jar and activation.jar libraries in your classpath. Put those in the same folder where your axis.jar is and restart the web server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文