Case: I have a set of xsd files that define common types used in WSDL definitions (Header, ApplicationError). Each webservice inports, next to the service specific types, one or more of these shared types.
When generating a proxy for services I keep getting copies of these shared types per service proxy, so I desides to put these in a shares library and use /reference to include these types. I could not get this to work.
First of all, generating a proxy and including all *.xsd workes fine, and contract are generated. Then using the svcutil per xsd, with the /dconly parameter, does not work. Both /XmlSerializer as /DataContractSerializer. Only /importXmlType (or xsd.exe) work.
Then if I put them in a class project, add the generated code, compile and use this on for the /reference parameter, I still get code generated for these types.
Even if I use the classes, generated for the proxy, they are still not recognized by svcutil.
Anyone have experience with this pattern, and perhaps has encounters these same issues?
Error messages for both XmlSerializer as DataContractSerializer svcutil /dconly /ser:XmlSerializer ApplicatieFout-v0200-b03.xsd
Error: Type 'ApplicatieFout' in namespace 'http://schemas.customer.nl/ApplicatieFout-v0200' cannot be imported. Form on element 'FoutCode' must be qualified. E ither change the schema so that the types can map to data contract types or use ImportXmlType or use a different serializer.
If you are using the /dataContractOnly option to import data contract types and are getting this error message, consider using xsd.exe instead. Types generated by xsd.exe may be used in the Windows Communication Foundation after applying the XmlSerializerFormatAttribute attribute on your service contract. Alternatively , consider using the /importXmlTypes option to import these types as XML types to use with DataContractFormatAttribute attribute on your service contract.