Forum Discussion

trstuck's avatar
trstuck
New Contributor
13 years ago

Failed to create project - Illegal to define a nested type..

Hi all,

I've been using soapui 3.6 for awhile and recently upgraded to 4.5.1. I'm having trouble creating a project for my web service. It's currently deployed locally and contains a WSDL referencing six (6) different XSDs for 2 different services.
The problem is that when creating the project I get the following error (from the error log):

Fri Mar 08 16:33:29 CST 2013:ERROR:org.apache.xmlbeans.XmlException: error: src-element.3: Illegal to define a nested type when a type attribute is specified.


I cannot see where I am defining type that has a nested type in any of my XSDs. I've tried several schema validators, none of which report any problems. The problem occurs under soapUi 3.6 and 4.5.1. Can anyone help me see why I'm getting this error?

I'll upload the WSDL and XSDs (apparently 5 is the max, so not all there). It appears the error is in XSD3 base on the error message and logs.

Here's the soapUi log:

Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?wsdl]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=3]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=2]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=4]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=5]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=6]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Getting wsdl component from [http://localhost:8080/kwsNew/KatunServicesPort?xsd=1]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Loading Definition...
Fri Mar 08 16:33:29 CST 2013:DEBUG:Loading WSDL: http://localhost:8080/kwsNew/KatunServicesPort?wsdl
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning baseInputSource [http://localhost:8080/kwsNew/KatunServicesPort?wsdl]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=3]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=4]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=2]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=5]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=6]
Fri Mar 08 16:33:29 CST 2013:DEBUG:Returning latest import URI [http://localhost:8080/kwsNew/KatunServicesPort?xsd=1]
Fri Mar 08 16:33:29 CST 2013:INFO:Loading schema types from [http://localhost:8080/kwsNew/KatunServicesPort?wsdl]
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?wsdl
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=1
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=2
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=5
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=6
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=4
Fri Mar 08 16:33:29 CST 2013:INFO:Getting schema http://localhost:8080/kwsNew/KatunServicesPort?xsd=3
Fri Mar 08 16:33:29 CST 2013:ERROR:An error occured [error: src-element.3: Illegal to define a nested type when a type attribute is specified.], see error log for details
Fri Mar 08 16:33:29 CST 2013:WARN:Error: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:WARN:Error: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:WARN:Error: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:WARN:Error: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:WARN:Error: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:ERROR:An error occured [com.eviware.soapui.impl.wsdl.support.xsd.SchemaException], see error log for details
Fri Mar 08 16:33:29 CST 2013:ERROR:An error occured [com.eviware.soapui.impl.wsdl.support.xsd.SchemaException], see error log for details
Fri Mar 08 16:33:29 CST 2013:ERROR:Error loading schema types from http://localhost:8080/kwsNew/KatunServicesPort?wsdl, see log for details
Fri Mar 08 16:33:29 CST 2013:ERROR:error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:ERROR:error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:ERROR:error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:ERROR:error: src-element.3: Illegal to define a nested type when a type attribute is specified.
Fri Mar 08 16:33:29 CST 2013:ERROR:error: src-element.3: Illegal to define a nested type when a type attribute is specified.


...and here's the error log:

Fri Mar 08 16:33:29 CST 2013:ERROR:org.apache.xmlbeans.XmlException: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
org.apache.xmlbeans.XmlException: error: src-element.3: Illegal to define a nested type when a type attribute is specified.
at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.buildSchemaTypes(SchemaUtils.java:287)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:194)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
Fri Mar 08 16:33:29 CST 2013:ERROR:com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.buildSchemaTypes(SchemaUtils.java:297)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:194)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)
Fri Mar 08 16:33:29 CST 2013:ERROR:com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
com.eviware.soapui.impl.wsdl.support.xsd.SchemaException
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.buildSchemaTypes(SchemaUtils.java:297)
at com.eviware.soapui.impl.wsdl.support.xsd.SchemaUtils.loadSchemaTypes(SchemaUtils.java:194)
at com.eviware.soapui.impl.support.definition.support.XmlSchemaBasedInterfaceDefinition.loadSchemaTypes(XmlSchemaBasedInterfaceDefinition.java:79)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:61)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:66)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:30)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:268)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:44)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:235)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:149)
at java.lang.Thread.run(Unknown Source)

1 Reply

  • trstuck's avatar
    trstuck
    New Contributor
    I found the offending schema fragment. Here it is:

    <xsd:element name="OrderType" type="xsd:string">
    <xsd:annotation>
    <xsd:documentation>Order type must be 'SA' or 'DS'</xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
    <xsd:restriction base="xsd:string">
    <xsd:pattern value="[A-Z][A-Z]"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:element>


    Removing the type element in <xsd:element name="OrderType" type="xsd:string"> fixed the problem.