WSDLException Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}annotation'
I'm getting this WSDLException and have no clue where to start looking. I looked at soapui-errors.log and pasted the stack trace below the WSDLException text.
WSDLException (at /definitions/message[28]/part/annotation): faultCode=INVALID_WSDL: Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}annotation' in the context of a 'javax.wsdl.Part'. Extension elements must be in a namespace other than WSDL's
From soapui-erros.log:
2020-07-16 22:30:42,691 ERROR [errorlog] com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
com.eviware.soapui.impl.support.definition.support.InvalidDefinitionException
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlInterfaceDefinition.load(WsdlInterfaceDefinition.java:52)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:62)
at com.eviware.soapui.impl.wsdl.support.wsdl.WsdlContext.loadDefinition(WsdlContext.java:34)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.cacheDefinition(AbstractDefinitionContext.java:245)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext.access$400(AbstractDefinitionContext.java:47)
at com.eviware.soapui.impl.support.definition.support.AbstractDefinitionContext$Loader.construct(AbstractDefinitionContext.java:218)
at com.eviware.soapui.support.swing.SwingWorkerDelegator.construct(SwingWorkerDelegator.java:46)
at com.eviware.soapui.support.swing.SwingWorker$2.run(SwingWorker.java:131)
at java.lang.Thread.run(Unknown Source)
- Hey BenD,
I understand you're using a tool to dynamically build the .wsdl but that doesnt necessarily mean the .wsdl is built with zero issues.
I've done a bit of googling and there are a number of reasons why this could occur.
There's a possible problem with incorrect capitalisation of element so all words in an node name were lower case rather than lower camel case (e.g.porttype rather than portType, targetnamespace rather than targetNamespace, etc.), inclusion of an erroneous element <document>, someone else reckomed they removed ampersnd characters which they say fixed it (although i dont believe that), ensuring all elements had the appropriate namespace prefix, ensuring all elements included a namespace prefix if >1 xmlns is included and to an xmlns prefix is not required.
If i were you i'd focus on the namespace and make sure the elements are referenced by the correct xmlns as that's whst your error message is saying
Ta
Rich