Google Answers Logo
View Question
 
Q: How to invoke a web service through http in C# ( No Answer,   1 Comment )
Question  
Subject: How to invoke a web service through http in C#
Category: Computers > Programming
Asked by: thelameduck-ga
List Price: $5.00
Posted: 22 Dec 2004 10:15 PST
Expires: 21 Jan 2005 10:15 PST
Question ID: 446038
I hope this is a simple question, and i'll accept a quick simple answer if so.

What components and code to i need to use to invoke a web service from
my C# desktop application using http.

I know that i can create a reference to a known web service and then
use it like a class, but i want to have a component(lets call it HTTP)
that i can use like this:
HTTP.Path = "http://www.somewebsite.com/webservice1.asmx/afunction";
HTTP.Params.Add('FName').Value = myFNameVariable;
HTTP.Params.Add('LName.....Etc.

You get the idea. basically so i can call web services completely from
code, pass parameters, and get the return value. i'm sure C# has an
include component, please point the way with the

component name

and a few lines of code using it

thanks
Answer  
There is no answer at this time.

Comments  
Subject: Re: How to invoke a web service through http in C#
From: mathtalk-ga on 26 Dec 2004 19:33 PST
 
Hi, thelameduck-ga:

You do not mention SOAP (or as Microsoft likes to rebrand such topics,
ROPE), so I'm going to try and interpret your Question as regarding a
broader notion of web services.  Conceivably any ad hoc "request"
posed via HTTP formulated as a URL, possibly with parametric data,
would fit this broader notion.

Thus, if there is a simple answer to your question, it would be the
HttpRequest class in the .Net framework:

[System.Web.HttpRequest (noninheritable class)]
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwebhttprequestclasstopic.asp

In C# we would refer to this as a sealed class, which means the .Net
programmer is not allowed to derive (inherit) classes from it.

Take a look at the members & methods of the class provided by the .Net
framework. Perhaps in your context this is more of a base class that a
programmer would want to use to create a "generic" web service
interface.  However rather than inheriting directly from it, you'd
create a new class whose instances construct one or more HttpRequest
members.

regards, mathtalk-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy