asmx

AJAX responseText undefined

感情迁移 提交于 2019-12-11 09:47:39
问题 Javascript code: ............... ............... var cutid = $(th).attr("data-cutid"); var request = $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "Services/Cut.asmx/CheckCuts", data: "{'cuts':" + JSON.stringify(ListCuts) + ",'idCut':'" + cutid + "'}", dataType: "json" }).responseText; alert(request); // undefined Function from web service: [WebMethod] public string CheckCuts(List<CutM> cuts, Guid idCut) { return UtilCut.CheckCuts(cuts, idCut).ToString(); } The

ASMX web service Enum not retaining its value

*爱你&永不变心* 提交于 2019-12-11 09:27:29
问题 I have created a web service containing an enum with values as follows public enum DesignChoice { DesignerChoice = 1, CustomerChoice = 2, AdditionalDesign=3, } When I add a reference to my client website, enum values are changed as in the following code: (int)DesignChoice.AdditionalDesign returns 2 but I am expecting it to be 3. I have tried the serialization attributes [System.Xml.Serialization.XmlTypeAttribute()] out of nowhere but had no luck. WSDL of the service describes the enum as

PHP SOAP returning SOAP Fault: Server was unable to process request with .asmx Web Service

做~自己de王妃 提交于 2019-12-11 08:04:57
问题 I am having difficulty in getting a SOAP request working properly , which requires XML string as input. It's throwing "SOAP Fault: Server was unable to process request. ---> Value cannot be null. Parameter name: s" no matter what input i send , i have used nusoap but to no avail , PHP soap library. The code i am using is: <? $aOptions = array( 'location' => 'http://webserviceurl.asmx', 'uri' => 'http://tempuri.org/', "style" => SOAP_RPC, "use" => SOAP_ENCODED ); $client = new SOAPClient(null,

C# class library, Silverlight class library , asmx web services WTH

久未见 提交于 2019-12-11 07:57:50
问题 ASMX services do not have ability to reuse the Silverlight Class library and Silverlight application needs dedicated Class library and not the C# class library. So i had to duplicate the C# class library code to a Silverlight class library to work with my Silverlight application, now that was not the problem here. I would like technical answers(In depth if possible) to these questions Why is it that Silverlight needs dedicated Silverlight Class library. Even though it runs above a layer on

MVC Style Filters on ASMX Web Services, is it possible?

北慕城南 提交于 2019-12-11 06:26:55
问题 Is it possible to create MVC style filter attributes (like Authorize or HandleError) that work on ASMX Web Services? Specifically, I perform custom authentication on a number of my web methods and would like to wrap the code into an Attribute that throws an exception, if the authentication checks fail. Rich 回答1: Since ASMX are also server by the ASP.NET pipeline, you could just use HttpModules, which give you a lot of control on the way in and the way out. Here's a reference and an example:

How to programmatically retrieve all of a web service's web methods' signatures?

限于喜欢 提交于 2019-12-11 05:29:25
问题 I'm trying to build a c# application that displays and invokes all of a specific web service's methods (the web service is written as a .asmx file). I can go directly to the asmx file and get the methods names from the returned html, but I'm sure there is more elegant way to do it (this way doesn't reveals the web methods' signatures as well, only their names..). So how can I programmatically ask the service what are it's methods? Thanks. 回答1: Get the WSDL of your web-service to discover all

jquery Ajax Request SyntaxError: Unexpected token <

耗尽温柔 提交于 2019-12-11 04:17:17
问题 I am trying to return an array of products using a get request. The response returns XML with a 200 request. Web Service: [WebMethod] [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] public List<product> GetAllProducts() { using (SchulteDesignYourOwnEntities db = new SchulteDesignYourOwnEntities()) { return db.products.ToList(); } } Here is my code: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src=

How to Declare Complex Nested C# Type for Web Service

安稳与你 提交于 2019-12-11 03:48:44
问题 I would like to create a service that accepts a complex nested type. In a sample asmx file I created: [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class ServiceNest : System.Web.Services.WebService { public class Block { [XmlElement(IsNullable = false)] public int number; }

Can I change a parameter name in a C# WebMethod?

我们两清 提交于 2019-12-11 03:43:24
问题 Is it possible for a C# WebMethod to accept a different parameter name than its client sends? For example, given a client sending this message: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <GetStatus xmlns="http://example.com/"> <Arg1>5</Arg1> <Arg2>3</Arg2> </GetStatus> </soap:Body> </soap:Envelope> Can the existing

WCF or Web Services (.asmx) for iOS application?

家住魔仙堡 提交于 2019-12-11 03:23:49
问题 I am fairly new to web development & web services. I have been playing around with traditional web services (.asmx) in .NET using C#. Someone suggested that a lot of services now use WCF and I was wondering if I should learn WCF and use that to communicate with my iOS app. It looks like WCF will be a bit of a learning curve as I don't have any experience in .NET frameworks (little experience in C#). I'm not sure if its worth spending the time on WCF or should I just use the traditional way of