Forum Discussion
I'm not sure if this is relavent in your case, but in a totally different scenario I was getting a strange InvalidDefinitionException. It turns out that the functionality that adds/updates WSDL always assumes a HTTP 200 OK response and that the reply contents is a WSDLdocument, thus if ever some other response is returned e.g. HTTP 401 Unauthorised, the add/update functionality ignores it and tries to process the associated reply contents as WSDL when it is not, hence the unexpected InvalidDefinitionException. This issue was reproduced by SmartBear support and logged as defect number SOAP-5946.
Try looking at the HTTP log to see if it gives you any clues.
It might be worth checking the wsdl file too if you can. I've ran into this if there were syntax errors in the xml of the wsdl file.