The error was coming from the Svsutil.exe and looked like this...
Error
Custom tool error: Failed to generate code for the service reference 'xxxx'. Please check other error and warning messages for details.
Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Object reference not set to an instance of an object.
Path to Error Source: //wsdl:definitions[@targetNamespace='urn:xxxx']/wsdl:portType[@name='xxxx']
The key message there was "Error: Object reference not set to an instance of an object.". Most other reported cases of Svcutil.exe failing to import a WSDL were for other reasons and didn't help me, but I did stumble upon this archived post which discussed a missing "elementFormDefault" element in the XML Schema definition. That gave me an idea.
There were actually a few more errors, but they all seemed to be due to earlier errors and warnings.
When looking through the WSDL of the service I wanted to import, I didn't see anything complicated and it seemed to only use custom XML types from a "common" schema used by many other web services. That schema was actually being generated from POJOs so there was no source XSD to work with. Further, this schema being common was meant to be included into other schemas and didn't have its own namespace, so I didn't want to use a qualified element form for it (as suggested in the link I found).
My solution was to create a package-info.java file within the package that had my POJOs and simply set elementFormDefault to UNQUALIFIED, its content was something like this...
Java
@javax.xml.bind.annotation.XmlSchema(namespace = "", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED)
package xxxx;
After recompiling the service and deploying it again, Svcutil.exe reported no errors and was able to generate the web service proxy! It looked like whatever default value that JAX-WS was using was incompatible with the .Net side of things and an explicit qualified/unqualified form had to be specified.
In my case the JAXWS service was made via the JWS file method, not from a WSDL. For more information see: Programming the JWS File.
-i