C# - Getting Session In ASMX Web-service?
Jul 21, 2010
I have an ASMX webservice hosted alongside my ASP.NET web app. Now, I need to get the users session into the Webservice. To test this I made this simple method:
[WebMethod(EnableSession = true)]
public string checkSession()
{
return HttpContext.Current.Session["userid"].ToString();
}
So, first I login to my web app, then in the browser goto my webservice and click "checkSession" on that auto generated test page. I have tested this on 3 computers. All 3 of those work fine with the webapp(so the sessions are being created etc), and 2 of those return the value of Session["userid"] on invoking the webmethod, however the last computer returns "Object reference not set to an instance of an object" because Session is null.
So, whats the difference between these computers and why can my ASP.NET app get the sessions on all computers but the webservice cant?
View 1 Replies
Similar Messages:
Mar 29, 2011
In my ASP.net website we are going to use Silverlight to display some interactive diagrams. The users can add, edit and delete various diagrams on the silverlight front end. Silverlight will call Web Service methods to save the changes into the database. Besides the data being passed by silverlight to web service call, we also need to pass some data from the session (like logged on user id etc.) to the web service call.
My question is that how silverlight can access session data? I am trying to pass session information via a webservice method call over to Silverlight but, the session variables inside the web service methods are returning null value.
The Web Service is running under the same web root where the ASP.net website using Silverlight is also hosted. I have made EnableSession = True for web properties.
View 1 Replies
Jun 18, 2010
I have a module that subscribes to PreRequestHandlerExecute event, which uses the Session object. When i set the webconfig compilationdebug flag to false, the Session object is null when making requests to the web service. It works fine for .aspx requests, but only have problems for .asmx. When i set the debug flag to true everything works fine. I need to set this flag to false for production, but can't seem to get it work.I'm using II7 and the integrated pipeline, so this event will fire for all requests.
View 1 Replies
May 5, 2010
if i have the web application with many pages like add order page, edit order page, and delete order page actually they also interact with the Sql Server 2008 and i also create web service page call Sales_Service.asmx. i know just i need to put something like query into Web Method in Sales_Service.asmx but i have a lot of queries, i don't know which query i should put into it and how the web page call the Sales_Services.asmx
View 2 Replies
Nov 8, 2010
A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.
We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.
We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.
View 11 Replies
Mar 17, 2011
I have a .net app developed in .net 4.0 version. And I implemented an asmx web service in this. Now I want to call one of the webservice method in another classis ASP application java script function.
View 2 Replies
Mar 28, 2011
Is it possible to run a web service as a particular user/service account in the same way a Windows service can?I have a service account used for connecting to the DB and want to run the webservice under this account as the users using the webservice won't have DB access.The way I see to do it is to include the Impersonate option in the Web.config file, but is there any better way to do this?
View 1 Replies
Mar 17, 2011
How to create an instance of web service without adding web service reference? How to identify the server address/name where the web service is hosted from C# code?
View 1 Replies
May 25, 2010
My WCF Client calls my WCF Service which then calls ASMX Web Service. The problem is i have configured my wcf client and wcf service to windows credentials type but when wcf service calls asmx service the user credentials (default windowsidentity) is not passed to asmx service.
In WCF Service i am able to get user identity by using : Thread.CurrentPrincipal.Identity.Name;
WCF Service - i have disabled anonymous access and enabled windows authentication. ASMX Web Service - i have disabled anonymous access and enabled windows authentication.
WCF Service Config
[Code]....
View 1 Replies
Aug 4, 2010
i have created a normal web service and i want to host it outside IIS. one idea i got is to use window service as hosting environment. i have created a web service and hosted it window service and its window service is running now.would anybody please let me know that how can i call web service hosted in window service binded over soap.tcp. here is my sample code.
[Code]....
[Code]....
View 1 Replies
May 26, 2010
I want to develop a web service that handle another web service's event. (C#.Net 3.5 framework)
View 1 Replies
Aug 30, 2010
How to create simple web service in VS2010 Professional (trial version). There is no template to do this. I am not trying to create WCF service here.
View 2 Replies
Sep 20, 2010
I have running existing web service in framework 2.0, but i want to convert all my service to framework 3.5 WCF Service..
View 1 Replies
Feb 7, 2011
How do I add the WCF service built using VS2010 as a service reference to a Winforms app which is written in VB6?
View 1 Replies
Feb 2, 2011
I am keep getting an error that "Service Error : wbsTest failed" where wbsTest is my webservice.
The error comes up frequently enough for the user - normally reproducible within a minute or so of working with an application.
A bit of background: An user is a remote user accessing application hosted on our servers over https. He is software firewalled and his connection isn't the fastest but it is responsive enough. When errors do not present themselves, page loads are fairly quick.
View 8 Replies
May 24, 2010
I want to access simple web service inside WCF service. How can i achieve it?
View 2 Replies
Jun 17, 2010
I am writing a program to measure the latency(response round trip time) for a web service. I need to have this at client side.
My initial plan is to store the time at which request is sent and then calculate the difference in time when we recieve a response from the web service. Is this the correct way to measure latency of web service. This has some overhead because of storing time and all. How can this be done?
Another option is to attach a timestamp with the SOAP request. But the server should return the timestamp. This will not be possible in case of third party web services.
View 4 Replies
Mar 10, 2011
I was trying to go through this tutorial:
[URL]
but when I tried to add the service reference to the silverlight app, the Add Service Reference window would show me that there was a service file, but the node wouldn't expand to show the rest of the files that contain the services and what not. I got this error instead:
"An error occurred during the processing of a configuration file required to service this request. review the specific error details below and modify your configuration file appropriately."
"Parser Error Message:There is no service behavior named 'AdventureWorks_WebServer.Service1Behavior'."
"Metadata contains a reference that cannot be resolved: 'http://localhost:55579/Service1.svc'.
The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.
If the service is defined in the current solution, try building the solution and adding the service reference again."
here's my web.config file:
[Code]....
View 1 Replies
Jul 17, 2010
i want to know how to use the web services in asp.net project
View 1 Replies
Feb 11, 2011
I'm just getting started with WCF services and I want to ask you if you could tell me where a WCF service runs.As far as I have researched a WCF service works as a server-side application (under IIS).I believe it works a similar way to a servlet in Tomcat.
View 3 Replies
May 24, 2010
I want to use a web serivice but not able to use it. I think it is due to firewall. how to consume a web service if we are working behind firewall?
View 1 Replies
Apr 5, 2010
I am new to WCF, I got a requirement like I need to expose a WCF service which will be consuming by clients. The data sent by clients must be passed by the service throughTCP IP port communication (these IP address and Port will be dynamic) to the other end.
View 5 Replies
Jan 12, 2011
I need to download a file from a website to my specified folder and use in my asp.net application.The file is update everyday and i need to pull the latest file.
View 5 Replies
Dec 16, 2010
this is with ref to link http://forums.asp.net/t/383204.aspx for calling webservice in vb 6.0i tried the below method given by coopha , but i recive error as belowwsdlreader:xml parser failed at line no 75 ......reason , the element in the end tag should match the elemnt in the start taginstead of local host i have given the server Ip address along with the path configured using virtual directory in IIS & the asmx file name
View 4 Replies
Feb 22, 2011
I would like to schedule a web service. In console applications, I can run them in scheduled tasks, is there a way to do it for web services?
View 3 Replies