I have a couple of issues with the correct generation of code from a supplied set of WSDLs and XSDs outside my control. To get the right proxy class that works with a custom FaultException, I have the following svcutil params:
svcutil /t:code /out:InvoiceService_v1.cs /n:*,Test.Invoice_v1 /UseSerializerForFaults *.wsdl *.xsd /config:InvoiceService_v1.config
If I add a Service Reference using Visual Studio then the generated proxy incorrectly interprets the custom Fault definition. The settings I need aren't available inside the Visual Studio custom tool.
However, I can see the Reference.svcmap generated by the Add Service Reference tool. Inside that are a number of client options:
<ClientOptions>
<GenerateAsynchronousMethods>false</GenerateAsynchronousMethods>
<EnableDataBinding>true</EnableDataBinding>
<ExcludedTypes />
<ImportXmlTypes>false</ImportXmlTypes>
<GenerateInternalTypes>false</GenerateInternalTypes>
<GenerateMessageContracts>false</GenerateMessageContracts>
<NamespaceMappings />
<CollectionMappings />
<GenerateSerializableTypes>true</GenerateSerializableTypes>
<Serializer>Auto</Serializer>
<ReferenceAllAssemblies>true</ReferenceAllAssemblies>
<ReferencedAssemblies />
<ReferencedDataContractTypes />
<ServiceContractMappings />
</ClientOptions>
Is it possible to tweak these setting so that I can use the GUI, rather than using svcutil each time?
Svcutil doesn't automatically download and parse remote XSDs, and the third party has also split the WSDL into a separate binding and interface. There is quite a bit of manual work involved to prep each WSDL and XSD before I can even run svcutil.
The GUI makes the process easy, but I can't figure out how to force it to use alternative switches.
I have already tried to add the following ClientOption but it didn't work. No error, but no class generation either:
<UseSerializerForFaults>false</UseSerializerForFaults>
Any ideas welcomed!