Reputation: 23607
I run the following command
wsimport -s ..\Code\app\src\main\java http://localhost:9080/shortbus/ShortbusService/ShortbusService.wsdl
This runs and generates code, however, when I try to compile given the new code I get...
...\ShortbusService_Service.java:[43,8] cannot find symbol
symbol : constructor Service(java.net.URL,javax.xml.namespace.QName,javax.xml.w
s.WebServiceFeature[])
location: class javax.xml.ws.Service
I tried explicitly adding the jaxws-api.jar and rt.jar but neither seemed to work. can someone help with what I am missing?
Update
If I manually edit to (notice the comments)...
public ShortbusService_Service(WebServiceFeature... features) {
//super(__getWsdlLocation(), SHORTBUSSERVICE_QNAME, features);
super(__getWsdlLocation(), SHORTBUSSERVICE_QNAME);
}
public ShortbusService_Service(URL wsdlLocation) {
super(wsdlLocation, SHORTBUSSERVICE_QNAME);
}
public ShortbusService_Service(URL wsdlLocation, WebServiceFeature... features) {
//super(wsdlLocation, SHORTBUSSERVICE_QNAME, features);
super(wsdlLocation, SHORTBUSSERVICE_QNAME);
}
public ShortbusService_Service(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public ShortbusService_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
//super(wsdlLocation, serviceName, features);
super(wsdlLocation, serviceName);
}
It compiles but I would rather not do this.
Upvotes: 0
Views: 829
Reputation: 16736
The code that's being generated by WAS 8.5's wsimport
will generate code that is compatible with JAX-WS 2.2, because WAS 8.5 supports JAX-WS 2.2.
It seems that you are trying to compile your code against JAR files that represent an earlier version of JAX-WS, such as 2.0 or 2.1 (the Service
constructor receiving "features
" was added in JAX-WS 2.2).
So, you have two options:
Change your IDE settings (if you're using RAD, you'll probably have to migrate to a later RAD version) so your project compiles against the WAS 8.5 runtime; or
Use the -target
switch for wsimport
, providing the value 2.1
or 2.0
. That will generate code that can be compiled against older versions of JAX-WS.
Upvotes: 1