asmx

Using HttpClient with ASMX in C#

若如初见. 提交于 2019-12-11 14:51:58
问题 I am playing with HttpClient'. I'm wondering if it is compatible with .asmx` web services. Say I have a method such as this: var baseAddress = new Uri("Http://localhost/folder/WebServiceCommand.asmx/"); var config = new HttpSelfHostConfiguration(baseAddress); var server = new HttpSelfHostServer(config); using (var client = new HttpClient(server)) { client.BaseAddress = baseAddress; var response = client.GetAsync("GetData").Result; Assert.IsTrue( response.IsSuccessStatusCode, "Actual status

System.Web.Services.WebService - Is it possible to isolate the service per client

青春壹個敷衍的年華 提交于 2019-12-11 14:48:44
问题 I have an legacy System.Web.Services.WebService (not WCF) that I have to maintain. Ocassionly I run into some wired behaviours that I would describe as race conditions. Either the service hangs and has to be restarted. Sometimes I get this exception: System.NotSupportedException: Multiple simultaneous connections or connections with different connection strings inside the same transaction are not currently supported. at MySql.Data.MySqlClient.MySqlConnection.Open() ... I know whats the root

.NET 3.5 ASMX Web Service - Invoked via .NET 3.5 Service Reference - Common Class Reuse

佐手、 提交于 2019-12-11 13:40:30
问题 I have a .NET 3.5 web service with a single web method that looks something like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ using System; using System.Collections.Generic; using System.Web.Services; namespace Webservice1 { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class WebService1 : WebService { [WebMethod] public List<Model.Person>

Javascript ASMX web service call - Handling Exceptions

筅森魡賤 提交于 2019-12-11 13:31:26
问题 I've got a web service that returns me an array of strings. I call this service from my javascript... WebPortal.WebPortalServices.GetAllProperties(success, fail); Now this works fine, I have my success and fail functions in my javascript. There seems to be a limit, either its the file size of the array or maybe the item count in the array, but either way when I get above 2500~ strings in the returned array the call fails. I.e my fail function is called. How can I get the reason the service

Why Cannot serialize the DataTable. DataTable name is not set ?

你离开我真会死。 提交于 2019-12-11 13:23:20
问题 I am using this web service but returns error: Cannot serialize the DataTable. DataTable name is not set. [WebMethod] public DataTable ApprovalCertificate(int ID) { try { DatabaseConnection DatabaseConnection = new DatabaseConnection(Constants.Databases.BPAConnection); SqlCommand SqlCom = new SqlCommand("ReportApprovalCertificate", DatabaseConnection.OpenConnection()); SqlCom.CommandType = CommandType.StoredProcedure; SqlCom.Parameters.AddWithValue("@PropertyDetailsID", ID); DataTable dt =

Client calling multiple asmx services

主宰稳场 提交于 2019-12-11 13:19:00
问题 I have a WPF client application which calls multiple ASMX webservices I keep on getting 401 authentication errors. Sometimes for whatever reason one succeeds whereas the other one fails but then for some reason one works then the other one fails...Have no idea what the reason is. One of the service needs to do a double hop and it was working earlier during the day and for some reason now has stopped working I do not believe I changed anything. I Followed http://social.technet.microsoft.com

Calling AJAX enabled web service by POST works but with GET it always return xml

六眼飞鱼酱① 提交于 2019-12-11 13:18:14
问题 I am calling in ASP.NET 4.0 web site a web service (asmx service in same web site) method in 2 different ways. The first method succeeds and always returns a valid JSON object when the asmx web service method is decorated with [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)] . But the second method fails because the data returned is XML rather than JSON, even though I have decorated the asmx method by [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat

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

徘徊边缘 提交于 2019-12-11 12:14:44
问题 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 shows that the Host is a subdomain internal to their network (internal.domain.com). Obviously this doesn't resolve to any public IP when browsing from outside of

Does an asp.net webservice have something like application start and application variables?

点点圈 提交于 2019-12-11 11:06:35
问题 I'm developing a webservice that will, when called, notify another program via a tcp connection. My problem is where to store the open tcp connection. The way I understand web services, they start and end with each HTTP Request, with no room for application wide variables, like the open tcp connection. Please correct me if I'm wrong. Specifically, in what part of the asmx file, or outside of it, should I place the code for listening for incoming tcp traffic? 回答1: You can place the tcp

Any way of passing generic type definition to asmx webservice

你说的曾经没有我的故事 提交于 2019-12-11 10:05:00
问题 I use jQuery ajax calls to ASP.Net web services (ASMX files) to update the web page data. I have the database storing code seperate from the domain object class code (in the example code below, there is an Animal class and an AnimalRepository class). I'm implememting a convention that all similar domain object repository classes will have a Store method . I would like to create a web service that can cater for calling the Store method for any one of these repository classes. To get this to