asmx

Alternative of using built-in object that implements IDictionary for a web method

I have a web application that uses the Web Service created in ASP.NET. In this, web service I want to pass an collection object of Key Value type (i.e. something like Hashtable or Dictionay). But we cannot use objects that implements from IDictionary. I do not want to create a serialized class in my web service. Can anyone suggest me th...

ASP.NET Web Service - how to handle special characters in strings?

To show this fundamental issue in .NET and the reason for this question, I have written a simple test web service with one method (EditString), and a consumer console app that calls it. They are both standard web service/console applications created via File/New Project, etc., so I won't list the whole code - just the methods in questio...

Calling ASMX from JQuery

Hi, I am trying to call ASMX method from JQuery without success. Following is my code and don't understand what i am missing. Thanks, Ebe ///Something.js function setQuestion() { $.ajax({ type: "POST", data: "{}", dataType: "json", url: "http: //localhost/BoATransformation/Survey.asmx/GetSurvey", ...

Calling ASP.NET server side method via JQuery

Hi, 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: $(...

Rare and sporadic 401 Unauthorized error with ASMX / WCF web service using Windows Authentication

We have a hybrid WCF and ASMX web service currently being used on a decent sized project. Now, most of time everything works perfectly fine, however on rare occasions and seemingly randomly, the web service begins to block calls which returns a 401 Unauthorized error back to the page in question. It seems to be the ASMX service calls tha...

ASMX webservice not returning JSON, can only POST using application/x-www-form-urlencoded contentType

I can call my webservice using jQuery IF the contentType = "application/x-www-form-urlencoded; charset=utf-8" This will, however, return the xml: <string>[myjson]</string> If I try to POST to the service using "application/json; charset=utf-8" I receive a 500 error with an empty StackTrace and ExceptionType. My webservice function is ...

In ASP.Net can I call a user controls WebMethod using Javascript and PageMethods?

It's saying PageMethods is undefined. ...

Passing Byte array from Blackberry to .NET Webservice

I am trying to sent a byte array from my Blackberry application to a .NET webservice (asmx). I am using the Sun Java Wireless Toolkit (WTK) 2.5.2 to generate the webservice stubs to use within the Blackberry solution. The WTK project settings are producing the stubs using the JSR 172 specification. I have created the Webservice using ...

Issue with Incorrect URLs in the WSDL of a .NET Web Service

We have installed an ASP.NET web site on a client's server. This site has a web service with a couple of web methods that are called by a Flash object in order to display a news feed. If you browse to their site (ex: www.domain.com), everything's working fine except the flash. The issue is that when we browse to the .asmx, the header ...

Why are SOAP and GET disabled in asmx webservices by default?

I'm about to turn on the missing protocols for my asmx webservices. They're already behind two layers of authentication and has a role checking attribute, so otherwise it is secure. This MS KB article explains GET and SOAP are disabled for asmx by default, while POST is enabled by default, but doesn't say why other than "security reaso...

.NET Web Service - Host name resolving improperly

Duplicate: This is the exact same question, from the exact same person, as Issue with Incorrect URLs in the WSDL of a .NET Web Service, and has the exact same answer. Let's please close this and merge it with the other. We have installed an ASP.NET web site on a client's server. This site has a web service with a couple of web methods...

Excel hangs when printing the first time from ASP.NET webservice

We are using Excel to convert SpreatSheetML to XLS in an ASP.NET webservice. Moreover, if the user checks the right checkboxes, we spawn a thread that uses Excel to print the spreadsheet. Recently, we have deployed the app in a new environment, and then we started having problems: the first time someone tries to print, Excel seems to h...

Calling asp.net webmethod with params from jquery errors

Hi there, I managed to setup a simple webmethod which i called from jquery and sure enough it returns ... then i added parameters on the method and added the params to jquery but it errors with Message":"Invalid JSON primitive: one.","StackTrace":" my signature on my webmethod is like so [WebMethod] public static str...

How do I debug mangled soap requests?

Lately, we've been seeing exceptions like this in our .NET (.asmx) webservices: System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (868, -3932). ---> System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 86...

Getting Exception Details from ASP.NET PageMethods on the Client SIde

I am having a pagemethod to which i give a call from my JavaScript say Pagemethods.MyMethod(MyParameter, onsucess, onfailure); In the Code behind, I have something like this: [WebMethod] public static void MyMethod(Param) { try{ //DoSomething.. } catch(exception ex) { //Log the exception and rethrow thr...

Get IP Address of the requested client (Soap message)

Hi guys, I builded a ASMX Service and in the code that process an Error Log that comes from ELMAH. I add into the database all the fields and I add some more, one is the IP Address of the requested client... But I can't (please read, don't know how to) get that... I'm used to string ipAddress = HttpContext.Current.Request.ServerVari...

Issues rendering UserControl using Server.Execute() in an ASMX web service

Can anyone explain to why Server.Execute() is requiring my rendered UserControls to contain <form> tags (or alternately, what I am doing wrong that is making Server.Execute() require form tags in my UserControls)? I have created an ASMX service to dynamically load UserControls via JQuery+JSON as follows: ControlService.asmx <%@ WebSer...

Service Design (WCF, ASMX, SOA)

Soliciting feedback/thoughts on a pattern or best practice to address a situation that I have seen a few times over the years, yet I haven't found any one solution that addresses it the way I'd like. Here is the background. Company has 3 applications supporting 3 separate "lines of business" that are very much related to each other. Tw...

Tracing Request Content Issued By Visual Studio Generated Web Service Proxy

I have a web reference proxy built up by the "Add Web Reference" feature in Visual Studio and need to trace/see the actual content it's posting to the remote web server. Can someone please tell me how I can do? Thanks! ...

Add Soap Header to Soap request in Visual Studio 2008

Hi, I'm trying to use a third party web service (so I do not have access to the web service code). In Visual Studio 2008 I created a new web site project (ASP and c#), and added the web reference (not web service! so I guess it is not a WCF service... correct?). The problem is that from the documentation of the web service I know that e...