.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

HTTP Post and WebService

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I am working on a application which will accept the data in the post request. My application also wants to expose a web service and want to call another web service. Considering all these 3 action that I want to do, can I create a single application which will have a web form which will accept the POST request and expose a web service at the same time.

Although it may be possible to achieve this, Is this a correct way of doing it?

View Complete Post

More Related Resource Links

HTTP verb POST used to access path ' ' is not allowed



Im new to ASP.NET MVC 2.

Im trying to call a controller method using Jquery $.ajax().

---- inside Controllers/ServiceController

public string GetString()


        return "My First MVC Ajax Testing";


---- javascript code calling the controller method

    var serviceUrl = '~/Controllers/ServiceController/GetString';

    var jsonData = '';


        url: serviceUrl,

        type: 'POST',

        data: JSON.stringify(jsonData),

        dataType: 'json',

        beforeSend: function (XMLHttpRequest) {



        success: function (data, textStatus, XMLHttpRequest) {

            onSuccess(data, textStatus, XMLHttpRequest);


        error: function (XMLHttpRequest, textStatus) {


Overload POST with X-HTTP-Method-Override as DELETE

Hi, How do I pass POST with the override header, X-HTTP-Method-Override, which will say I really mean DELETE in REST WCF 3.5? What changes are needed exactly in server side REST code & where to make those changes exactly? Can some one post code snippet? Thanks!

Receiving a message that was sent using HTTP POST

Hello helpers,   I'm somewhere between a beginner and intermediate asp.net and c# user who is looking to receive a message/variable and then URL decode it. The message is being sent via HTTP post. I'm not sure exactly how to get started, and am looking for a tutorial but haven't been able to find one. Can anyone point me in the right direction or give me some sample code to learn from? Thank you for your time  

HTTP POST in WPF/XBAP with partial trust

Hi, Is it possible to do a HTTP POST in XAML browser app with partial trust? I've tried to search for a solution, but I can't find any. I want to send a HTTP POST request to a website, within the same domain, that return a downloadable report (in a new window, _blank). I've earlier used hyperlink with GET parameters, but I have to use POST due to large amount parameter data. Is this possible? Edit: I'm using .Net Framework 3.5

WCF webservice: HTTP/1.1 400 Bad Request while sending large input

I am connecting to a WCF based webservice. For certain methods, the input contains a list of objects/structures. When the number of items in this list increases beyond a certain number, the service fails with HTTP/1.1 400 Bad Request when I try to test the same using SOAPUI. I tried changing the web.config file with the following changes: <httpRuntime maxRequestLength="2097151" /> <binding name="basicHTTP" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" maxReceivedMessageSize="4194304" maxBufferSize="98547" maxBufferPoolSize="258547"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </binding>   Kangkan

HTTP Post to Web Service?

I have a web service that I'm trying to consume from a console app through http post.  I receive a 500 exception error from the xmlstring parm being passed to the web service.  Can someone please help?   Add the following to web.config of the web service.  Although it is not working in debug in vs 2008 as well. <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> <add name="HttpSoap"/> <add name="Documentation"/> <add name="HttpPostLocalhost"/> </protocols> </webServices> The web service is not executing any logic:Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Security.Cryptography Imports System.IO Imports System.Text Imports System.Xml Imports System.Linq Imports System.Xml.Linq Imports System.Xml.XPath.Extensions Imports System.Data Imports System.Collections Imports System.Collections.Generic Imports System.Diagnostics Imports System.Net Imports System.Diagnostics.Process Imports System.Runtime.InteropServices ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. ' <System.Web.Script.Services.ScriptServi

WCF HTTP POST - The remote server returned an error: (400) Bad Request. - URGENT

client & sever code below-------------------------------------------- [ServiceContract(Namespace = "http://test.mydomain.com")] public interface IMyService{[WebInvoke(UriTemplate = "", BodyStyle = WebMessageBodyStyle.Bare, Method = "POST")] Stream SaveXML(Stream input); } ----------------------[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(Namespace = "http://test.mydomain.com")] public class MyService : IMyService{  public Stream SaveXML(Stream input)   {              StreamReader streamReader = new StreamReader(input);       string rawString = streamReader.ReadToEnd();       streamReader.Dispose();        // here need to save the input stream to xml format file          //       Encoding encoding = Encoding.GetEncoding("ISO-8859-1");       WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml";         byte[] returnBytes = encoding.GetBytes(rawString);       return new MemoryStream(returnBytes);   } } --------------------------------------------------Client Code         string postData = GetXmlString("d:\\text.xml"); // user function        WebRequest request = WebRequest.Create("http://test.mydomain.com/myservice.svc");        request.Method = "POST";        byte[] byteArray = Encoding.UTF8.GetBytes(p

create web service with http-post method


hi All,

we need to expose a web service to the 3rd party vendor which can only call using POST protocol, NOT SOAP.

So my question, is it better to build a web service or just simply .aspx page?

Also is there any best practice documentation on this.



How to get remote site url from HTTP POST


I have a remote website form which sends variables to a page of my asp website. This is a standard form with http post.  How do I access the url which sent the request to the page? Is this an environment variable? Http_referrer?


How to call a webService Method Using Http get Protocol



I have Created A simple WebService Method Like If a Pass Id it will return Name Of the Employee from database.

That webService is Working Fine i ahve Tested It.

My Question is Now I haveto call this webservice using HttpGet Protocol from CLient Application.


please provide me some samples on it.




Thanks&Regards, -Amar.

Unable to get to the webservice using ajax POST jQuery



I need to pass a customer id to get some data back for a customer from a webservice. I can't figure out how to get to the webservice, I have a breakpoint set in the webmethod but it's not being hit and the alert box is not popping up either.  For a test I am just trying to show some value from the returned data in an alert box.  Note I am just hard coding the customer id of 1001. The webmethod takes a parameter of string customerid.

//Webmethod code:

        public customer fetchcustomer(string customerid)
            customerDL custDL = new customerDL();
            return custDL.getData(customerid);



//jQuery code:
   $(document).ready(function() {

            type: "POST",
            contentType: "application/json; charset=utf-8",

HTTP POST request and encoded string



I have to do a simple HTTP POST request by key/value pairs and receive a XML file with a session key. I made it work, but there's something strange about it - when session key includes character '&', then it return encoded like '&amp;'. After that my application needs to send that session key to server every time I make a query. When session key includes '&', then query won't work, because server side is expecting correct (not encoded) session key. Does somebody knows how to fix this problem? My HTTP POST Content-type is "application/x-www-form-urlencoded".

How can i send a http post, to get the girdview's data ? thanks


how to send a http post to asp.net web,

and to get the gridiview's data .

Gridview like this:




Creating a Web Service to Recive a HTTP POST with an XML document as the body or payload from a PHP



I have been strugleing with this for more than a week, and have not been able to get any further ahead. I need to create a Webservice that can recive an HTTP Post with an XML document as the body or payload. It will be comeing from a PHP site, and I need to access it in ASP.Net.

I can create a webservice and test it out correctly with no real hitch, but when testing with my  third partys test page I am not getting the proper responce. The third party company can not provide me with much help since they do not know ASP.

The following is a sample code peice that can open a string of XML passed, and I have a form that can post to this test page.

public XmlDocument ProcessXML(String SourceXML)
XmlDocument NewSourceXML = new XmlDocument();



I knoiw that once I can read the posted XML I can break it down and do what I need to do with it, but I am having issues reciving the XML at this point.

My third party provided me with a basic excert from a PHP file.

 *  Get the HTTP request (body) and parse into an XML document
$data = file_get_contents("php://input");
$xmlstr = trim( stripslashes( $data ) );
$xml = new SimpleXMLElement($xmlstr);

But this is of no help to me. I need to

Silverlight WebService call - The provided URI scheme 'file' is invalid; expected 'http'.



I am getting following when trying to consume WebService from Silverlight.

The provided URI scheme 'file' is invalid; expected 'http'.
Parameter name: via

Any idea ? Please help.

Exception '' is raised right at
public CurrServiceClientChannel(System.ServiceModel.ClientBase<B.Silverlight.BT.Ent.EntServiceRef.ICurrService> client) : base(client) {}



ASP.NET Architecture - ASP.NET Worker Process - HTTP Pipleline - Http Modules and Handlers

"ASP.NET is a powerful platform for building Web applications, that provides a tremendous amount of flexibility and power for building just about any kind of Web application. Most people are familiar only with the high level frameworks like WebForms and WebServices which sit at the very top level of the ASP.NET hierarchy. In this article I'll describe the lower level aspects of ASP.NET and explain how requests move from Web Server to the ASP.NET runtime and then through the ASP.NET Http Pipeline to process requests.

Open File Print File Excel

Batch print many Excel files without having to open each one at a time. Quickly print mass amounts of xls files at once with this program. You must have Excel installed on your machine..
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend