473,503 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SoapExtension and System.Configuration.ConfigurationException

Hi All,

I've just written a small program to use a locally hosted webservice
which works fine.

However I've also written a SOAPExtension for the client and I'm having
trouble with the configuration (getting a ConfigurationException
complaining about a valid type name).

The following is the coded DebugExtension which extends SoapExtension

public class DebugExtension : SoapExtension {
Stream oldStream;
Stream newStream;

public DebugExtension(){}

public override Stream ChainStream(Stream stream){
oldStream = stream;
newStream = new MemoryStream();
return newStream;
}

public override object GetInitializer(Type t){
return null;
}

public override object GetInitializer(LogicalMethodInfo l,
SoapExtensionAttribute sea){
return null;
}

public override void Initialize(object o){
//do nothing
}

public override void ProcessMessage(SoapMessage message) {
// This won't execute if deployed on the service side.
if (message is SoapClientMessage)
{
Display d;
switch (message.Stage)
{
case SoapMessageStage.BeforeSerialize:
break;
case SoapMessageStage.AfterSerialize:
d = new Display();
d.showSOAP(message);
break;
case SoapMessageStage.BeforeDeserialize:
d = new Display();
d.showSOAP(message);
break;
case SoapMessageStage.AfterDeserialize:
break;
default:
throw new Exception("invalid stage");
}
}
}

[AttributeUsage(AttributeTargets.Method)]
public class DebugExtensionAttribute : SoapExtensionAttribute
{
private int priority;
public override Type ExtensionType
{
get { return typeof(DebugExtension); }
}

public override int Priority
{
get { return priority; }
set { priority = value; }
}
}
}

I have the following app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="microsoft.web.services2"
type="Microsoft.Web.Services2.Configuration.WebSer vicesConfiguration,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
</configSections>
<microsoft.web.services2>
<diagnostics />
</microsoft.web.services2>
<system.web>
<webServices>
<soapExtensionTypes>
<add type="DebugExtension"
priority="1"
group="0" />
</soapExtensionTypes>
</webServices>
</system.web>
</configuration>

When running the program I get the following error:
"An unhandled exception of type
'System.Configuration.ConfigurationException' occurred in system.dll

Additional information: The 'type' attribute must be set to a valid
type name."

However commenting out the System.web node and all it's children
elimnates the error (the extension doesn't run of course). I've also
tried adding a type of type="Debug.DebugExtension" were Debug is the
namespace in which the entire project resides.

Any input appreciated,
Cameron

Jan 9 '06 #1
0 2443

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3653
by: Louis | last post by:
Hi All, When I build the application, the following error appear: An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll Additional...
1
4337
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
0
5300
by: phillip | last post by:
This is interesting, I have attached my web.config file and the exception I have been logging. I created a library which provide data access to a database and a control system. The library is...
2
3036
by: RD | last post by:
This code builds without errors, the line is in my declaration section of my form.yet when I execute it I get an unhandled error. Weird thing is I been testing this app all day yesterday, made no...
1
3248
by: Steven.Dahlin | last post by:
I am trying to execute a soap extension with a WinForm client accessing a Web Service. I have created a application configuration which includes the following: <configuration> <system.web>...
2
5571
by: lprisr | last post by:
Hi, I have double byte characters in the content that I am returning using Web Services. However, the encoding in the xml file returned by Web Services is utf-8 and I am unable to read the...
0
1062
by: Ankur Goel | last post by:
When I'm running my ASP.NET application, system throws the following exception. Although page is displayed properly but this exception is thrown internally. And also when I'm doing load testing...
0
1727
by: thatsMaBoy | last post by:
Hi, I have a VB.NET 2003 web service client (EXE) that makes use of a SOAPExtension class. The client calls a web service that returns a SOAP message containing MIME encoded files. The...
0
1595
by: stephen | last post by:
Hi all, I am getting this error: An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.web.dll Additional information: Exception creating section...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.