In one of my projects I am consuming a third party Web Services, written in I don’t know what. I have WCF Service References to them.
They launces new versions of their services quit often, so I was fairly sure something was wrong this time. Updating or even deleting and adding references somehow didn’t work right. I could see the service in the browser, after logging on two times (this is normal). Adding or updating the reference itself also works fine. I’m happy. Started updating all five references, and cleaned up the mess in app.config. Done this many times before. Building.
Error 4 Custom tool error: Failed to generate code for the service reference 'TheService'. Please check other error and warning messages for details. D:\temp\ConsoleApplication2\ConsoleApplication2\Service References\TheService\Reference.svcmap 1 1 ConsoleApplication2
What? Expanding all solution files, to investigate the code behind Service Reference/TheService/Reference.svcmap/Reference.cs. Empty!
Running wsdl.exe and svcutil.exe on the downloaded wsdl to investigate more. Finally something to understand: The complexType SomeClass has a property with a blank space in the name attribute. Not allowed. It looked something like this:
<xs:element name="statusCode " type="foons:StatusCode "/>
Luckily the vendor was quick to fix this when told. But I really would like Visual Studio to be more robust, either telling me what the problem is when adding a reference to a none valid WSDL or even maybe just remove the whitespace. Like IE does when watching the WSDL file….
