Posting this one mostly as a reminder for myself:
I was working on extending some existing WCF service in development, while an older version already deployed to production. Let's say our production site is
and my local machine name is borism
When I tried to create a local proxy of the web service I got the following error:
(all the ULRs and namespaces are fictive)
Attempting to download metadata from 'http://www.borismod.com/RealGeekyURL/mex' using WS-Metadata Exchange or DISCO.
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'DoSomeCrazyGeekyStuff' and namespace 'http://borismod.blogspot.com/' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://www.borismod.com/'. Please check the XSD docu
ments provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.borismod.com/']/wsdl:portType[@name='ISomeRealGeekService']
The actual problem is that there are references from the WSDL to some internal classes. The references point to the production site. The new added classes were missing in production.
Point in host file to the local machine, actually adding the following line in hosts file: