.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

Problems accessing web service without www

Posted By:      Posted Date: October 09, 2010    Points: 0   Category :ASP.Net

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:


View Complete Post

More Related Resource Links

Secured web with unauthenticated users accessing a service


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="

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.

problems with Consuming WCF service in SoapUI

Hi,   Rather new to WCF!! I have created a simple WCF web service in a Console application and successfully tested consuming it in a .Net Console application client. i have used the default binding behaviour stuff in my host as below: Uri baseAddress = new Uri("http://localhost:8000/ServiceModelSamples/Service"); ServiceHost selfHost = new ServiceHost(typeof(CalculatorService), baseAddress); try { selfHost.AddServiceEndpoint( typeof(ICalculator), //the contract new WSHttpBinding(), //the binding "CalculatorService"); //the endpoint address ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; selfHost.Description.Behaviors.Add(smb); selfHost.Open(); Console.WriteLine("The service is ready at {0}.", baseAddress); Console.WriteLine("Press <ENTER> to terminate service."); Console.WriteLine(); Console.ReadLine(); // Close the ServiceHostBase to shutdown the service. selfHost.Close(); } catch (CommunicationException ce) { Console.WriteLine("An exception occurred: {0}", ce.Message); selfHost.Abort(); } my problem is that I would like to consume this service in SoapUI. Firs

error 1069: The service did not start due to logon problems

The local sql server that was working fine earlier does not start now. I have already created tables and accessed them using stored procedures. I get an error 1069: The service did not start due to logon problems. I have only changed my domain password. I do not remember what authentication I chose for log on. Any suggestions would be helpful. Thanks

Indexing Service problems

After days of searching for a solution on the Internet I hope someone can help, Others have had the same problem but there were no real solutions posted. My problem is that the Index Service does not return all the fields in the results of my DataGrid, for example DocTitle and Characterization are empty while Path and Url bring back entries. If I use the Indexing services default query page for that catelog it returns all the correct information. I dont believe its my code because its pretty much the same as all the examples I have found on the net. It does not matter if I use the existing 'Web' catelog or create my own. Hope someone has a suggestion. Dim strQuery As String strQuery = "Select DocTitle,Path,url,Characterization from SCOPE() where write_ > '2000/06/26' and CONTAINS(filename, '.htm')" Dim connString As String = "Provider=MSIDXS;Data Source=web" Dim cn As New System.Data.OleDb.OleDbConnection(connString) Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn) Dim testDataSet As New DataSet("results") cmd.Fill(testDataSet) Dim source As New DataView(testDataSet.Tables(0)) DataGrid1.DataSource = source DataGrid1.DataBind()

Problems with using SPSite inside a Web Service (presumably credentials problem)

Greetings. I need to write a web service which will access sharepoint via object model (need to output data from lists, and no, built-in sharepoint web services are useless to me since they totally suck if you dont have an english-language site) In the code of my web service, i use something like this:   Site = new SPSite(SiteLink); Web = Site.AllWebs[""]; And then i use Web.Lists to get my list and work with it. It works, unless i put the webservice on. I mean, when the webservice is launched from Asp.net deveopment server, it works fine. When i made a website in IIS pointing it to my webservice, it now spits this error:   System.IO.FileNotFoundException: ?? ??????? ????? ???-?????????? ?? ?????? http://localhost/sites/test/. ?????????, ????????? ?? ?????? URL-?????. ???? ???? URL-????? ???????????? ??? ????????????? ???????м???, ???м????, ?????м??м? ??м??????????? ??????????? ???????? ????? ????????????? URL-?????? ??????? ? ?????м ??????????м. at Microsoft.SharePoint.SPSite..ctor(SPFarm farm, Uri requestUri, Boolean contextSite, SPUserToken userToken) at Microsoft.SharePoint.SPSite..ctor(String requestUrl) at IstrebitelProperListWebService.SchemaExporter.SetSite(String siteLink) in C:\Users\Administrator\Documents\Visual Studio 2008\Projects\ProperListWebService\ProperListWebService\IstrebitelProperListWebServ

Problems with AD Connection in User Profile Service

I found a great resource that I have used successfully to set up and configure the User Profile Service: http://www.harbar.net/articles/sp2010ups.aspx I am now tryin to do this in a new environment and everything works until i get to Configure Connection to Do a Sync and click "Populate Containers"  I don't get an AD container for "SharePoint Users" according to the example. Any pointers or assistance you could provide would be greatly appreciated. Thank you, David

Problems with UserProfile Application Service not starting.



I'm using the Rational Guide from Harbar.net, and have the following problem:

UserProfileApplication.SynchronizeMIIS: Failed to configure ILM, will attempt during next rerun. Exception: System.Data.SqlClient.SqlException: Specified collection 'StringSchemaCollection' cannot be dropped because it is used by object 'MyAD_Domain\spfarm.GetObjectCurrent'.     

I found references to simalr errors with Kerberos auth problems, but not one like this.

What did I do wrong, and how do I correct it?



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 with connecting to a WCF Service


I'm going through the learning curve with WPF in VS2010 (.NET 4.0) at the moment. I created a simple WPF Forms project and put a reference to an exisiting WCF service. Everything worked fine. I then created a WPF Browser project and put a reference to the same WCF service in it. I now get this:

Request for the permission of type 'System.Net.WebPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The service is normally used in an ASP 4.0 web site with no problem. What do I need to configure to avoid this problem in the WPF browser project?

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?

Accessing CRM2011 OrganizationData.svc from SharePoint WebPermission problems


I'm attempting to query the OrganizationData.svc web service from a SharePoint EventReceiver but don't seem to have the appropriate credentials. Thing is if I attempt to access it via a console app my credentials work fine. I expect that since the EventReceiver is making the call, in scenario 2, that the identity is that of the process running SharePoint, but for some reason the credentials provided don't work. Is there an approach that works? Thanks


The wss_minimaltrust.config change I made was  <IPermission class="WebPermission" version="1" Unrestricted="true"> </IPermission> as per http://www.coderetard.com/2008/06/16/sharepoint-c-systemsecuritysecurityexception-request-for-the-permission-of-type-systemnetwebpermission-system-version2000-cultureneutral-publickeytokenb77a5c561934e089-failed/


Scenario 1: Console App

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;


namespace OrgDataCo

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