Bravo2007

Is it possible to use the WSDL generated using svcUtil.exe to create proxies for framework 2.0 client i.e. I create WSDL using svcUtil and use wsdl.exe to create proxy and use the proxy generated in 2.0 windows application client

any one has done this successfully

thanks



Re: Windows Communication Foundation (Indigo) WSDL generated from svcUtil and wsdl.exe

Carlos Figueira - MSFT

Yes, as long as the service from which the original WSDL was generated is compatible with the 2.0 clients (if you use the BasicHttpBinding, for example). If the service uses some advanced features (e.g., WS-RM), then WSDL.exe won't be able to consume it.



Re: Windows Communication Foundation (Indigo) WSDL generated from svcUtil and wsdl.exe

Carlos Figueira - MSFT

This is the code for the test for this scenario:

public class Post1841454

{

[ServiceContract]

public interface ITest

{

[OperationContract]

string Echo(string str);

}

public class Service : ITest

{

public string Echo(string str) { return str; }

}

public static void Run()

{

string baseAddress = "http://" + Environment.MachineName + ":8000/Service";

ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));

ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();

metadataBehavior.HttpGetEnabled = true;

host.Description.Behaviors.Add(metadataBehavior);

host.AddServiceEndpoint(typeof(ITest), new BasicHttpBinding(), "ITest");

host.Open();

Console.WriteLine("Host opened");

Console.Write("Press ENTER to close");

Console.ReadLine();

host.Close();

}

}

Then run:

>svcutil.exe /target:metadata http://<machineName>:8000/Service

It will create three files (the wsdl and two schema files)

>wsdl.exe tempuri.org.wsdl tempuri.org.xsd schemas.microsoft.com.2003.10.Serialization.xsd

This will generate a v2.0 client that can be used to talk to the service.





Re: Windows Communication Foundation (Indigo) WSDL generated from svcUtil and wsdl.exe

Hiten

Carlos,

thanks for prompt answer, a quick followup would be, will it be same if I use svcUtil to generate .wsdl without hosting the service I mean by running svcUtil.exe to generate .wsdl whout hosting it in any host

Thanks





Re: Windows Communication Foundation (Indigo) WSDL generated from svcUtil and wsdl.exe

Carlos Figueira - MSFT

If you run svcutil against the service assembly (and config), it would also work - as long as the bindings you use are compatible with the v2.0 stack.