tomcat 中使用 axis 的 Java webservice

发布于 2024-09-01 18:18:50 字数 596 浏览 6 评论 0原文

我想问几个问题以确保我理解事情。

使用 tomcat 和 axis 创建 Web 服务时,我创建一个定义要公开的方法的接口。到目前为止,一切都很好。我还有几节课。我编译我的类(.class 文件,没有 jars)并将它们存储在 WEB-INF\classes 中..对吗?我对deploy.wsdd 文件进行硬编码,并通过使用Admin 或AdminClient(轴帮助器类)将deploy.wsdd 集成到server-config.wsdd 文件中。

一切正常。

问题:

  1. WEB-INF\classes 目录中可以有类(.class 文件)吗?我应该创建一个 jar 或 war 文件并将其存储在某个地方吗???

  2. 我尝试使用java2wsdl(将interface.class作为输入)生成一个wsdl文件,然后生成wsdl2java。我这样做是为了生成deploy.wsdd 文件,然后将其集成到server-config.wsdd 文件中。生成的deploy.wsdd文件不正确,我的服务无法正常工作。我在这里缺少什么?有没有不同的方法来生成deploy.wsdd文件

帮助???

提前致谢。 西奥

I would like to ask a few questions to make sure that I understand things.

When creating a web service using tomcat and axis, I create an interface defining the methods that I am going to expose. so far so good. I have a couple more classes as well. I compile my classes (.class files no jars) an store them in WEB-INF\classes ..right?? I hardcode my deploy.wsdd file and by using Admin or AdminClient (axis helper classes) I integrate the deploy.wsdd to the server-config.wsdd file.

everything is working fine.

Questions:

  1. Is it ok to have classes (.class files) in WEB-INF\classes directory?? should i create a jar or war file and store it somewhere???

  2. I have tried using java2wsdl (giving it the interface.class as input) to produce a wsdl file and then wsdl2java. I did that in order to generate deploy.wsdd file and then integrate it in server-config.wsdd file. The deploy.wsdd file generated is not correct and my service is not working properly. What am i missing here?? is there a different way to generate the deploy.wsdd file?????

Help???

Thanx in advance.
Theo

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

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

发布评论

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

评论(1

山人契 2024-09-08 18:18:50
  1. 只要 .class 文件位于包中,就可以将 .class 文件放在 WEB-INF/classes 中。 Tomcat 不喜欢使用默认包。
  2. 我不确定,因为我不是轴心粉丝。使用 Spring“契约优先”Web 服务,这一切变得更加容易。如果您使用 Axis,则不会与它绑定(但与 Spring 绑定)。
  1. It's perfectly okay to have .class files in WEB-INF/classes, as long as they're in packages. Tomcat doesn't like using the default package.
  2. I'm not sure, because I'm not an Axis fan. This is all a lot easier with Spring "contract first" web services. You aren't tied to Axis if you use it (but you are tied to Spring).
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文