activating a SOAP extension from the client

R

Robert Rotstein

I want to write a SOAP extension that gets activated from both the
client and the server. From whast I have read, this should be quite
easy to do. Yet I can only activate it from the server.

I have a service (.asmx file) which contains the following:

namespace OfficerCallIn
{
[WebService(Name="OfficerCallInService",
Namespace="TheOfficerCallInService")]
public class OfficerCallInService :
System.Web.Services.WebService
{

. . .

[WebServiceHeaderExtension.CryptoSOAPExtAttribute]
[WebMethod(EnableSession=true)]
public void ProcessOfficerLocationAndStatus { ... }
}
}

The SOAP extension file looks like this:

namespace WebServiceHeaderExtension
{
[AttributeUsage(AttributeTargets.Method)]
public class CryptoSOAPExtAttribute :
System.Web.Services.Protocols.SoapExtensionAttribute
{
...

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

public class CryptoSOAPExt :
System.Web.Services.Protocols.SoapExtension
{
... // the usual methods
}
}

and the client call looks like this:

OfficerCallInService srvc = new OfficerCallInService();
srvc.ProcessOfficerLocationAndStatus( . . .);

The intention is to put some encryption/decryption code, currently
residing in the client, into the SOAP extension. Right now, the
extension methods are essentially empty, containing nothing more than
the usual boilerplate code and a few MessageBox() pop-ups to signal that
they are being activated.

I can see that the service is activating the SOAP code, since the
pattern of activations is: BeforeDeserialize, AfterDeserialize,
BeforeSerialize, AfterSerialize. This is the standard server-side
pattern. But what must I do to get the client to activate the SOAP
extensions? I'm sure that I am overlooking something perfectly simple
and obvious, but, as I am a beginner at this material, I don't know what
it is. Can someone clue me in?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top