簡體   English   中英

Web服務拋出錯誤

[英]Web Service Throwing Error

我無法弄清楚這一點。 這段代碼已經完美地執行了好一陣子,現在卻無處失敗。 它調用的Web服務沒有改變,我有點茫然。 特定錯誤為{"Configuration system failed to initialize"}

我正在使用的代碼:

webservices.WebService ws = new webservices.WebService();

設計器中的代碼:

namespace NumberOneService.Properties {

[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {

    private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

    public static Settings Default {
        get {
            return defaultInstance;
        }
    }

    [global::System.Configuration.ApplicationScopedSettingAttribute()]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
    [global::System.Configuration.DefaultSettingValueAttribute("http://www.webserver.services/ws_partlookup.cfc")]
    public string Web_Service {
        get {
            return ((string)(this["Web_Service"]));
        }
    }
}

堆棧跟蹤:

at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(Object sender, InternalConfigEventArgs e)
   at System.Configuration.Internal.InternalConfigRoot.RemoveConfigImpl(String configPath, BaseConfigurationRecord configRecord)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)
   at System.Configuration.ClientSettingsStore.ReadSettings(String sectionName, Boolean isUserScoped)
   at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties)
   at System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider)
   at System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName)
   at System.Configuration.SettingsBase.get_Item(String propertyName)
   at System.Configuration.ApplicationSettingsBase.GetPropertyValue(String propertyName)
   at System.Configuration.ApplicationSettingsBase.get_Item(String propertyName)
   at NumberOneService.Properties.Settings.get_Web_Service() in Number One Service\Properties\Settings.Designer.cs:line 33
   at NumberOneService.webservices.WebService..ctor() in Number One Service\Web References\webservices\Reference.cs:line 46
   at NumberOneService.NumberOneService.bwExecuteProcess_DoWork(Object sender, DoWorkEventArgs e) in Number One Service.cs:line 400
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

如果您在類庫中創建了Web服務引用,然后將其移植到控制台應用程序或Windows應用程序,則通常會發生這種情況。 Web服務引用通過特定路徑存儲在設置文件中。

基本上,您在配置文件中缺少節聲明或正確的設置名稱。 請檢查您的配置文件以獲取存儲服務網址的密鑰。 否則,將其粘貼在此處,我們將提供進一步的幫助。

當Web服務構造函數嘗試從配置文件設置Url時,將引發異常。 (主機配置或設置文件)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM