a newbie question

Topics: General Discussion Forum
Feb 4, 2007 at 8:14 PM
a newbie question Posted on: 02/04/2007 11:37:28

I am creating a web service which would return a synchronous response once the input message is validated (like acknowledgment). After that it would query the database and return an asynchronous response. How do I achieve this?

Also based on the certificate issued to client I want to recognize which client is sending request. Which security algorithm should be implemented for this? The client would communicate using SOAP.

If anyone could provide me with some simple code or direct me towards some links I would be grateful.

Feb 5, 2007 at 4:57 PM
Hi Raj,

You can solve this scenario using a duplex pattern like for example with the binding "wsDualHttpBinding". Here you will define your sync operations as "OneWay" and you will set a callback contract with your callback operations that will send the response back to the client with the result of your dababase query. The current version of WSSF (v2) does not provide an example with dual binding but you can find a good example in the Windows SDK here: http://www.microsoft.com/downloads/details.aspx?familyid=7614FE22-8A64-4DFB-AA0C-DB53035F40A0&displaylang=en. Locate the path "\WCFSamples\TechnologySamples\Basic\Contract\Service\Duplex\CS". Notice that these samples comes zipped. Let me know if you need any further help with this.
Regarding the identiy of the client with a "BrokeredX509" scenario where you need to check the identity based on the client X509 certificate, the standard way of doing this is by reading the ServiceSecurityContext.Current.PrimaryIdentity class that will give you the CN (Name property if IIdentity) of the client certificate. If you need other kind of authorization check, you can add your own IAuthorization policy implementation class (claim based authz) or plug in your own role provider (role based authz).

Digit Factory S.R.L.
Feb 6, 2007 at 8:35 AM
Thanks Charly, I'll look at the examples.