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

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

Secured web with unauthenticated users accessing a service

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

hi all,

I have a following configuration:

~/ui/login.aspx, ~/ui/page1.aspx, ~/service/main.asmx

access to web is secured using:

<authentication mode="Forms">
  <forms loginUrl="~/ui/login.aspx" timeout="10" />
<deny users="?" />

but I want to allow unauthenticated users to issue (possibly limited set of) a query to the service (e.g. to display service version on the login page using service call ~/service/main.asmx/GetFullVersion). I'm able to do it locally, but on the server there is a problem and the service cannot be queried. I tried to set

  <location path="~/service/main.asmx/GetFullVersion">
<allow users="*"/>


  <location path="~/service/main.asmx">
<allow users="*"/>


  <location path="

View Complete Post

More Related Resource Links

Accessing a WCF Service Application from a web application

Hi,I have a VS2K8 solution with a web app and a WCF Service App. In my web app I've added the service reference and can get to the service in the service app from code behind:WebTest.ServiceReference1.Service1Client prox = new       WebTest.ServiceReference1.Service1Client("WSHttpBinding_IService1");            fromStandAlone.InnerHtml = prox.GetData(9);            prox.Close();Can someone post a walkthrough on how to add an AJAX Enabled WCF service to the service app and how to access it from the web app?

Accessing a published web service gives null ref exception. Won't occur in test though?

I have an Asp.net web service that I created using Visual Studio 2005. I can acess the web service in my testenvironment, call methods and return data as expected. If this web service is published to the outside world (Outside of the company firewall), it will return a null reference exception. Does anyone have any idea why this might be happening? The same code is being used,against thesame database. The only difference is that the published website is giving back the null reference exception. If I type in the URL for the web service "https://secure.theSiteGeist.com/wsIndigo.asmx" a list of methods forthe web service is displayed in my browser. Yet if I try and call any methods on the web service I getback the null reference exception. Note that the URL I posted above is not the real name of my web service, but isjust used for reference sake.

Accessing Logged In Users Details from MasterPage

Hi I have designed a navigation structure that is customisable from within my application and linked to the users role. So I can restrict what menu items a user gets based on their role. I have managed to do this quite well using SQL Tables and an ASP.Net Menu. I can get it to only show the menuitems that are marked active and I have created an Stored procedure to get the menu items for a particular role. Where I am struggling is getting the Logged On Users Roleid to pass it to the Stored Procedure. I can get it using a regular aspx page but my menu is on my masterpage and I do not want to have to code it in each and every page. I even tried to do it with a user-control but same happens.  It seems that the User class is just not available when in a masterpage. Anyone know how I can pass the roleid from a Class or something or from the page to the masterpage? Please Help.   Ronnie 

Users being prompted continuously for UN/PW when accessing SharePoint Intranet Site


From time to time, we have internal users who are continuously prompted to re-enter their network username and password when accessing any content or data on the SharePoint company intranet.  We use Acitve Directory authentication. Is this a network issue or something with SP? (We're using SP2007)

Some users cannot view reports from Reporting Service


I can view all my reports but the poblem is when I try to view then from another account then I get the following errors:

An error occurred during client rendering.
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'CapaInstaller'. (rsErrorOpeningConnection)
For more information about this error navigate to the report server on the local server machine, or enable remote errors

can anyone tell me what is wrong?

Some users cannot view reports from Reporting Service


I can view all my reports but the poblem is when I try to view then from another account then I get the following errors:

An error occurred during client rendering.
An error has occurred during report processing. (rsProcessingAborted)
Cannot create a connection to data source 'CapaInstaller'. (rsErrorOpeningConnection)
For more information about this error navigate to the report server on the local server machine, or enable remote errors

can anyone tell me what is wrong?

Adding multiple users to a document library column by web service


I'm attempting to create some VB code to call a SharePoint Web Service to add a document and associated metadata to a document library. I can successfully add metadata to a text column but I'm having some problems getting multiple entries into a column which is specified to take multiple users (and does so when they are added manually) although I can get a single user in using the following snippet.

Dim info2 As MySharePoint.FieldInformation = New MySharePoint.FieldInformation()
info2.DisplayName = "Authors"
info2.InternalName = "Authors"
info2.Type = MySharePoint.FieldType.User
info2.Value = "1"

I'm hoping that someone will be able to advise me of the approach or syntax necessary to add multiple users to this Authors column e.g. Users 1 and 74. I note that

info2.Value = "1,74" or info2.Value = "1;74"

don't appear to work.

Error while accessing a WCF REST service from iphone


Hi All, I have a WCF Rest service which gets a image file as a byte array[]. It works fine if the client is .net. if the client is iphone[objective c] it says the following error. The incoming message has an unexpected message format 'Raw'. The expected message formats for the operation are 'Xml', 'Json'. This can be because a WebContentTypeMapper has not been configured on the binding. See the documentation of WebContentTypeMapper for more details. The service has been hosted secure site in iis.Please help me to resolve the issue. my method is

public string ImageData(byte[] imgfile) {

 long ll = imgfile.Length; byte[] dBytes = imgfile;

 Stream imgStream = new MemoryStream(dBytes, 0, dBytes.Length);

Bitmap bmpImage = new Bitmap(imgStream);

 bmpImage.Save(@"C:\1.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); return true; }

Error while accessing Web service



We have developed one webservice and it is deployed in our virtual directory. It is working fine.

But the problem is in otherhand. While they are accessing our Database through the web service this error is coming..


soap fault: Server was unable to process request. ---> Object reference not set to an instance of an object

Error in web service codes when accessing a list


Hi all

I've been getting error when i programatically try to access a list. below is my code from a web service:

public IDEASBase(SPWeb web)
      this._spWebPassedByParameter = true;
      this._web = web;
      SPList list = this._web.Lists[this._listName.ToString()];
      this._item = list.Items.Add();

According to the stack trace, the error occurs at SPList list = this._web.Lists[this._listName.ToString()];

Stack trace:

System.Threading.ThreadAbortException: Thread was being aborted.
  at System.Threading.Thread.AbortInternal()
  at System.Threading.Thread.Abort(Object stateInfo)
  at System.Web.HttpResponse.End()
  at Microsoft.SharePoint.Utilities.SPUtilityInternal.SendResponse(HttpResponse response, Int32 code, String strBody)
  at Microsoft.SharePoint.Utilities.SPUtilityInternal.Send401(HttpResponse response)
  at Microsoft.SharePoint.Utilities.SPUtility.HandleAccessDenied(Exception ex)
  at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex)
  at Microsoft.SharePoint.Library.SPRequest.GetListsWithCallback(String bstrUrl, Guid foreignWebId, String bstrListInternalName, Int32 dwBaseType, Int32 dwBaseTypeAlt, Int32 dwServerTemplate, UInt32 dwGetListFlags, UInt32 dwListFilterFlags, Boolean bPrefetchMetaData, Boolean bSecurityTrimmed, Boolean bG

Accessing Multiple methods from a web service using web service task



When i am using an SSIS web service task, is it possible to get all the methods information to different tables.


Else if the above case is not possible, can i use multiple web service tasks with same http connection(.wsdl file) to access the web service for each method and then load the info to a table.(if i can do this, is there any performance issue)



Problems accessing web service without www


I have a Asp.net web service running on www.domain.com/Service.svc that I connect to using jQuery from my asp.net website. Everything works perfect if the user access my website with www.domain.com. But if the user uses only domain.com (without www) I get error:

There was no channel actively listening at 'http://domain.com/Service.svc/get?date=2010-10-09'. 
This is often caused by an incorrect address URI. Ensure that the address to which          
the message
is sent matches an address on which a service is listening.

In my web.config I use the serviceHostingEnvironment tag to get the service running on my webhost (it doesn't work otherwise). Maybe this is what causes the error? How can I make it possible for my users to access my webservice also when using only domain.com?

Here is my system.serviceModel in web.config (I had some problems setting up the web service so that's why my web.config might be a bit messy:


Search in SharePoint 2010 does not show results for all users other than the timer service account


I have setup a new SharePoint 2010 setup. Created Search Service application and configured. Confirmed that the crawl went fine without any error for both Local site and a file share. In the Search application i confirmed that the All Site scope shows 3890 items.

ISSUE: If any of the user [including site collection administrator] browses the site and try to search something it does NOT show result [No error either it says We did not find any results for .....]. All Site scopes does not show 3890 items but only 28.

But if the timer service account [system account] logs in the site and does the search it works fine.With this account loggd in if i check the All Site scopes i do see 3890 items.

This does seems to be some thing to do with the permission, but i am not able to get hint where the mistake is.

I have done the follow till now.

> I checked the application association is correct
> Created a new web application and confirmed that the issue exists there as well
> Checked ULS log but dont see any error related to this.
> No relavent event id in Application event viewer

Please help

Regards Ram

Http 404 Not Found on Accessing lists.asmx web service with GetListAndView


Hi All,

I have the following code

    test.site.com.Authentication auth = new test.site.com.Authentication();
    auth.Credentials = new System.Net.NetworkCredential("username", "pwd", "domain");
    tabtest.thealternativeboard.com.Lists b = new tabtest.thealternativeboard.com.Lists();

    b.Url = "http://server1:port/" + subsiteUrl + "/_vti_bin/Lists.asmx";
    b.Credentials = new System.Net.NetworkCredential("username", "pwd", "domain");

      System.Xml.XmlNode ndListView = b.GetListAndView("All Events", ""); <--fails with 404 here-->

      string strListID = ndListView.ChildNodes[0].Attributes["Name"

Error while accessing web service


I have tested the example showed on MSDN for accessing a SharePoint List Web Service in http://msdn.microsoft.com/en-us/library/ms772599(v=office.12).aspx

Build is OK. However, I get the following error while running try block.

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.

Any ideas?

Service with both secured and unsecured endpoints?



I have a service that looks like this :

			<service behaviorConfiguration="AppClientService.CustomValidator_Behavior" name="App.ServiceImplementation.AppClientService">
    <endpoint binding="netTcpBinding" bindingConfiguration="netTcpRegular" behaviorConfiguration="AppClientService.AppClientService_Behavior" address="Regular" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" />
				<endpoint binding="netTcpBinding" bindingConfiguration="netTcpUserNameMessageSecurity" address="UserName" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" />
				<endpoint binding="netTcpBinding" bindingConfiguration="netTcpWindowMessageSecurity" address="Windows" bindingNamespace="http://App.ServiceContracts/2007/11" contract="App.ServiceContracts.IAppClientService" />
    <endpoint address="httpMex" binding="mexHttpBinding" contract="IMetadataExchange" />
				<endpoint address="tcpMex" binding="mexTcpBinding" contract="IMetadataExchange" />

Secured Service in .NET 4.0?



We have a WCF service that uses CustomUsernamePasswordValidator(UserNamePasswordValidator) over TCP for login. The only way of doing this in .NET 3.5 was to use certificate security and this is also what we implemented (certificate on both client and server).

This means that if we want to make a unsecured Login with username and password we hade to build a simple servicemethod that take username and password and then validates it.

Is there any news on this in WCF .NET 4.0? It would be grate if we could use the same procedure (with the CustomUsernamePasswordValidator) but on one endpoint state that no security should be used and on other to use certificate security.


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