users@jax-rpc.java.net

Re: wscompile -import does not generate custom classes

From: Vishal Goenka <vgoenka_at_CAMPUSPIPELINE.COM>
Date: Sat, 02 Nov 2002 00:29:29 -0700

Doug,

Looking at the source code from the community source version 1.0, it seems
that this indeed is the case.

I have tried various WSDL files, including some publicly available ones
from xmethods.com, and have obtained the same results.

Here's the fragment of the code that indicates that the import only
generates interface and interface template, not custom classes.

From: com/sun/xml/rpc/tools/wscompile/CompileTool.java
        if (mode == MODE_GEN_CLIENT || mode == MODE_GEN_BOTH) {
            genStub = true;
            genService = true;
            genServiceInterface = true;
            genInterface = true;
            getCustomClasses = true;
            genSerializer = true;
        }

        if (mode == MODE_GEN_SERVER || mode == MODE_GEN_BOTH) {
            genTie = true;
            genInterface = true;
            getCustomClasses = true;
            genSerializer = true;
            genWsdl = true;
        }

        if (mode == MODE_IMPORT) {
            if (!(configuration.getModelInfo() instanceof WSDLModelInfo)) {
                environment.error(getMessage("wscompile.importRequiresWsdlConfig"));
            }
            genInterface = true;
            genInterfaceTemplate = true;
        }

To be sure, I re-compiled by adding:
            getCustomClasses = true;
in the MODE_IMPORT block, and that does the trick!

--Vishal


>Vishal, can you attach the WSDL file you are using. This should work.
>
>Thanks
>
>Vishal Goenka wrote:
>> I'm unclear on the intent of the -import option in wscompile. It suggests
>> that the service interface as well as value types should be generated.
>> However, it does not generate Java classes corresponding to the XSD types
>> defined in the schema that might be used as arguments to the service
>> interface. This essentially makes the generated service interface non-
>> compilable.
>>
>> Am I missing something or is this a "bug"?
>>
>> Thanks for any help.
>>
>> -Vishal
>
>
>--
>Doug Kohlert
>Java Software Division
>Sun Microsystems, Inc.
>phone: 503 345-9806