轴网络服务错误
我编写了一个简单的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅根据错误消息,您的类路径中似乎缺少 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.