Pergunta

I've generated java-class file with wsdl2java and used xmlbeans databinding. Can't compile resulting file because of numerous errors like:

error: cannot find symbol [javac] return wrappedType.get().xgetPolicyGroup();

error: cannot find symbol [javac] return wrappedType.get().xgetPolicyPresharedKey();

Here's an example of generated code that matches first error:

private com.sample.webservice.PolicyGroupType getPolicyGroup(com.sample.webservice.PolicyGroupDTODocument wrappedType)
{
    return wrappedType.get().xgetPolicyGroup();
}

PolicyGroupDTODocument is defined as follow:

public interface PolicyGroupDTODocument extends org.apache.xmlbeans.XmlObject

and implementation as

public class PolicyGroupDTODocumentImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.sample.webservice.PolicyGroupDTODocument

I presume, that get and xget methods are somewhat inherited from XmlObject. What's wrong with generated code or maybe with generation process?

Foi útil?

Solução

it is strange...to answer your issue, please provide following detail:

  1. what command options you gave when you ran wsdl2java. You can find all options in this link.

  2. When you ran Wsdl2Java, it prints messages like : Using Axis2_home:..... and using Java_HOME.....Can you provide those values.

  3. i assume you got all source code files in one directory. Then when are you getting compilation issue. Are you trying to use javac on command line or using eclipse like IDE to import all files and compile it or are you trying to create a jar out of it?

    Make sure you are using same JDK as used in step 2 above and using same axis jar as in step2. Make sure the classpath you set is OK. Can you provide what is value of classpath you are setting. Most likely it is related to classpath issue.

update#1 try these steps: 1. Try running wsdl2java without -b option and see if error goes. 2. Since your java package is com.sample.webservice so, you must be compiling from parent directory of com folder using command: javac -d . -g com/sample/webservice/*.java
Please note -d option is passed so that javac compiler is forced to build package structure. and -g option will give you verbose debug output.

Outras dicas

Try using a different version of Axis2. Ironically, I have found that sometimes the code can be compiled once it is generated with a different version. Once run and compiled, make sure you're using the same version of Axis to execute the code, otherwise you'll get a myriad of other errors.

I've got different results, switching between 1.4, 1.5.6 and 1.6.0.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top