Consuming a web service - Access problems



I am trying to access a webservice but have problems with connecting.
Config file is after the error.
This is the code i am using and the error is as below:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using Breakingviews.www.BreakingViewsWebService;
using Breakingviews.Configuration;
using System.Web.Services.Protocols;
using System.Net;

public partial class MostRead : System.Web.UI.Page
{
private ContentInfoService BuildContentInfoService()
{
ContentInfoService contentInfoService = new
ContentInfoService();
AddxxxxxxxCookies(contentInfoService);
return contentInfoService;
}

static void AddMagicCookies(SoapHttpClientProtocol webService)
{
CookieContainer cookieContainer = new CookieContainer();
string secret =
BvConfiguration.GetConfigurationString("SomeString");
Uri uri = new Uri(webService.Url);
cookieContainer.Add(new Cookie("xxxxxxx", secret, "/",
uri.Host));

webService.CookieContainer = cookieContainer;
}

public void ListReadyStories()
{
ContentInfoService service = BuildContentInfoService();
Guid[] stories = service.ListReadyStories(60);
//List<Guid> storyList = new List<Guid>(stories);
Response.Write(stories.ToString());
}

protected void Page_Load(object sender, EventArgs e)
{


ListReadyStories();

}
}

************************************************************************
*******************
Error page i get when i view MostRead.aspx in Browser
************************************************************************
*******************
Server Error in '/' Application.
------------------------------------------------------------------------
--------

Couldn't find type for class
Breakingviews.WebModules.AssertHealth.AssertListener,
Breakingviews.WebModules.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException:
Couldn't find type for class
Breakingviews.WebModules.AssertHealth.AssertListener,
Breakingviews.WebModules.

Source Error:


Line 29: {
Line 30: string settingValue =
ConfigurationSettings.AppSettings[key];
Line 31: Debug.WriteLine("Read configuration value " + key +
"=" + settingValue);
Line 32: return settingValue;
Line 33: }


Source File:
C:\BackUp\code\dotnet\Breakingviews.Configuration\BvConfiguration.cs
Line: 31

Stack Trace:


[ConfigurationErrorsException: Couldn't find type for class
Breakingviews.WebModules.AssertHealth.AssertListener,
Breakingviews.WebModules.]
System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type
baseType, String initializeData) +1902756
System.Diagnostics.TypedElement.BaseGetRuntimeObject() +42
System.Diagnostics.ListenerElement.GetRuntimeObject() +82
System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +134
System.Diagnostics.TraceInternal.get_Listeners() +134
System.Diagnostics.TraceInternal.WriteLine(String message) +105
System.Diagnostics.Debug.WriteLine(String message) +4

Breakingviews.Configuration.BvConfiguration.GetConfigurationString(Strin
g key) in
C:\BackUp\code\dotnet\Breakingviews.Configuration\BvConfiguration.cs:31

Breakingviews.Configuration.BvConfiguration.GetConfigurationTimeSpan(Str
ing key, TimeSpan defaultValue) in
C:\BackUp\code\dotnet\Breakingviews.Configuration\BvConfiguration.cs:47
Breakingviews.WebModules.ConcurrentUsageModule..cctor() in
C:\BackUp\code\dotnet\Breakingviews.WebModules\ConcurrentUsageModule.cs:
28

[TypeInitializationException: The type initializer for
'Breakingviews.WebModules.ConcurrentUsageModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle&
ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +103
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache) +268
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +1036
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +114
System.Web.Configuration.Common.ModulesEntry.Create() +41
System.Web.Configuration.HttpModulesSection.CreateModules() +203
System.Web.HttpApplication.InitInternal(HttpContext context,
HttpApplicationState state, MethodInfo[] handlers) +1006

System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpConte
xt context) +259
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
context) +114
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+350




------------------------------------------------------------------------
--------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
ASP.NET Version:2.0.50727.1433


Webconfig file under <appsettings>: Values have been changed for
confidentiality:


<add key="Secretsomeotherkey"
value="{643E7B39-991F-487c-AA52-B408071BGFDE9}!~secret~!{5B68008E-5054-4
oc7-B7E2-1C82E0BF5965}"/>
<!-- the password that is passed (as a cookie) to access the
webservice
This isn't particularly secure (it's passed as plaintext)
but the webservice itself
is designed for this to be broken -->
<add key="SomeString"
value="{0BD4523-3A2D-4880-81H4-278GG20FC6A4}"/>
<!-- The list of IP addresses that the internal web services will
listen to, separated by semi-colons (;) -->
<add key="SomeStringforSafeAddresses"
value="127.0.0.1;222.33.30.122;222.131.113.222;192.1.1.6;192.1.1.233;192
..1.1.254"/>


*** Sent via Developersdex http://www.developersdex.com ***
.



Relevant Pages

  • ConfigurationSettings.AppSettings[key]
    ... The webservice is internally developed by another developer who has ... A string 'xxxxxx' is passed to cookie to verify. ... private ContentInfoService BuildContentInfoService() ... System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean ...
    (microsoft.public.dotnet.languages.csharp)
  • Cosume Web service problem with authentication
    ... private ContentInfoService BuildContentInfoService() ... CookieContainer cookieContainer = new CookieContainer; ... An unhandled exception occurred during the execution of the ... System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean ...
    (microsoft.public.dotnet.languages.csharp)
  • Unable to Write to Event Log w/ Enterprise Library 2.0 in Win App
    ... ExceptionPolicy.HandleException(ex, "Sample Exception Policy") ... keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, ... configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, ... context, String name, IConfigurationSource configurationSource, ...
    (microsoft.public.dotnet.general)
  • Re: urgent: beta 2.0 error
    ... Microsoft Online Support ... An unhandled exception has occurred. ... |> | Request URL: ... Boolean& ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Sharepoint 2007 - Installation Error - Failed to register SP servi
    ... The issue stems from the installer going to a remote computer for SQL Server. ... Server I have the following exception: ... exception, Boolean breakConnection) ... RunBehavior runBehavior, String resetOptionsString) ...
    (microsoft.public.sharepoint.portalserver)