svcutil.exe

Why is an XSD element of type s:date becoming a string when generating a Service Reference?

会有一股神秘感。 提交于 2019-12-04 10:51:41
I'm trying to create a new Service Reference from a WSDL and all of the properties I expect to be DateTime instead of string. For example, this xsd definition for Contact: <s:complexType name="Contact"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="Address" type="tns:Address" /> <s:element minOccurs="0" maxOccurs="1" name="Email" type="s:string" /> ... <s:element minOccurs="1" maxOccurs="1" name="BirthDate" type="s:date" /> </s:sequence> The type of BirthDate is s:date, but the generated type (in Reference.cs) is a string. internal partial class Contact : object,

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

瘦欲@ 提交于 2019-12-04 06:08:42
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 force svcutil to generate the data contract for Bar ? Add a KnownType attribute to the Foo class [KnownType

Auto-alias generated SOAP proxies

只愿长相守 提交于 2019-12-03 21:56:44
问题 I'm currently preparing to consume a SOAP web service in a .NET project (C#), however the naming conventions used for the service types and operations are pretty bad not consistent with the naming conventions typical to C# .NET projects . My question, essentially: is there a way to auto-alias the generated SOAP web service proxy types/methods in my client implementation? I'm hoping that there's some way to perform a transformation of the WSDL with a map of aliases, such that the generated (or

WCF proxy generation: svcutil.exe vs wsdl.exe

此生再无相见时 提交于 2019-12-03 18:45:51
问题 I have .wsdl and .xsd files from WebService and need to generate proxy by them. Svcutil.exe and wsdl.exe generate very different output. What is the difference between these two tools for proxy generation and which way is more preferable? 回答1: Svcutil and wsdl are two different technologies for generating a proxy for consuming your service. But wsdl.exe was made for old .NET 2.0 web services. It is like old version of svcutil. Svcutil allows you to generate proxies for both - web services and

Svcutil.exe for .NET 4.0?

三世轮回 提交于 2019-12-03 04:14:14
问题 I was trying to use svcutil.exe to generate proxy classes for a service but when I use the /reference option to reference an assembly that is built for .NET 4.0 I get an error. Could not load file or assembly [...] or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. So it seems that I am using an old version of svcutil.exe. I am using the one in "C:\Program Files\Microsoft SDKs\Windows\v7.0A which was the latest one I

Is svcutil.exe a replacement for xsd.exe?

北战南征 提交于 2019-12-02 17:35:27
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 properties instead of creating types based on the schema in the .xsd file. For example, given this simple

Providing array or list of class objects via WCF

冷暖自知 提交于 2019-12-02 01:38:50
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()] abstract public class NFS : INFS { abstract public string Path { get; set; } public NFS() { Path =

How to run svcutil.exe from behind authenticating proxy

≡放荡痞女 提交于 2019-12-01 04:40:37
I want to run the svcutil.exe tool to access a web service on the internet. Unfortunately, whenever I try, I get a bunch of errors that include the following message: The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. As I have learned from this related post (with more details here ), the problem is that I am sitting behind an authenticating proxy. That post explains that I need to edit the app.config file, but I can't figure out how to do that. I think I will use the

How to run svcutil.exe from behind authenticating proxy

。_饼干妹妹 提交于 2019-12-01 01:12:40
问题 I want to run the svcutil.exe tool to access a web service on the internet. Unfortunately, whenever I try, I get a bunch of errors that include the following message: The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. As I have learned from this related post (with more details here), the problem is that I am sitting behind an authenticating proxy. That post explains

svcutil.exe - Proxy generated not allowing for nullable fields

妖精的绣舞 提交于 2019-11-30 09:39:33
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 should be sent. Is there any way to use svcutil to generate a proxy that would allow me to do this? (On