-1

I exposed a Web service written with Java. My Schema has Complex Types objects.

Everything is fine. When generate Client stubs with WSIMPORT command I noticed

here are static inner classes in the generated client stubs . To avoid

generating inner classes tried with

JAXB, XJC -> create multiple class files

But getting an error A class/interface with the same name

"com.webservices.EducationDetails" is already in use. Use a class customization to resolve this

conflict. But I could not find a way to resolve names in WSIMPORT.

Questions

  1. Generating Static Inner classes in WSIMPORT for ComplexType in XSD is default behavior?

  2. Is there a way to avoid generating static inner classes in Web service Client Stubs

Community
  • 1
  • 1
vin
  • 43
  • 6

2 Answers2

0
  1. Generating Static Inner classes in WSIMPORT for ComplexType in XSD is default behavior ? No. Web service client stub generation happens based on the configuration define in WSDL. (.xsd)

  2. Is there a way to avoid generating static inner classes in Web service Client Stubs

It is hard to say without looking at your WSDL , Schema. I guess you have declared complex type in a way WSIMPORT generates inner classes for you. If you declare complex types as elements it should not generate inner classes.

Example

    <xs:element name="ResponseInformation" type="Response" /> 

<xs:complexType name="Response">
        <xs:sequence>
            <xs:element type="xs:string" name="testField1" />

        </xs:sequence>
    </xs:complexType>

This is What I guess. Try to redefine the complex type. If you post your WSDL I can exactly tell where you are going wrong.

0

I had same issue, Iused the below command which generated me all the request response class properly. It has created inner static classes as well. You have to use -keep option

wsimport -keep C:\D_DRIVE\My_Work\USEI\SOAPService\OI_Manhattan_To_Consignor_EvreuxService_PreProd_Org.wsdl
Abdul
  • 1,130
  • 4
  • 29
  • 65