在Java 1.5中编译WS客户端-缺少类似WebService的注释 [英] Compile WS client in Java 1.5 - Missing WebService -like annotations

查看:163
本文介绍了在Java 1.5中编译WS客户端-缺少类似WebService的注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发应作为Web服务客户端的应用程序.

I am developing an application which should serve as a client to a Web Service.

我已经使用wsimport实用程序基于WSDL文件生成了源文件.在我的开发机上使用JDK 1.7时,它可以很好地工作(例如,它可以编译并正常运行).

I have generated source files based on the WSDL file using the wsimport utility. It works fine on my development machine with JDK 1.7 (e.g. it compiles and runs fine).

尽管如此,我什至无法在拥有JDK 1.5的测试环境中编译应用程序.我收到一堆如下错误:

I cannot even compile the application in the test environment though, where I have JDK 1.5. I get a bunch of errors like the following:

Cannot find symbol: class WebMethod

怀疑问题出在较小版本的JDK.

Is suspect the problem is with the lesser version of JDK.

我该如何解决此问题,例如更新应用程序以使其与Java 1.5兼容?

What should I do to fix this, e.g. to update the application to become Java 1.5 compatible?

它必须运行独立的控制台应用程序.

It must be run a standalone console application.

推荐答案

您是正确的,它是JDK的功能,JAX-WS(注释)包含在v1.6的J2SE JDK中.在1.5中不存在.它以 Project Metro

You're correct, it is a function of your JDK, JAX-WS(annotations) was included in the J2SE JDK with v1.6. Doesn't exist in 1.5. It lives outside of the JDK as Project Metro, sample code

这篇关于在Java 1.5中编译WS客户端-缺少类似WebService的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆