News:

Velkommen til FMK Teknik

Main Menu

1.4.0.4 WSDL og Arrays vs. Generic Lists

Started by CSCMathiasen, 2013-11-26 08:58:58

Previous topic - Next topic

CSCMathiasen

Fra VS2010 ved add service reference (vælg collections som generiske lister), og udpege
1.4.0.4 WSDL ser det ud som om der genereres arrays istedet for generiske lister.

http://kjellsj.blogspot.dk/2008/03/wcf-datacontractserializer-schema-rules.html

Kører man svcutil /t:code  D:\test\*.xsd /dconly i en Visual Studio commando prompt meldes der
fejl på typen ActiveSubstanceType
d:\test>svcutil /t:code  D:\test\*.xsd /dconly

Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.17929]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: Type 'ActiveSubstanceType' in namespace 'http://www.dkma.dk/medicinecard/xml.schema/2012/06/01'; cannot be imported. The root particle must be a sequence. Either change the schema so that the types can map to data contract types or use ImportXmlType or use a different serializer.

Kører man d:\test>svcutil /t:code  D:\test\*.xsd /dconly /importXmlTypes

d:\test>svcutil /t:code  D:\test\*.xsd /dconly /importXmlTypes
Microsoft (R) Service Model Metadata Tool
[Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.17929]
Copyright (c) Microsoft Corporation.  All rights reserved.

Error: There was a validation error in the schemas provided for code generation:
    Source:
    Line: 12 Column: 5
   Validation Error: Type 'http://rep.oio.dk/ean/xml/schemas/2005/01/10/:EAN13IdentifierType'; is not declared.