svcutil.exe

Is svcutil.exe a replacement for xsd.exe?

社会主义新天地 提交于 2020-01-11 15:46:58
问题 I am using xsd.exe to generate some c# classes from a .xsd file. I ran into the same issue that is covered here and on other sites where xsd.exe generates Type[] arrays instead of generic List collections for types in the .xsd file. Some people have suggested that svcutil.exe can be used as a replacement for xsd.exe if you pass the /dataContractOnly parameter to svcutil.exe. However, it seems like those people are mistaken because svcutil.exe actually generates System.Xml.XmlNode[] array

Why are attributes not supported with the DataContractSerializer?

爷,独闯天下 提交于 2020-01-03 21:09:10
问题 I create xsd's based upon client's documentation and all of the xsd's have attributes. I have been using xsd.exe to generate the classes from the xsd's, but I read that attributes aren't supported for the DataContractSerializer. Why not? Does this mean that I can only have an soap+xml file with just elements? This is not possible because I don't create the requests. Is there a way to specify to svcutil to recognize attributes? 回答1: DataContractSerializer was created with a "code-first"

Why doesn't the /reference option to svcutil.exe work?

£可爱£侵袭症+ 提交于 2020-01-03 08:43:10
问题 I'm attempting to use svcutil.exe to generate -only- the service contracts (interfaces) from a set of .wsdl files. When I do this (from an http-hosted wsdl), it picks up the included schemas and generates all the code for them. Great. What I would REALLY like to do, however, is to use a set of classes already generated from the schema files using the xsd.exe tool (the reasons for this are not important, suffice it to say that I need to have the types in one assembly, and the service contracts

SvcUtil generates “Order” Named Parameter for xsd:all complexcontent

巧了我就是萌 提交于 2020-01-01 15:39:30
问题 Here is my dilemma, the svcutil command still generates Order Named parameter for complex content who are marked as xsd:all. Here is my sample schema. <xsd:complexType name="SpecialReportEntityRow" > <xsd:complexContent> <xsd:extension base="list:BaseRowExt"> <xsd:all> <xsd:element name="customerName" type="xsd:string" form="unqualified" minOccurs="0" maxOccurs="1" /> <xsd:element name="Id" type="xsd:long" form="unqualified" minOccurs="0" maxOccurs="1" /> <xsd:element name="certificateType"

Can I force svcutil.exe to generate data contracts for a WCF service?

北慕城南 提交于 2020-01-01 10:07:57
问题 I would like to force svcutil to generate all data contracts in an assembly that is used by WCF, regardless of whether or not a type is referenced by a given operation contract. [DataContract] public class Foo { } [DataContract] public class Bar : Foo { } [ServiceContract] public interface IService { [OperationContract] void Get(Foo foo); } Given this setup I cannot get svcutil to generate a version of Bar as there are no operation contracts that currently reference it. Is there a way to

Can I force svcutil.exe to generate data contracts for a WCF service?

陌路散爱 提交于 2020-01-01 10:07:13
问题 I would like to force svcutil to generate all data contracts in an assembly that is used by WCF, regardless of whether or not a type is referenced by a given operation contract. [DataContract] public class Foo { } [DataContract] public class Bar : Foo { } [ServiceContract] public interface IService { [OperationContract] void Get(Foo foo); } Given this setup I cannot get svcutil to generate a version of Bar as there are no operation contracts that currently reference it. Is there a way to

Providing array or list of class objects via WCF

三世轮回 提交于 2019-12-31 03:15:11
问题 Any example of WCF client server providing of List or Array of custom class objects would help me! But here is what I have got so far: Here is my class system I want to provide namespace NEN_Server.FS { [Serializable()] public class XFS { private List<NFS> files; public XFS() { files = new List<NFS>(); } public List<NFS> Files { get { return files; } set { files = value; } } } } where NFS is namespace NEN_FS { public interface INFS : IEquatable<NFS> { string Path { get; set; } } [Serializable

svcutil.exe - Proxy generated not allowing for nullable fields

我与影子孤独终老i 提交于 2019-12-30 03:25:24
问题 I am trying to consume a web service specified using WSDL by creating a WCF proxy using svcutil.exe, but the WSDL specifies that some of the operations have parameters that are optional (minOccurs="0"), for example: <xs:element minOccurs="0" maxOccurs="1" name="meetingId" type="xs:int" /> Unfortunately, the generated proxy does not allow me to not specify the values (the parameters are not nullable), and there are no "specified" fields as part of the call to instruct the proxy that no value

Does Visual Studio 2008 Use SvcUtil.exe and if “No” is there any disadvantage to using svcutil?

佐手、 提交于 2019-12-29 07:09:47
问题 After googling a bit there is no definite answer of whether Visual Studio 2008 uses svcutil.exe or not? Visual Studio 2005 did use it, but do the RTM versions of Visual Studio 2008 use svcutil? A few blogs say it doesn't (and make it seem surprising) SVCUtil & VS2008 Equivalent svcutil.exe command for VS2008 Add Service Reference SVCUtil Generating WCF client and the is field specified issue and other sites say it does. The reason I'm asking is we are flattening our WCF wsdl with a custom

Is there a reason for the nested generic collection classes in svcutil generated code?

十年热恋 提交于 2019-12-25 01:00:19
问题 I'm generating my data contract with a command line like: svcutil /ct:System.Collections.Generic.List`1 MySchema.xsd In my generated code, I end up with something like this (let's call this "style 1"): partial class A : object, System.Runtime.Serialization.IExtensibleDataObject { private BType collectionB; public BType CollectionOfB { get { return collectionB; } set { collectionB = value } } [System.Runtime.Serialization.CollectionDataContractAttribute(...)] public class BType : System