简体   繁体   中英

Java Classes from WSDL and Eclipse

I am trying to create and use a set of Java classes from WSDL using Apache Axis 2. I've successfully generated the class files using the approach described here:

http://www.gerd-riesselmann.net/scala/creating-java-classes-wsdl-file-using-apache-axis-2

I have copied the generated class files into my eclipse development environment. I have obtained all the necessary jar files and I have added them to my environment.

A single (source) problem remains that I don't understand. The code section looks like this:

...
public org.tempuri.PreprocessingIncidentImportServiceStub.ImportResponse 
import (org.tempuri.PreprocessingIncidentImportServiceStub.Import import0)
throws java.rmi.RemoteException
{
org.apache.axis2.context.MessageContext _messageContext = null;
...

Eclipse is reporting: Syntax error on token "import", expected identifier.

I don't understand the function definition that includes the "import" statement, and I am wondering if there's some eclipse setting that I must use to resolve this problem.

Thanks in advance for any help.

It seems that the method is named import. Import is a reserved word in Java so you can't name a method with it.

Assume that you have imported the classes and doesn't need to use the full qualified name of them. This is what you have:

public ImportResponse import (Import import0) throws RemoteException{
//...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM