WSDL Error: “Schema item ‘element’ named ‘string’ from namespace ‘http://schemas.microsoft.com/crm/2006/WebServices’. […]”

Hey,

Have you ever encountered the following error?
“Schema item ‘element’ named ‘string’ from namespace ‘http://schemas.microsoft.com/crm/2006/WebServices’. The global element ‘http://schemas.microsoft.com/crm/2006/WebServices:string’ has already been declared.”

That’s what I got when I update my webservice references. Totally nagging and a real pain. That error prevented me from being able to access all the custom fields I created on the CRM entities.
Silly as it might sound, the sole answer to this problem was to take a deep breath (no, no Skype chat), backup the WSDL file and perform some orcish style surgery.

My troubling line was this:
<s:element name=”SecurityPrincipal” nillable=”true” type=”s2:SecurityPrincipal”>
<s:element name=”string” nillable=”true” type=”s:string”>
<s:element name=”TargetFieldType” type=”tns:TargetFieldType”>

Make sure you have a backup to the original WSDL file, then nuke (a.k.a. “remove”) the red-highlighted line and save the changes to the WSDL file (in my case, it was the WSDL file corresponding to the CRM SDK service). Unless there are other errors, you will be able to build your project and your customizations will be available within Visual Studio.

Good luck and happy coding afterwards!
Cheers!

Leave a comment

Your email address will not be published. Required fields are marked *