asmx

Passing string array to webservice method

不羁的心 提交于 2019-12-24 03:56:11
问题 I have a web service with this method: [WebMethod] public int[] stringTest(string[] tString) { int numberOfStrings = tString.Length; int[] returnS = new int[numberOfStrings]; for (int i = 0; i <= numberOfStrings; i++) { returnS[i] = 1; } return returnS; } And then I'm trying to pass an array of strings to it from a client program as following: var client = new WebServiceSample.WebService1SoapClient(); string[] parameterNames = { "Windsensor","Temperature sensor"}; test = client.stringTest

How to get client IP address in a one-way ASMX Web Service

会有一股神秘感。 提交于 2019-12-24 02:48:10
问题 I have a web service that is configured as one way. Or rather, the SoapDocumentMethod attribute has a property that is called "OneWay". That is set to true. I'm trying to get the IP address of the client request. I get the fact that I won't get the exact IP address because the client may be behind other networking concepts. That's irrelevant. I want an IP address of whoever initiated the call on the service, so if that's some front end server sitting on top of some clients machine, so be it.

how to get Application_Start (in Global.asax.cs) to be called before requests in asmx web service on IIS 6.0

妖精的绣舞 提交于 2019-12-24 00:52:39
问题 in my ASMX WS Application_Start is called when 1st request arrives. It's kind of too late then for me. Is there any way to get it called when iisreset is done? In what is the right way to spawn thread for database IO in asmx web service? I asked about preloading system data and the guys advised me to make load in Application_Start. However if it's done only on 1st request, it's the same and thus the advise of no use at all. 回答1: If you have the newest, latest IIS 7.5, you might want to check

Help me understand web methods?

落花浮王杯 提交于 2019-12-23 19:36:17
问题 I have a method on a page marked with the webmethod and scriptmethod tags.. The method returns a collection of objects to a jquery function as JSON data with no hassles and without me having to manually serialize it. I am now trying to recreate that same method using a HTTPHandler and was wondering why i have to now manually serialize the data. What makes the webmethod different? 回答1: Because an HTTP handler (kind of) sits above the ASP WebForms Stack, you are totally responsible for the

ASMX Webservice, Test Form only available on local machine for one WebMethod only

亡梦爱人 提交于 2019-12-23 18:27:13
问题 I have an ASMX WebService that I am testing, and on most of the methods I am able to use the test form just fine for testing. I do however have one method for which the test form says: The test form is only available for requests from the local machine. This method is declared exactly the same way the other methods, but it does have a noticeably longer parameter list (most of these methods only have 2 or 3 params): [WebMethod] public ActionSuccessResponse makeDestinationRequest(String ownerID

Why do asmx web services have a markup file?

对着背影说爱祢 提交于 2019-12-23 17:38:15
问题 I have seen many places in ASP.Net where web services are implemented with an asmx file. The mark-up is nearly always empty (apart a basic web service tag) and all the code is the "code behind". Is this mark-up file legacy from an older way of doing things or does it serve some other purpose? 回答1: Actually, the .asmx file is not a markup file, but a file containing markup. It is perfectly legal to have the full web service implementation inside the .asmx file. To use a code behind file is

How to call https asmx web service if certificate has expired in .NET

和自甴很熟 提交于 2019-12-23 12:06:46
问题 Asmx web service is called using Visual Studio generated code from MVC2 controller using code below. Method call throws exception since web service certificate has expired. How to fix this so that web service can still used? Using .NET 3.5 and MVC2. public class AsmxController : Controller { public ActionResult Index() { var cl = new store2.CommerceSoapClient(); // System.ServiceModel.Security.SecurityNegotiationException was unhandled by user code //Message=Could not establish trust

ASMX Web Service - “This web service is using http://tempuri.org/ as its default namespace.” message - but it shouldn't be

帅比萌擦擦* 提交于 2019-12-23 09:04:22
问题 I've created a web service using Visual Studio ( 2005 - I know I'm old school ) and it all compiles fine but when it opens I get warned thus: This web service does not conform to WS-I Basic Profile v1.1. And furthermore: This web service is using http://tempuri.org/ as its default namespace. Which would be fine except my service begins thus: [WebService(Namespace = "http://totally-not-default-uri.com/servicename")] Searching the entire solution folder for "tempuri" returns nothing. I can't

wsdl : Generate Proxy for the WebMethods but not the other dependent classes

那年仲夏 提交于 2019-12-23 05:06:03
问题 Say, I have a WebService SettingsWebService with a WebMethod AddUser(User userObject). The User class is in the SettingsWebService solution. When i generate a proxy for the SettingsWebService it creates a class for asmx which contains the AddUser webmethod. It also generates a class for the User class. The client now uses Proxy.AddUser(Proxy.User user) interface. Is there any way to tell wsdl to not generate a class for the User class, so that the signature remains : Proxy.AddUser

Calling ASMX web service from PHP when Operations accept an Interface

杀马特。学长 韩版系。学妹 提交于 2019-12-23 04:49:15
问题 I have a .Net web service that has a method that accepts an Interface that I have written as a parameter. Let's call this interface ICustomer. How would you call this method from PHP? The method definition is [WebMethod] public string RegisterCustomer(ICustomer customer) { ... } 回答1: you can create a StdClass on PHP with same attributes that in .NET. ex: <?php $object = new stdClass(); $object->Name = "Test"; $object->LastName = "More tests"; $object->AnotherAttribute = "Abc"; ... $client =