activating a SOAP extension from a client

R

Robert Rotstein

I want to write a SOAP extension that gets activated from both the
client and the server. But so far, I have only been able to activate
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

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top