Hi,
I'm novice by complete to webservices et al.
I've created successfully a webservice and referenced it
in a console application. By simplification let assume that
the webservice contains a webmethod, the 'classic'
CelsiusToFarenheit (string Celsius).
Once referenced i can see my new namespace
ServiceReference1 with the following classes inside:

CelsiusToFahrenheitRequest
CelsiusToFahrenheitRequestBody (it contains the property Celsius)
CelsiusToFahrenheitResponse
CelsiusToFahrenheitResponseBody (it contains the property CelsiusToFahrenheitResult)
Service1SoapClient (with 5 overloads at the instantiation).

and 2 interfaces:
IService1Soap
IService1SoapChannel

I've intantiated the first 4 classes and toying with it to no avail.
How can i obtain :

string Fahreheit = ......

Thanks

Just make a new instance of the "Service1SoapClient", like this:

Service1SoapClient myWS = new Service1SoapClient();

Then, you should see your methods on the "myWS" variable:

string sResult = myWS.CelsiusToFahrenheit("25");

You may have to include the namespace, if you did not put it in the "using" section:

ServiceReference1.Service1SoapClient myWS = new ServiceReference1.Service1SoapClient();

However, after you have instantiated the class, you can call the methods on it.

Just make a new instance of the "Service1SoapClient", like this:

Service1SoapClient myWS = new Service1SoapClient();

Then, you should see your methods on the "myWS" variable:

string sResult = myWS.CelsiusToFahrenheit("25");

You may have to include the namespace, if you did not put it in the "using" section:

ServiceReference1.Service1SoapClient myWS = new ServiceReference1.Service1SoapClient();

However, after you have instantiated the class, you can call the methods on it.

Thanks very much, it worked!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.