asmx

What are these extra parameters in my ASMX Proxy Methods?

牧云@^-^@ 提交于 2019-12-18 05:54:27
问题 If I add a web reference from a .NET 1.1 client to a WCF service, the proxy methods generated at the client contain an extra parameter ending with the suffix 'Specified' for each service method parameter, e.g. [OperationContract] string HelloWorld(string foo, int bar); results in: Service1.HelloWorld(string foo, bool fooSpecified, int bar, bool barSpecified); My service parameters aren't optional so what are these extra parameters at the client, and how can I get rid of them? 回答1: This is due

asp.net webservice handling gzip compressed request

不问归期 提交于 2019-12-18 02:48:04
问题 I have an asp.net .asmx webservice written to handle requests from a third party tool. The third party tool makes an http POST request to the webservice to get user information. I'm using IIS7 Running Fiddler with "Remove All Encodings" checked, I can see the webservice call and and everything functions properly. If I uncheck "Remove All Encodings", the webservice call fails with a 400 Bad Request. The difference I see is that the header "Content-Encoding: gzip" is being removed by Fiddler

Asmx web service basic authentication

南楼画角 提交于 2019-12-17 22:37:45
问题 I want to implement basic authentication using username and password validation in my asmx web service. I don't want to use WCF and I know this is not secure way , but I need to use basic authentication without using https. My web service is like this: [WebService(Namespace = "http://www.mywebsite.com/")] public class Service1 { [WebMethod] public string HelloWorld() { return "Hello world"; } } And I use this custom HttpModule: public class BasicAuthHttpModule : IHttpModule { void IHttpModule

ASP.NET Web Method that accepts a List<CustomObject> is failing with “Web Service method name is not valid.”

假装没事ソ 提交于 2019-12-17 19:28:32
问题 I want to create a web method that accepts a List of custom objects (passed in via jQuery/JSON). When I run the website locally everything seems to work. jQuery and ASP.NET and everyone is happy. But when I put it on one of our servers it blows up. jQuery gets a 500 error after the ajax request with the response being: System.InvalidOperationException: EditCustomObjects Web Service method name is not valid. Here's the web service method: [WebMethod] public void EditCustomObjects(int ID, List

How to make a dotnet webservice set minOccurs=“1” on a string value

大兔子大兔子 提交于 2019-12-17 18:56:50
问题 I have an XSD: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://a.com/a.xsd" targetNamespace="http://a.com/a.xsd" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="A"> <xs:complexType> <xs:sequence> <xs:element name="Item" minOccurs="1" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="1"/> <xs:whiteSpace value="collapse"/> </xs:restriction> </xs:simpleType> </xs

“Asynchronous operations are not allowed in this context”

点点圈 提交于 2019-12-17 17:13:34
问题 I get the exception below when invoking he automagically generated async webmethods that i asked about in this post Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to Google search results in add Async = True in the page directive but various people have noted that this makes the page 'Blocking' (which isn't true asynchronous operation)

What is the difference between an asp.net web method and a wcf service?

血红的双手。 提交于 2019-12-17 08:07:10
问题 I'm new to .Net and do not understand the difference. Can someone point me in the right direction? 回答1: ASP.NET Web services was developed for building applications that send and receive messages by using the Simple Object Access Protocol (SOAP) over HTTP. WCF is for enabling .NET Framework applications to exchange messages with other software entities. SOAP is used by default, but the messages can be in any format, and conveyed by using any transport protocol. You can view ASP.NET web

What is the difference between an asp.net web method and a wcf service?

 ̄綄美尐妖づ 提交于 2019-12-17 08:06:35
问题 I'm new to .Net and do not understand the difference. Can someone point me in the right direction? 回答1: ASP.NET Web services was developed for building applications that send and receive messages by using the Simple Object Access Protocol (SOAP) over HTTP. WCF is for enabling .NET Framework applications to exchange messages with other software entities. SOAP is used by default, but the messages can be in any format, and conveyed by using any transport protocol. You can view ASP.NET web

Asmx web service how to return JSON and not XML?

余生长醉 提交于 2019-12-17 06:56:29
问题 My service method: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string getDataFromTrainingMaster() { List<TrainingMasterDataStruct> results = new DAL().GetDataFromTrainingMaster(); JavaScriptSerializer js = new JavaScriptSerializer(); return js.Serialize(results).ToString(); } My .net web service returns JSON wrapped in XML as follows: <?xml version="1.0" encoding="UTF-8"?> <string xmlns="http://tempuri.org/"> [{"Training_Code":"1234 ","Training_Duration":"2hrs ",

Call ASP.NET PageMethod/WebMethod with jQuery - returns whole page

我的未来我决定 提交于 2019-12-17 04:21:50
问题 jQuery 1.3.2, ASP.NET 2.0. Making an AJAX call to a PageMethod (WebMethod) returns the full/whole page instead of just the response. A breakpoint on the page method shows it's never getting hit. I have the [WebMethod] attribute on my method, and it is public static, returns string and accepts no params. I even tried adding [ScriptService] at the top of my class to see if it helped, but it did not. I have seen this post Jquery AJAX with ASP.NET WebMethod Returning Entire Page which had my same