Groups | Blog | Home
all groups > dotnet web services enhancements > november 2006 >

dotnet web services enhancements : Retreive method name and arguments in the ProcessMessage


Jacques Marcialis
11/29/2006 4:12:03 AM
Hi,

I have secured my web service with a MutualCertificate11Security policy
and it work fine. I use AES256 to encrypt communications after
authentication with establishSecurityContext="true".

Now I would like to log in a database my WS activity with a new policy
assertion.

Does someone know how can I retreive the certificatate's subject, the
method name and the arguments values in the ProcessMessage ?

Thanks a lot
JM
Pablo Cibraro [MVP]
11/29/2006 9:58:51 AM
Hi Jacques,

You can get the certificate's subject from the X509Security token, this
token is available through the property SoapContext.Current.IdentityToken

X509SecurityToken token =
(X509SecurityToken)SoapContext.Current.IdentityToken;

The soap context is also available in the soap envelope:
envelope.Context.IdentityToken

There is no way to get the method name and arguments. The assertions are
only able to see soap documents, these documents contains a SoapAction and a
SoapBody with elements. WSE internally maps the SoapAction with the web
service's method and parses the SoapBody to get the arguments.
You can do the same, but it seems to be a hard thing to do. (Unless, you
copy some code from WSE using Reflector).

Regards,
Pablo Cibraro.

[quoted text, click to view]

Jacques Marcialis
12/5/2006 1:18:09 AM
Hi

Thanks a lot. It work perfectly :)

For the method name and arguments, I parse the envelope.body as you
said :
envelope.Body.ChildNodes(0) is the xmlNode that discribe the method
which the name can be retreived with the property 'Name'.
envelope.Body.ChildNodes(0).ChildNodes(x) are the xmlnodes that
discribe every serialized argument.



Pablo Cibraro [MVP] a =E9crit :

[quoted text, click to view]
AddThis Social Bookmark Button