.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Web Service credentials after 'Sign in as different user'

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :SharePoint

I am connecting to exchange using the exchange web service from within Sharepoint Server enterprise edition (2010) code running in an application page





service.Url = 


service.Credentials = System.Net.

View Complete Post

More Related Resource Links

Extracting user credentials from a service implementation


I am trying to extract the login name from a web service that was authenticated using a custom username validator. It validates ok, but I am unable to extract this info within the service implementation.

So far, I have tried the following:

- return WebOperationContext.Current.IncomingRequest.Headers[HttpRequestHeader.Authorization];
- return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name;
- return ServiceSecurityContext.Current.WindowsIdentity.Name;
- return Thread.CurrentPrincipal.Identity.Name;

The first works fine if the service is using REST, but returns an empty string with SOAP, so I am thinking the authorization credentials are in the SOAP body rather than the HTTP header in that instance.  (The WCF service supports both REST and SOAP, so I will need a solution that will work with either).

The latter three attempts throw a null reference exception.


Enter your credentials to connect to the web service


When trying to publish an InfoPath 2007 form template (as a Content Type), I am getting the following message with a UserName/Password dialog box:
Enter your credentials to connect to the following web service: http://MySitePath/_vti_bin/Webs.asmx

When I enter my credentials, the above dialog box appears again. I have carefully entered my credential. Another thing I noticed that despite this error I see the form got created at the destination library. The only thing is that the Content Type did not get created and hence is not available in the "Site Content Type Gallery".

We are using Sharepoint 2007 enterprise edition. And I have recently published the InfoPath form templates several time as Content type without any issue.


Please help. Thanks........

WCF Service stops after throwing a unhandled exception :no user is logged on.

Hi All,       I have written a WCF service which is hosted as a Managed windows service. I consume this service in a web application. The service is built using a httpBasicBinding and security Mode ="none". I'm now getting the following exception, after which the service stops  "An unhandled exception ('System.ComponentModel.Win32Exception') occurred in CMMonitorService.exe [1812]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on." I had tried changing the security mode to Transport/Message. with windows credential then I get a access to the path denied error. Can anyone provide hint on what am I missing and what would be the appropriate security mode and client credential to use along with basichttpBinding?

Profile User Synchronisation Service

Hi, I have a problem to open Profile User Synchronisation. It doesn' work, I tried to verify this problem by opening services.msc but It show an error when I try to restart the service : Error 1068 The service or the groupe of dependency can't be restarted.   Thanks

User Profile Service account Write to AD Permissions

I followed this guide here (http://www.harbar.net/articles/sp2010ups.aspx) to provision the UPS service in sharepoint 2010. I found the guide very helpful and informative. Everything is working correctly except for the write back to AD I've followed the steps and have assigned the listed permissions to the UPS service account, however I still get permissiong errors in the FIM GUI Our AD is running in a 2008 environment but is in 2003 mode, so I made sure to add the UPS account to Pre Windows 2000 Compatible access built in group and restart the server so that the new group settings would take affect. Do I need to reprovision the UPS service or something? Or am I missing something completely. (Hopefully the latter lol!) Thanks RKB

User Profiles Service Application and Import of SharePoint 2007 SSP data

I have setup a test SharePoint 2010 Farm. I will be using this as a test upgrade of a current live SharePoint 2007 Farm. The database attach method will be used. I have replicated the web application and AAM settings of the SharePoint 2007 Farm to the SharePoint 2010 Farm and have made the 2010 Farm a DC in a new Forest. I don't want to join this to the current domain at the moment. It also has SQL server 2005 with SP3 and cumulative update 3 installed. I have just setup the User Profiles Serice Application and when I go to Manage it, I get this. Error An unexpected error has occurred.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: a1760e87-372f-4711-afac-3ceba34bc599 Date and Time: 8/31/2010 4:22:56 PM I have verified and configured the following. Created the Managed Metadata Service. The status is started via Service Applications and Services on Server. Created the User Profiles Service Application and ensured status is started via Service Applications. I started the User Profile Service and User Profile Synchronisation Service via Manage Services on Server.      

Unable to start user profile synchronization service

Hello, I have the following problem. user profile synchronization service doesn't start up, with the following error in log: The service encryption keys could not be found. User Action Verify that the service account has permissions to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Forefront Identity Manager\2010\Synchronization Service If the problem persists, run setup and restore the encryption keys from backup. Permissions for registry are availabele. Thank you.    

User Profile Service - "The specified user or domain group was not found"

Hi there, I had configured the User Profile Service and all was working well (Syncing with AD etc.). However, something has gone wrong. The services still appear to be running; both Forefront Identity Manager services are running, and the services show as 'Started' in Central Administration. The 'My Profile' and 'My Site' options have disappeared though, and browsing to the My Sites page results in an error (Could not load user profile). To make matters much worse, it seems to have also broken the Central Administration site. If I try and go to 'Manage Service Applications' I get another error (The specified user or domain group was not found). This error seems to come up on around half of the pages on the Central Administration site. Looking up the error (abb6b174-0f71-413a-a27a-41cdc87b66d0) in the logs I find this: 09/06/2010 15:35:45.44  w3wp.exe (0x0868)                        0x06A0 SharePoint Portal Server       User Profiles                  cm6y High     User Profile Application Proxy failed to retrieve partitions from User Profile Application: Microsoft.Office.Server.UserProfiles.UserProfileA

Get Service status(Services.msc) from different servers with credentials

Hi, In my application I need to get Service status from differnt servers.I used System.ServiceProcess class for implementation.Now,I got service status from my local machine. My current requirement is to get service status from different servers with credentials. Consider I host this webapplication in One server A. I need to get service status of Server B,Server C. We can't install or copy any dll or exe in that server(Server B & Server C)<Webservices also we can't host in Server A &Server B >.But, we have credentials.I tried to pass credentials.But getting errors<authentication problems>. Please help me to do the same. Have any other solutions by dos net sat commands.. It's urgent.Thanks in advance

Unable to start SQL Express 2005 service as a network user

I am trying to start ms sql server 2005 express as a network user from originally starting as local system. I cannot start the service.I have given this network user administrator access to sql express from the sql server surface area configuration "Add New Administrator". I have went into the local users/groups and added this network user to the 3 security groups SQLServer2005MSSQLServerADHelperUser$SQL1SQLServer2005MSSQLUser$SQL1$SQLEXPRESSSQLServer2005MSSQLBrowserUser$SQL1I receive one alert int he event logs/applicationEventID: 26010The server could not load the certificate it needs to initiate an SSL connection. It returned the following error: 0x8009030d. Check certificates to make sure they are valid.I receive five errors in the event logs/applicationEventID: 26014Unable to load user specified certificate. The server will not accept a connection. You should verify that the certificate is correctly installed. See "Configuring Certificate for Use by SSL" in Books Online.EventID: 17182TDSSNIClient initialization failed with error 0x80092004, status code 0x80EventID: 17182TDSSNIClient initialization failed with error 0x80092004, status code 0x1EventID: 17826Could not start the network library because of an internal error in the network library. To determine the cause, review the errors immediately prceding this one in the error log.EventID: 17120SQL Serve

Web Service Render and User!Language...

Hi Using SSRS 2008/integrated mode I'm using a web service to get the list of parameters and their valid values and another one to Render the reports. In both the User!Language that is passed is "en" while I would like to pass "fr" to be able to get the french labels and values for my parameters and for my reports to be rendered in french. The web services are called from a Windows Form... Any ideas how I could pass the correct language to the web services ? Thanks ! Paul

SharePoint 2007 - Survey list - Getting user's Windows account ID from a web service using display

Surveys...grrrr.   I am developing a .NET console application that accesses survey data from a single survey list using the MOSS web service "Lists".   I am able to enumerate the survey list and get to the items except for the author of the survey response.  When I get to the column ows_Author, it appears to be a lookup value formatted like this:  "1066;#JOHN DOE".   How can I, using web services alone, lookup the corresponding Windows login ID of that user?  If I go to the survey in SharePoint and click on the name in the view, it takes me to a site-based user profile page that does show the account ID I want.  The page that displays appears to be a virtualized page like this "_layouts/userdisp.aspx?ID=1066".   What I really need is JOHN DOE's account ID like "domain\id". Can I get to this with the data I have available? Thanks

How Configure Sharepoint Single Sign-On for External Domain User?

Hi, Good Day All, How to configure MOSS 2007 single sign-on For External Domain User, these external domain users are in the members of internal domain but when they access portal out side the domain then portal ask his credential. Is there any way to provide/Configure Sign Sign-On facility for External Users. Thanks, Iftikhar Hashmi

User Profile Service Synchronization Connection: Client Timout

Hi, I have scenario on configuring User Profile Synchronization service on customer site as below. Window AD Server 2003 Domain NetBIOS: foo FDQN: foo.bar.com  User Account to connect: foo\ad-connect This account already set permission as describe in http://technet.microsoft.com/en-us/library/ee721049.aspx  when I try to create connection, system took long time to process then return error as "Client Timeout". I try to check FIM and it's seems to work fine (no error return and can get users data). So could anyone told me what's wrong? Since I've didn't have much knowledge on Network and AD, please advice.Theeraphat.P SharePoint Information Worker

how to store credentials with windows authentication in reporting service for subscription

when I try to set up a subscription, I get this error message: "Subscriptions cannot be created because the credentials used to run the report are not stored or if a linked report, the link is no longer valid" I use a datasource which use windows credentials to access a database which contains stored procedure with OpenRowset query to access cube data in analysis service on the same server.  I have to use windows credentials to access cube data in analysis service.  How can I store the credentails with windows credentials? I appreciate your help!

PassThrough authentication fails: Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

I've tried it with every AuthenticationMode! But no one seems to work correctly in my case. I thought that PassThrough should work with a preset User ID and password. This would be enough for the moment, but even this doesn't work!! With WindowsCredentials I get the following error: The Property with name 'SsoApplicationId' is missing on the LobSystemInstance. SsoApplicationId I tried to set this with the SharePoint SSO but I've no such services. How can I set this just for the current WindowsCredentials (of the current Sharepoint user)? With RevertToSelf I get the following error: "An error occurred while retrieving data from MyLOBInstance. Administrators, see the server log for more information." The server log contained no useful information for me. With PassTrough I get the following error: "Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <local machine>]" Why are the lines <Property Name="RdbConnection User ID" Type="System.String">MyDomain\Administrator</Property><Property Name="RdbConnection Password" Type="System.String">mYpAssWoRd</Property> being ignored? Everything (MOSS, SQLServer,...) is on a single machine, so I don't need to activate Kerberos, do I? <LobSystemInstance Name="SEPInstance1207">   <Properties>    <Property Name="DatabaseAccessProvider" Type="Micros

User Profile Service lookup in dataview web part

I'm attempting to setup a web part in SharePoint Designer 2007 that will list team members that are currently on call.  I've created the data connection to our oncall database and a dataview web part that has two columns.  One column lists the users ID, and the other lists their oncall priority.  This part works great! Example: USERID  |   PRIORITY ID1234   |       1 ID5678   |       2 Now, what i would like to see instead is the user's name instead of their ID. Example: USERNAME  |   PRIORITY John, D       |       1        Jane, B       |       2 I thought originally i could pull this information from AD using the user profile service from here:  http://<servername>/_vti_bin/userprofileservice.asmx?wsdl I've created the data connection to the user profile service, but at this point, i'm unsure how to merge the two data connection columns and get the right user data to display. Any tips?  Has anyone done this before?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend