简体   繁体   English

使用IP地址时,主机上的Web服务不会启动

[英]Webservice doesn't fire on host computer when using IP address

I cannot quite know what the problem is but I'll try to explain the current behavior: 我不太清楚问题是什么,但是我将尝试解释当前的行为:

I have a silverlight application that interacts with the CRM. 我有一个与CRM交互的Silverlight应用程序。 On a button click some data is loaded from the CRM. 在按钮上,单击一些从CRM加载的数据。 This application is published locally on my IIS. 此应用程序在我的IIS上本地发布。

From the Host computer : - I used the URL containing "localhost" to access my application, the button fired the webservice and the data was loaded. 从主机上:-我使用包含“ localhost”的URL访问我的应用程序,该按钮触发了Web服务,并加载了数据。 - I used the URL containing the "IP address", but then the button did nothing at all, also no script errors appearing. -我使用了包含“ IP地址”的URL,但是该按钮什么也不做,也没有出现脚本错误。 (My question here) (我的问题在这里)

From another computer on the network : - I used the URL containing the "IP address" and it worked fine 从网络上的另一台计算机上:-我使用了包含“ IP地址”的URL,它工作正常

Can somebody point me on why I cannot use the IP address locally to access my application ? 有人可以指出为什么我不能在本地使用IP地址访问我的应用程序吗?

Edit: 编辑:

The code behind the button click: 单击按钮后面的代码:

   private void Contacts_Click(object sender, RoutedEventArgs e)
    {
        try
        {
            QueryExpression query = new QueryExpression();
             query.EntityName = "contact";
            query.ColumnSet = new ColumnSet() { AllColumns = true, Columns = new System.Collections.ObjectModel.ObservableCollection<string>(new String[]{ "" })};

            query.PageInfo = new PagingInfo { Count = MaxRecordsToReturn, PageNumber = 1, PagingCookie = null };
            OrderExpression oe = new OrderExpression();
            oe.AttributeName = "fullname";
            oe.OrderType = OrderType.Ascending;
            query.Orders = new System.Collections.ObjectModel.ObservableCollection<OrderExpression>(new OrderExpression[] { oe }) ;
            OrganizationRequest request = new OrganizationRequest() { RequestName = "RetrieveMultiple" };
            request["Query"] = query;

            IOrganizationService service = SilverlightUtility.GetSoapService();

            service.BeginExecute(request, new AsyncCallback(Contact_ClickCallback), service);
        }
        catch (Exception ex)
        {
            //this.ReportError(ex);
        }
    }

    private void Contact_ClickCallback(IAsyncResult result)
    {
        try
        {
            OrganizationResponse response = ((IOrganizationService)result.AsyncState).EndExecute(result);
            EntityCollection results = (EntityCollection)response["EntityCollection"];
            System.Collections.ObjectModel.ObservableCollection<StudentClass> resultsarray=getTwoDimensionalArray(results);

            Dispatcher.BeginInvoke(delegate { EntityDataGrid.ItemsSource = resultsarray; });


        }
        catch (Exception ex)
        {
            //this.ReportError(ex);
        }
    }

The function: getTwoDimensionalArray, simply takes the returned entity collection and creates an instance of class "Contacts" to hold the returned values. 函数:getTwoDimensionalArray,仅获取返回的实体集合并创建类“ Contacts”的实例来保存返回的值。

It sounds like a loopback check problem. 听起来像是回送检查问题。 See this KB article for details: http://support.microsoft.com/kb/896861 有关详细信息,请参见此知识库文章: http : //support.microsoft.com/kb/896861

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM