function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
QuartzQuartz 

WSDL, Axis and case sensitivity

I have been successfully using Axis to generation java source code from the Salesforce WSDL.  Recently Axis code generation started failing with the following error:

 

WSDLException (at /definitions/porttype): faultCode=INVALID_WSDL: Encountered illegal extension element '{http://schemas.xmlsoap.org/wsdl/}porttype' in the context of a 'javax.wsdl.Definition'. Extension elements must be in a namespace other than WSDL's

 

I discovered that the Salesforce WSDL is currently using all lower case for certain elements instead of the previous camel case.  eg: Using <porttype> instead of <portType> and <complextype> instead of <complexType>.  After changing these elements back to camel case Axis was able to generated the code without errors.

 

Is there a better way to address this problem than searching and replacing element names in the WSDL before code generation?

Best Answer chosen by Admin (Salesforce Developers) 
QuartzQuartz

SimonF was correct.  I used chrome to save the wsdl and set the Save as Type to be "All Files" instead of the default "XML Document" (because I wanted to save it as .wsdl).  In doing so I tripped over a chrome bug described here: http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/6193aef2a96bdeb7?tvc=2

 

The resulting file was an xml document changed in subtle ways.  The comments were removed, the order of parameters of elements were rearranged and the camel case of certain elements was changed to lower case - causing the above error.  To avoid the problem I download the wsdl in chrome and set the Save as Type to be the default "XML Document".

All Answers

SuperfellSuperfell

I suspect this is somehow related to how you're dowmloading and saving the wsdl

QuartzQuartz

SimonF was correct.  I used chrome to save the wsdl and set the Save as Type to be "All Files" instead of the default "XML Document" (because I wanted to save it as .wsdl).  In doing so I tripped over a chrome bug described here: http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/6193aef2a96bdeb7?tvc=2

 

The resulting file was an xml document changed in subtle ways.  The comments were removed, the order of parameters of elements were rearranged and the camel case of certain elements was changed to lower case - causing the above error.  To avoid the problem I download the wsdl in chrome and set the Save as Type to be the default "XML Document".

This was selected as the best answer