forcedotcom/wsc — pull request #11 by lmcalpin (2013-05-03 20:11:35+00:00)
Title: WSDL Parser improvements

I made a few improvements to the WSDL parser to support future WSDL2Apex code generation work I will be doing. Let me know if you have any questions/issues. All existing tests work, and I added a few new ones.

- Attributes were not supported on Schema elements.
- "fixed" and "ref" attributes on attribute elements were not handled correctly; a second pass parser processing phase was added to the WsdlParser.
- "ref" attribute handling for "element" elements has been altered to conform to the new second pass parser processing introduced in these changes.
- AttributeGroups were not supported.
- As AttributeGroups were not supported, neither were references to them.
- com.sforce.ws.util.Collection would throw an exception when encountering annotation elements. Annotation elements should be allowable anywhere.
- Anonymous type declarations under elements with the same name would overwrite one another.
- Removed a few unit tests in com.sforce.ws.wsdl that did not actually assert anything. The only utility that these tests had was that they would fail if we could not successfully parse a few test WSDLs. I introduced new tests that actually do make assertions, and since these load the same WSDLs (as well as a few new ones), the old "tests" were redundant.
- The WSDL that we used for testing did not validate. While it is unlikely that all of our customers have 100% conformant WSDL, and it is a good thing that we are lax enough in our interpretation of the WSDL to handle invalid schema, it would be preferable that the WSDL we publish actually be WS-I conformant. [AttributeUnitTest.wsdl and WsdlRefUnitTest.wsdl were the files I changed.]