tags:

views:

29

answers:

1

I have a .NET 1.1 ASMX and want to use it in a client WinForms app. If i go wit the old way and add it as a "WebRefrence" method then I will have access to two of its properties which are "url" and "UseDefaultCredentials" and it works fine. But if I go with the new WCF way and add it as a ServiceReference I still have access to the methods of that ASMX but those two properties are missing. what is the reason for that?

so for example in the old way ( adding WebReference) these codes are valid:

    TransferService transferService= new TransferService();
    transferService.Url = "http://something.asmx";
    transferService.Credentials = System.Net.CredentialCache.DefaultCredentials;
    string[] machines = transferService.GetMachines();

But in the new way ( adding Service Reference )

    using(TransferServiceSoapClient transferServiceSoapClient = new TransferServiceSoapClient("TransferServiceSoap"))
    {
        transferServiceSoapClient.Url = "someUrl.asmx"; //Cannot resolve URL
        transferServiceSoapClient.GetMachines(new GetMachinesRequest());
        transferServiceSoapClient.Credentials = .... //  //Cannot resolve Credentials
    }
+3  A: 

Because those are configured in the endpoint in your app/web.config or programatically if you prefer. More on configuring a WCF client here.

Darin Dimitrov