VS 2008 - Getting User Id In A Web Service?

Jan 31, 2011

I have a webservice.

I would like to get the log on user id.

I am using the following code.

During runtime, it gives error saying "Request is not available in this context".
HttpApplication context = new HttpApplication();
string username = context.Request.ServerVariables["LOGON_USER"];

How do I get LOGON_USER in a webservice.

View 1 Replies


Similar Messages:

WCF / ASMX :: Running A Web Service User Service / Domain Account?

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

Unable To Pass User Credentials From WCF Web Service To ASMX Web Service

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

User Identity Name Showing Windows User Instead Of Network Service?

Jun 28, 2011

In the IIS, it shows that the web app (i'm using) is using an application pool that uses NETWORK SERVICE account for identity. But when I debug/run my web app, User.Identity.Name shows that my windows user login instead. I checked my web.config file, and it does not have Impersonate enabled. In fact, I set it to false, and it still shows the same.

View 1 Replies

VS 2008 Send XML To A Web Service?

Feb 24, 2011

That is what I have to do: Send XML to a web service. I have preliminary requirements of what I have to generate in the XML. So, I just create this big, long XML stream and send it to the service? I would like to read a little bit about this to educate myself. Do you have a good link, or can you voice your opinion of this one,Additionally, I am coding in VB.NET so I will have to convert that code if it is a good example.

View 15 Replies

VS 2008 - Log Web Service Calls

Nov 12, 2011

I've got a web app running with purely web services like these:

Code:
<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False)> _
Public Function EditService(ByVal toddtype As String _
, ByVal fromddtype As String _

[Code] ....

And I want to log each web service call. I don't want to bother my database with this log - I would prefer to have the web app log to a text file on the web server itself.

How would I open and access a log file like this from a bunch of web services? Does web app still have application startup like events???

View 1 Replies

VS 2008 When Admin Register New User The Site Logs In As The User Who Was Just Created

Mar 4, 2010

This is what I have in the RegisterUser.aspx and yet when the admin registers a new user, then on clickiing the register button, the site logs in as the user who was just created.

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
Roles.AddUserToRole((sender as CreateUserWizard).UserName, "Department");
}

View 4 Replies

User Controls :: Microsoft SQL Server 2008 R2 Error 18456 - Login Failed For User Sa

Nov 21, 2012

Microsoft sql server error 18456 in sql server 2008 r2login failed for user   sasql server was working properlyi just restarted the system and then i started getting the above errorhow do i resolve iti am able to login with windows authentication but not sql authentication....

View 1 Replies

VS 2008 Web Service Assure Delivery

Jan 6, 2011

I have two web services on two different servers communicating

WS1.asmx
Code:
<%@ WebService Language="VB" Class="WS1" %>
Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Xml.Serialization
Imports System.Net
Imports System.IO
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="[URL]_
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class WS1
Inherits System.Web.Services.WebService
Dim IP as String = "192.168.0.174"
<WebMethod()> _
Public Function Function1(ByVal s1 As String) As String
Dim ReturnString As String = ""
Try.........................

View 11 Replies

VS 2008 Global Variable In Web Service?

Jan 16, 2010

I am having some trouble with my web service. I want to make a variable that will be the same for each thread running. To be specific, my program is that user 1 goes on my page and types something into the textbox and that user 2 can see what user 1 is typing into the box. its sorta like google wave. The problem is that when i run it, the variable's value does not go to user 2 and instead another instance of that variable is created.

View 18 Replies

VS 2008 Silerlight 3/ Web Service Printing?

Mar 5, 2011

Is it possible to have a web service print to a network printer that is not attached to the server running IIS. This is for an enterprise application run on an intranet site. I've used impersonation and adjusted the settings on the Web Service but I still get an error message.

Settings to access printer "printer name" are not valid.All solutions i've googled have not worked. Also, I'm attempting to print to both laser / label printers.

View 3 Replies

VS 2008 Calling Rest Web Service?

Aug 27, 2010

I am trying to interface a website we have with our helpdesk software. The helpdesk software has a REST API that i can connect to. So far I have been successful in getting a current ticket with the following code.

[Code]....

[URL] How would I implement this in ASP.Net? I want to create the ticket, and need to be able to retrieve the access key that it returns. I tried using the same code above, but instead changing the method string to this.

Code:

method = "request.create&tNote=Testing method&sFirstName=Jose"
But I get a "Bad Request" error from it.

View 3 Replies

VS 2008 Web Service Or Own Desktop Application?

Sep 27, 2010

I am developing one Intranet Que type project for a small Travel agency. I need one logic to route the customer que over all sales agent so anyone once free he will be buzzup to pickup the customer till here is Okay. But i need some timeout if no sales agent pickup the Que it will forward to the supervisor. Now here is my Question should i make a small desktop application and run in server to moinitor the time and forward the task.... or Is Web Service is suitable for this? (Forward means just it will update one field of table so it will start displaying in Supervisor screen.)

View 1 Replies

Debug Web Service 2008 From 2005?

Sep 1, 2010

I have two applicaitons. One is web service written in VS2008 and the other one is Windows CE 5.0 application written in VS2005.

This CE application will use web service to talk to the database. After I build and compile the web service successfully, I publish one copy to my localhost and this CE application point to my localhost and consume the web service.

I'm finding a way to debug the web service. I want to step into web service every time CE application make a connection with web service (like we put a breakpoint in windows application go step by step)

However, When I run the web service, it starts with some virtual port. And so my Ce application call didn't come to this running Web service (run by VS2008).

View 2 Replies

VS 2008 - Windows Authentication On Web Service

Jul 19, 2011

I have a web service within my application (app A) writing to an oracle database (database resides on a different server). when i call the web service from another application (app B), it fails to write to the database. when the web service is called from app A, it successfully writes to the database.

I guess this issue has to do with authentication/impersonation of ASP.NET. both applications (A & B ) are subsites within the same website in IIS and both uses windows authentication (intranet applications). I dont have access to the server and IIS.

View 5 Replies

Connecting To SQL Server Express 2008 Using Web Service?

Dec 1, 2010

I am trying to retrieve some values from a Database built in SQL Server Express 2008 using .net Web Service.

[Code]...

Whenever i click run in Visual Studio 2008, it shows the startup page in IE that has two Methods (HelloWorld and authorizePassenger). When i click my method authorizePassenger it gets invoked and it asks me for input but when i input and click invoke IE shows HTTP500 error. The code above working fine in Standalone VB.net Application, so i guess i m doing the coding of Database correctly.

View 6 Replies

Enabling Service Broker In SQL Server 2008?

May 3, 2010

I am integrating SqlCacheDependency to use in my LinqToSQL datacontext.I am using an extension class for Linq querys found here - http://code.msdn.microsoft.com/linqtosqlcacheI have wired up the code and when I open the page I get this exception - "The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported. Please enable the Service Broker for this database if you wish to use notifications."its coming from this event in the global.asax

protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
//In Application Start Event
System.Data.SqlClient.SqlDependency.Start(new dataContextDataContext().Connection.ConnectionString);
}

my question is...how do i enable Service Broker in my SQL server 2008 database? I have tried to run this query.. ALTER DATABASE tablename SET ENABLE_BROKER but it never ends and runs for ever, I have to manually stop it.once I have this set in SQL server 2008, will it filter down to my DataContext, or do I need to configure something there too ?

View 2 Replies

WCF / ASMX :: VS 2008 - Consuming A Web Service As A Business Object

Jun 30, 2010

I'm fairly new to .NET development so I might be missing something very simple here. I'm trying to set up a web service as a data item so that I can bind it to a control on my page. I was reading some tutorials about doing this in an earlier version which seemed very simple. All you had to do was add the web reference, create a data source and use the object type, pick the web service and enter the name of the call that would retrieve the data.

In 2008 the object data source type doesn't seem to be available anymore when creating a new item unde app_data. I get options for SQL Server, XML and XML schema. I've tried adding an existing source and picking each of the files generated for my web service reference, with no success. I suspect that I have to use one of the XML options, though at this point my web service is a simple thing that only returns some strings for prototyping purposes (I'm not the one writing the web service, just the front ends. Our other developer hasn't come up with a stub service yet). I know there must be some way to set a web service up as a business object so that you can bind it to a control like a gridview.

View 2 Replies

VS 2008 Web Service To Trigger Background Time Events On Server

Apr 5, 2010

I have an application where I want to send an email reminder for an appointment 24 hours prior to the event. Users would log in and insert appointments. I would think I would want a background thread running on the server that would regularly check the database (say every hour) and generate an email if there is an event is due within the next day. From what I have read it seems like a Web service might do this. I guess I have a few questions

1) am I on the right track - is this an application for web services
2) can anyone point me to a good resource which can help me create the web service I would need. I would prefer if it is in VB and not C#.

View 11 Replies

How To Create A Web Service In VS 2008 And Can't Get The Wsdl And Disco Files Created

Aug 18, 2010

How do I create wsdl and disco files for a web service using visual studio 2008? I can create the service and run it through VS but when I try to create the files nothing happens. I also need this service to run in sharepoint 2007 as well as outside sharepoint.

View 1 Replies

WCF / ASMX :: Cannot Consume Data Service From Visual Studio 2008?

Oct 25, 2010

I created two similar oData services:

1. ADO.NET Data Service with Visual Studio 2008 and the .NET 3.5 SP

2. WCF Data Service using Visual Studio 2010 and they both work in IE.

I can make a Service Reference to the first one with VS2008.

The problem is when I try to use Visual Studio 2008 as a client and I try to add a Service Reference for the WCF Data Service made with Visual Studio 2010:

an Error (Details) occurred while attempting to find services at '

and the Detail is:
DS_InvalidMetadataFile
Parameter name: edmxDocument

the xml of the 2 services is perfectly the same (with the exception of the url in the "base" attribute in the service node)

View 1 Replies

Error - Module Not Found Exception From 2.0 Web Service On Windows Server 2008 R2

Sep 14, 2010

We have an issue with a .NET 2.0 web service application that is generating a module not found exception when we try to load on server 2008. A second server running the same 2008 version loads the service fine.As part of the investigation we have taken the default hello world .NET 2.0 web service and deployed to both servers and have exactly the same issue with it running fine on one but not the other. The issue is trying to track down the module in question. Running process explorer and dependency walker doesn't seem to give us a clue.

The full error is:-

[code].....

View 1 Replies

WCF / ASMX :: Read/write Registry In Windows Server 2008 Using Web Service?

Dec 9, 2010

I create web service for Reading and writing the registry. It works fine in win-xp. But its not working when I published it in win-2008 server. It shows me http 500 error.

My Code is:

set Reg:
string key = @"SOFTWAREWow6432NodeMyCompanyMyProjectSettings";
string valuename = "Allow";
setRegistryValue(key, valuename, Value);
Get Reg:
string key = @"SOFTWAREWow6432NodeMyCompanyMyProjectSettings";
string valuename = "Allow";
return Convert.ToInt32(getRegistryValue(key, valuename));

View 2 Replies

DataSource Controls :: How To Restore Sql Server 2008 Analysis Service Database Programatically Using C#

May 4, 2010

In our project we need to restore the analysis service database back up(.abf) files.Now i can connect to analysis service and can create new database.May i know how i can restore the abf file .i saw i can do this by using sql server SMO dll .check the below link

[URl]

how to get the samples are located in <system_drive>:Program FilesMicrosoft SQL Server100Samples folder,if you alrady installed the documentation

View 1 Replies

WCF / ASMX :: How To Access A Wcf Service Hosted On A Server Running On A Virtual Machine On A Windows 2008 R2 Hyperv

Jul 14, 2010

I am trying to access a wcf service hosted on a server running on a virtual machine on a windows 2008 R2 hyperv. When i access this service when running my asp.net website through code everything works fine how ever when i deploy the application on the local IIS , in the deployed mode i am getting an securityaccessdeined exception. My Asp.net app is running on a IIS server on another virtual machine. The stack trace is as given below :

Environment Info: My asp.net app has built on .NET 4.0 framework using VS2010. My WCF services are based on .NET2.0 framework.
Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 14-07-2010 13:56:54

Event time (UTC): 14-07-2010 08:26:54

Event ID: dd1986e7e7dc4473beb908754c75a580

Event sequence: 4

Event occurrence: 1

Event detail code: 0

Application information:

Application domain: /LM/W3SVC/1/ROOT/StratosTest-1-129235696025728041

Trust level: Full

Application Virtual Path: /StratosTest

Application Path: C:inetpubwwwrootStratosTest

Machine name: MC-NEWCODE

Process information:

Process ID: 1752

Process name: w3wp.exe

Account name: IIS APPPOOLASP.NET v4.0 Classic

Exception information:

Exception type: SecurityAccessDeniedException

Exception message: Access is denied.

Server stack trace:

at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)

at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:

at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

at VMMService.IVirtualMachineManagementService.GetAllVirtualMachines()

at Default2.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Request information:

Request URL: http://localhost/StratosTest/Dashboard.aspx

Request path: /StratosTest/Dashboard.aspx

User host address: ::1

User:

Is authenticated: False

Authentication Type:

Thread account name: IIS APPPOOLASP.NET v4.0 Classic

Thread information:

Thread ID: 4

Thread account name: IIS APPPOOLASP.NET v4.0 Classic

Is impersonating: False

Stack trace: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

at VMMService.IVirtualMachineManagementService.GetAllVirtualMachines()

at Default2.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Custom event details:

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved