SOAP extension not executing

  • Thread starter Thread starter JTrigger
  • Start date Start date
J

JTrigger

I have created a soap extension to globally handle errors in my webservice.
For some reason the extension is not executing. What is wrong?
Here is my web.config entry to wire the extension to the service:

<webServices>
<soapExtensionTypes>
<add type="EDS.RemedyServices.SoapExtensions.ErrorExtension,
RemedywebService" priority="1" group="0"/>
</soapExtensionTypes>
</webServices>

Here is my code:

using System;
using System.Web.Services.Protocols;
using System.Diagnostics;
using System.Configuration;
using System.IO;
using EDS.RemedyServices;

namespace EDS.RemedyServices.SoapExtensions
{
[AttributeUsage(AttributeTargets.Method)]
public class ErrorExtensionAttribute : SoapExtensionAttribute
{
private int priority;

public override Type ExtensionType
{
get { return typeof(ErrorExtension); }
}

// User can set priority of the 'SoapExtension'.
public override int Priority
{
get
{
return priority;
}
set
{
priority = value;
}
}
}

public class ErrorExtension : SoapExtension
{
public override object GetInitializer(LogicalMethodInfo methodInfo,
SoapExtensionAttribute attribute)
{
return null;
}

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

public override void Initialize(object initializer)
{
}

public override void ProcessMessage(SoapMessage message)
{
if (message.Stage == SoapMessageStage.AfterSerialize)
{
if (message.Exception != null)
{
WriteOutput( message );
}
}
}

public void WriteOutput( SoapMessage message )
{
#region process error

try
{
System.Exception SoapError = message.Exception;

EDS.RemedyServices.ErrorHandler.ProcessError(SoapError);
}
catch(Exception e)
{
throw(e);
}
#endregion
}
}
}
 
Hi JTrigger,

I'm viewing the post and find that this is a duplicated one with another
thread in the microsoft.public.dotnet.framework.aspnet.webservices
newsgroup. Another member of MSFT has posted a reply in that thread. Please
have a look. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top