You just should use the new method. The old one is deprecated - see the question in your comment: Web Reference vs. Service Reference.
The last answers sums it like it is. In the end, the reference is just the creation of a client library to call the service. That's it.
Adding a service reference allows you to create a WCF client, which can be used to talk to a regular web service provided you use the appropriate binding. Adding a web reference will allow you to create only a web service (i.e., SOAP) reference.
If you are absolutely certain you are not ready for WCF (really don't know why) then you should create a regular web service reference.
(see: https://stackoverflow.com/a/2158137/2416958)
So, to "fix" your issue:
You need to include the namespace
which you used to create the client on top of your file:
In my example:
using ServiceReference1;
But it can be different in your case. You can find it at the generated files, its called ServiceReference1
in my case:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ServiceReference1
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.1")]
[System.ServiceModel.ServiceContractAttribute(Namespace="webservice.magfa.com", ConfigurationName="ServiceReference1.MagfaSoapServer")]
public interface MagfaSoapServer
{
You need to create a new one with this:
var client = new MagfaSoapServerClient();
client.ClientCredentials = ...