WCF does not generate the properties

Posted by BDotA on Stack Overflow See other posts from Stack Overflow or by BDotA
Published on 2010-06-07T17:37:30Z Indexed on 2010/06/07 17:42 UTC
Read the original article Hit count: 301

Filed under:
|
|

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
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about wcf