asmx

Calling ASMX from jQuery

流过昼夜 提交于 2019-12-17 04:00:09
问题 I am trying to call an ASMX method from jQuery without success. Following is my code, and I don't understand what I am missing. File Something.js, function setQuestion() { $.ajax({ type: "POST", data: "{}", dataType: "json", url: "http: //localhost/BoATransformation/Survey.asmx/GetSurvey", contentType: "application/json; charset=utf-8", success: onSuccess }); } function onSuccess(msg) { $("#questionCxt").append(msg); } File SomethingElse.cs, [WebService(Namespace = "http://tempuri.org/")]

Enable ASP.NET ASMX web service for HTTP POST / GET requests

流过昼夜 提交于 2019-12-17 03:54:29
问题 I would like to enable a ASP.NET classic (ASMX) web service for HTTP POST and GET requests. I realise this can be done on a machine or application level by adding ... <webServices> <protocols> <add name="HttpGet"/> <add name="HttpPost"/> </protocols> </webServices> .. to the machine.config or web.config. My question is can HTTP POST and GET requests be enabled per web service or web method level rather than per application or machine? My web service is written in c# using net 3.5sp1. 回答1: Try

Calling an ASP.NET server side method via jQuery

风格不统一 提交于 2019-12-17 02:13:29
问题 I'm trying to call a server side method from client side via jQuery. My code is as follows: Server side: using System.Web.Services; [WebMethod()] //[ScriptMethod()] public static void SendMessage(string subject, string message, string messageId, string pupilId) { //Send message } Client side: $("#btnSendMessage").live("click", function(){ var subject = $("#tbSubject").val(); var message = $("#tbMessage").val(); var messageId = $("#hdnMessageId").val(); var pupilId = $("#hdnPupilId").val(); $

What are the differences between WCF and ASMX web services?

▼魔方 西西 提交于 2019-12-17 00:28:49
问题 I am totally confused between WCF and ASMX web services. I have used a lot of web services in my earlier stage, and now there is this new thing introduced called WCF. I can still create WCF that function as a web service. I think there will be more stuff in WCF. What are the differences between WCF and Web services? When should each one be used? 回答1: Keith Elder nicely compares ASMX to WCF here. Check it out. Another comparison of ASMX and WCF can be found here - I don't 100% agree with all

WCF, ASMX Basic HTTP binding and IIS

≡放荡痞女 提交于 2019-12-14 03:53:30
问题 I have been doing a lot of work with WCF "self" hosted applications. I recently was requested to write a web service where the calling client was a Linux based program named "WGET". I would like to use WCF instead of a traditional ASMX web service. The web service is returning a standard XML response. I am not sure of the underlining details between the two technologies but I know WCF is the proper route. I created a WCF service to be hosted in IIS ( using basicHttpBinding). 1.) Did classic

handle global errors asmx

谁说我不能喝 提交于 2019-12-14 03:23:59
问题 I have class that implements asmx service. class AsmxService{ public string Method(int i){.....} ....} I omit some attributes, but can provide full code if you find it necessary. If I get exception into function Method, it's not a problem: just use try-catch. But what should we do, if error occured outside the function. For example, client passed invalid int parameter or something else. In that case on client side I get message about exception. But I d'like to hide all details of error and

SoapHttpClientProtocol: get response as a stream instead of a string?

这一生的挚爱 提交于 2019-12-14 01:52:10
问题 I'm using a webservice which spits out very large amounts of data in one piece. The response string can be something like 8MB. While not an issue on a desktop PC, an embedded device goes nuts dealing with an 8MB string object. I wonder if there is a way to get the response as a stream? Currently I'm using the method like below. I tried using a POST request instead, but SOAP is just more convenient (the response is XML and with the POST I have to convert the plain text reply back to valid XML)

Web service method works fine on development computer but failed on server

佐手、 提交于 2019-12-14 00:40:00
问题 I have a serious problem with ASP.NET web service. I have a web service method that checks for the existence of user password in my project's database. I wrote the method inside an asmx file to access to it. [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services

Multiple XmlElement attributes on same property/class/

风流意气都作罢 提交于 2019-12-13 19:29:55
问题 I'm putting several legacy web services and the current web service into the same back end. But I have to keep the old web services compatible with there old interface. So my question: Is there a way I can set several attributes on, for example, a property? Like this: [XmlElement("AvailableFrom",... what I need...)] [XmlElement("Available",... what I need...)] public DateTime AvailableFrom{get; set;} One solution would be creating extra properties, but I really don't like the code bloat.

JSON Rpc libraries for use with .NET [closed]

丶灬走出姿态 提交于 2019-12-13 19:04:46
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am looking into JSON RPC libraries for .net that are free to use in commercial applications. Up until now i just seem to have found JROCK. What other libraries, architecture have i got similar to JRock for .NET 2.0 What is the difference between a [WebMethod] in asmx web-service returning a instance of a class