Question

I work with some application from others people. Now, time comes to update some services and functionality. I add to my old wsdl file new operation and I want to generate code for my application using svcutil. I am using svcutil from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools and after type a command:

svcutil.exe /async /tcv:Version35 c:\Dir\temp\wsdlgen\SckBiService.wsdl /o:c:\Dir\temp\wsdlgen\SckBiServiceTemp.cs

I get a file with code generated by tool with runtime version: 4.0.30319.18444 My old file with code had Runtime Version:4.0.30319.296

The files are different so if I change them errors appear. Example: New has:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]

[System.ServiceModel.ServiceContractAttribute(Namespace="http://www.myname.com/myname2/privatename/", ConfigurationName="SckBi")] public interface SckBi {

// CODEGEN: Trwa generowanie kontraktu komunikatu, ponieważ operacja „wersja” nie jest ani wywołaniem RPC, ani opakowanym dokumentem.
[System.ServiceModel.OperationContractAttribute(Action="", ReplyAction="*")]
[System.ServiceModel.XmlSerializerFormatAttribute()]
WersjaResponse wersja(WersjaRequest request);

Old has:

    /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SckBiSoapBinding", Namespace="http://www.myname.com/myname2/privatename/")]
public partial class SckBiService : System.Web.Services.Protocols.SoapHttpClientProtocol {

    private System.Threading.SendOrPostCallback wersjaOperationCompleted;

    private System.Threading.SendOrPostCallback weryfikacjaDanychOperationCompleted;

Example: In old file I have class SckBiService, in new I have interface SckBi and class SckBiClient. Some fields and operations are different and I do not know if it has some matter in application behaving.

Is any solution to specifies or download old version of svcutil and generate code like old one?

EDIT:

I miss very important information. Old generated code has class SckBiService and inherits from System.Web.Services.Protocols.SoapHttpClientProtocol. The new file does not use this class. Can I force svcutil.exe to do such a thing?

EDIT2:

After some researches I discover that older version of svcutil uses asmx client infrastructure (System.Web.Services.Protocols.SoapHttpClientProtocol and friends) and the latter uses the WCF client infrastructure (System.ServiceModel.ClientBase and friends). Still question is: how to generate with old version (asmx client infrastructure)?

Was it helpful?

Solution

After some search and investigation I finally achieve what I needed. It is not direct response for my question but it solve my problem.

I use example of program for generating code from wsdl in this msdn site. Generated code also has new runtime version (4.0.30319.18444 .NET 4.0) but class extend System.Web.Services.Protocols.SoapHttpClientProtocol class and it works fine with old code.

So eventually it was all about knowledge about WCF techiques: asmx, ServiceDescriptionInport, svc, ServiceContractGenerator.

(If this question will be useless, after 2 weeks I will remove it)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top