Forum Discussion

BenD's avatar
BenD
Occasional Contributor
5 years ago

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
  • BenD :

     

    As it is stating in the error message, it seems error is with the WSDL file, i would suggest that you should get in touch with developer or WSDL provider.

    • BenD's avatar
      BenD
      Occasional Contributor

      HimanshuTayal: Thank you for your reply. I forgot to mention that I created the .h files that were input into soapcpp2 tool which produced the WSDL file. soapcpp2 appears to be a gsoap product from Genivia. It’s supposed to generate compliant wsdl. Wondering why SoapUI is complaining about the wsdl. The errors SoapUI gives are not very good. No idea why it’s complaining.

      • richie's avatar
        richie
        Community Hero
        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