Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have been trying to figure this out for a while now. I have been able to find sample code for console application to post data but i'm completely new to web services. I have a console app that does some calculations and i would like to then send those calculations to a web service. Could some one please provide some very simple code as to what the post looks like on the console app side and also what a web service needs to accept the post or whatever the proper term is for it. Any help is greatly appreciated.
Posted
Comments
ZurdoDev 14-May-13 11:44am    
Did you right-click references and try to add a reference to the web service?
Dustin Prevatt 14-May-13 14:39pm    
I understand how to add a reference to the web service and then call upon the web services methods, but i would like to post data to the web service. Not just call the methods. Am I missing something? Can i also post to the web service ?

 
Share this answer
 
Comments
Dustin Prevatt 14-May-13 14:39pm    
I understand how to add a reference to the web service and then call upon the web services methods, but i would like to post data to the web service. Not just call the methods. Am I missing something? Can i also post to the web service ?
RaisKazi 14-May-13 14:43pm    
Have you looked at those two links. Both has an example of POST.
Dustin Prevatt 14-May-13 15:04pm    
Yes i tried to use the code from http://forums.asp.net/t/1056508.aspx/1 but then I got back the error
System.Net.WebResponse response = request.GetResponse(); //The remote server returned an error: (500) Internal Server Error.
You cannot get a "simple code" in response to such a vague request. It really depends on the detail of what you want to achieve and your service.

However, one thing is obvious: your Web Service application provides some interface to the client application. Your console application is no different from such client application. Your service can be SOAP or JSON based, RESTful or not, WCF based, and so on. It all defines what the client should do.

For basic ideas, please see: http://en.wikipedia.org/wiki/Web_service[^].

But ultimately, learn about the particular Service you are going to use consume.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900