You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by paul nibin <ni...@gmail.com> on 2010/11/26 06:47:18 UTC

Generated code could not be compiled for Microsoft Exchange Server Services.wsdl

Hi All,

I tried to generate the stubs for wsdl file of Microsoft Exchange server.

First I tried to generate the stubs in unwrapped format using the "-uw" flag
specified for WSDL2Java.

WSDL2Java.main( new String []
        { "-o", ".", "-uri", "C:\\WSDLTest\\services.wsdl", "-uw" } );

And I got the following error.

log4j:WARN No appenders could be found for logger
(org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException:
org.apache.axis2.wsdl.codegen.CodeGenerationException: Unsupported Schema
format for unwrapping! found unknown type but expected Element
    at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
    at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
    at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
    at test.ClientGenerator.main(ClientGenerator.java:9)
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
Unsupported Schema format for unwrapping! found unknown type but expected
Element
    at
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.processXMLSchemaSequence(SchemaUnwrapperExtension.java:389)
    at
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.processComplexContentModel(SchemaUnwrapperExtension.java:265)
    at
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.handleAllCasesOfComplexTypes(SchemaUnwrapperExtension.java:222)
    at
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.walkSchema(SchemaUnwrapperExtension.java:162)
    at
org.apache.axis2.wsdl.codegen.extension.SchemaUnwrapperExtension.engage(SchemaUnwrapperExtension.java:106)
    at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
    ... 3 more

The code generator is not able to generate the stub in unwrapped format.

So removed the "-uw" flag and generated the code.

It generated the stub. And one java file
(com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub)
is so big(The size of the file is around 14 MB and has 295727 lines) that it
is not even able compile it in the eclipse and it throws java heap space
error for compilation. How ever I compiled the client using build.xml
generated. But it also could not compile because of compilation errors in
the code.

compile.src:
    [javac] Compiling 4 source files to
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\build\classes
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:90187:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetItemFieldType
    [javac]                    localPathTracker = false;
    [javac]                    ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:90764:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetItemFieldType
    [javac]                 if (localPathTracker){
    [javac]                     ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:90995:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetItemFieldType
    [javac]                  if (localPathTracker){
    [javac]                      ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:142351:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetFolderFieldType
    [javac]                    localPathTracker = false;
    [javac]                    ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:142688:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetFolderFieldType
    [javac]                 if (localPathTracker){
    [javac]                     ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:142889:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.SetFolderFieldType
    [javac]                  if (localPathTracker){
    [javac]                      ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:189225:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.AppendToItemFieldType
    [javac]                    localPathTracker = false;
    [javac]                    ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:189802:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.AppendToItemFieldType
    [javac]                 if (localPathTracker){
    [javac]                     ^
    [javac]
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java:190033:
cannot find symbol
    [javac] symbol  : variable localPathTracker
    [javac] location: class
com.microsoft.schemas.exchange.services._2006.messages.ExchangeWebServiceStub.AppendToItemFieldType
    [javac]                  if (localPathTracker){
    [javac]                      ^
    [javac] Note:
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java
uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note:
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\src\com\microsoft\schemas\exchange\services\_2006\messages\ExchangeWebServiceStub.java
uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 9 errors

BUILD FAILED
C:\MySpace\ToolsAndUtilities\eclipse\workspace\EWSClient\build.xml:43:
Compile failed; see the compiler error output for details.

Instead of getting 1 big stub file with many inner classes for types, is it
possible to generate the stub with separate java files for the types?

I could generate the stubs using xmlbeans data binding(I feel it is a little
more complex to use xmlbeans binding in the client side). So I would like to
stick with ADB itself. So, is there anyway to generate the stubs using ADB
binding itself with unwrapped flag for the attached WSDL?

Thanks,
Paul