FAQ Database Discussion Community


Read authentication info (Principal) by developing a .Net Web Service

c#,asp.net,.net,asmx,claims-based-identity
I am dealing with a Claim-based application, with the aim to display users info after their authentication through SSO. For a given authenticated user, I realized a .Net Web Page wherein I show all claims starting from the provided Principal (Page.User), as follows: public partial class ClaimsPage : System.Web.UI.Page {...

forcing to ignore some url parameters

c#,.net,web-services,parameters,asmx
I am making an iPhone app where I am using .NET webservice. Let's say below is the URL I have. http://www.myweb.com/wser.asmx/listOfStudents?class=12 Here I was getting list of students with below fields in it. Name Roll Number Class Now client asked to make arabic version. So we update the query to...

web service page System.IndexOutOfRangeException

asp.net,asmx
public class GetAreaFromCity : System.Web.Services.WebService { [WebMethod] public GetAreaByCityId ClassForGetCIty(int City_Id) { string CS =ConfigurationManager.ConnectionStrings["FOODINNConnectionString"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { SqlCommand cmd = new SqlCommand("spGetCityById",con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parameter = new SqlParameter("@ID", City_Id); //To assiate this parameter object with cmd object cmd.Parameters.Add(parameter); GetAreaByCityId...

How do I debug the “500 internal error” when I am trying to get data form '.asmx' webservice using jquery ajax

jquery,asp.net,ajax,web-services,asmx
I am trying to send an ajax request to my asp.net server using jquery and get some data back.But there is no way I can do this it seems.No matter what I do I get Failed to load resource: the server responded with a status of 500 (Internal Server Error)...

How to send parameters to a webservice method that only accepts one argument in C#

c#,web-services,asmx
I am new to webservices in general. I am trying to add 4 parameters to the rmc service CreateCar, and have attempted to do so in my Webservices.cs file. Unfortunately, the CreateCar method only takes 1 argument (request). Most of this code is based on similar processes that do accept...

Running a .asmx Web service as a Windows Service

c#,visual-studio-2010,web-services,wcf,asmx
I'm a total novice on asking questions on this forum - I hope I ask this question correctly. The problem I'm trying to tackle is this: I have a Visual Studio 2010 project which is for a Web Service. The class which does the work is defined in a ".asmx"...

Kendo Grid not binding to JSON result from ASMX Web Service

asp.net,json,kendo-grid,asmx
I have a problem binding Kendo GRID to ASP.NET asmx web service. Following is HTML Code <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" href="styles/kendo.common.min.css" /> <link rel="stylesheet" href="styles/kendo.default.min.css" /> <link rel="stylesheet" href="styles/kendo.dataviz.min.css" /> <link rel="stylesheet" href="styles/kendo.dataviz.default.min.css" /> <link href="styles/kendo.common-bootstrap.min.css" rel="stylesheet" /> <link...

ASMX web-service work on both HTTP and HTTPs

c#,asp.net,web-services,soap,asmx
I have a soap web-service in asp.net. Currently the URL is http://www.mylink.org/webservices/abcws.asmx. I have a request from a client to make the webservice work in both HTTP and HTTPS. Does anybody know how to achieve this in asp.net.

using WebServices to read Customers Tables

c#,asp.net,webforms,dataset,asmx
I want to make WebMethod to my WebForms, beforehand this is my function [WebMethod] public DataSet GetCustomersData() { using(SqlConnection conn = new SqlConnection("MyConnString")) { try { conn.Open(); string commandstr = "select * from Customers ORDER BY CustomerID"; SqlCommand cmd = new SqlCommand(commandstr, conn); SqlDataAdapter SqlDa = new SqlDataAdapter(cmd); DataSet SqlDs...

Redirection before invoking web method of asmx web service

c#,.net,soap,asmx
I have a asmx web service hosted at US as well as Canada. But there are few Canadian clients which points to US web service and I am not able to make any changes at client side to make them point to Canadian web service. Is there any way I...

how to convert JSON array to string ..?

asp.net,json,web-services,asmx,javascriptserializer
I want to return string values from a web method function, presently it returning JSON array value as: {"statusCode":200,"result":{"totalCount":1,"resultCount":1,"items":[{"Category":"Content Types","Database":"master","DisplayName":"New...

Return DataTable schema beside data, in web service output

c#,xml,web-services,xsd,asmx
I write a web service using c# and it going to be consumed in a java application. Simply I return a Dataset that has one or more DataTable in it. Output is in XML format. Now the consumer need to have the schema of the output table to know the...

Web method works only if marked as static, otherwise doesn't [duplicate]

javascript,c#,asp.net,asmx
This question already has an answer here: Call non-static method in server-side from client-side using JavsScript 5 answers Code-behind: [ScriptMethod] [WebMethod] public string SavePassword(string password, string username, string resellerId, string isPasswordReset) { return null; // For example } javaScript: $.ajax({ type: 'POST', url: 'login.aspx/SavePassword', data: '{"password":"' + passwordInput +...

Basic authentication on a remote server

c#,asp.net,web-services,authentication,asmx
I need some help with ASMX web-services. Let's suppose I have a ServerService which provides some data. Let's suppose it has a method GetRandomInteger which returns a random integer (obviously). It implements a custom basic authentication using IHttpModule. public class BasicAuthHttpModule : IHttpModule { private UserRepository _userRepository; public void Dispose()...

Password Digest authentication in WSE3

asmx,password-encryption,wse3.0
I was able to implement the method AuthenticateToken and authenticate the user when the given password is in plain text. Is it possible to authenticate the user when the given password is hashed (Passworddigest)? If so, please shed some light. Thanks in advance....

Create Web.API Layer over existing .asmx web services?

web-services,rest,asp.net-web-api,asmx
We have a number of existing asmx web services that are used by many, if not all of our clients. These are not going to be re-written en-masse any time soon. My simple question is therefore whether it makes sense to create a new web.api layer that underneath call the...