![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have been successful consuming a WCF 3.0 service from a 2.0 client. I would like to embed a token (GUID as string) in the header so I can check the token with a session on the server side. We have a requirement to run on Windows 2000 professional so we have to use a .net 2.0 client (WCF basicHttpBinding). Changing the server or the client to make this work is no problem so I do not have the requirement of changing only the client. I have a server side authenticate operation that has username and password params, which returns a token if authenticated, this process starts a very light weight client side session. I do NOT want to have the token on every exposed contract method so a SOAP header is the answer. Now what I want to do is pass this token in the SOAP header with every call from the client to the server, extract it from the header on the server and do a security check to ensure the method they have called is accessible by the client (the client the token belongs to). I have found a way to extract (or add as far as that goes) the header on the server, here's some example code: int index = OperationContext.Current.IncomingMessageHeaders.Fi ndHeader("token", ""); string token = OperationContext.Current.IncomingMessageHeaders.Ge tHeader<string>(index); What I do not know how to do is create a 2.0 client that can see this token. I am familiar with the ASP.Net 1.1 way of creating a soap header. Any examples out there? |
#3
| |||
| |||
|
|
"Curt K" <curt_krueger (AT) hotmail (DOT) com> wrote in message news:%23AmMNO3rHHA.3884 (AT) TK2MSFTNGP04 (DOT) phx.gbl... There hasn't been much change in this area from 1.1 to 2.0, except the whole nonsense of "web sites" in 2.0. Please tell us what you're trying so we can figure out how to help. -- John Saunders [MVP] |
#4
| |||
| |||
|
|
"John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message news:ugFojJ5rHHA.404 (AT) TK2MSFTNGP06 (DOT) phx.gbl... "Curt K" <curt_krueger (AT) hotmail (DOT) com> wrote in message news:%23AmMNO3rHHA.3884 (AT) TK2MSFTNGP04 (DOT) phx.gbl... There hasn't been much change in this area from 1.1 to 2.0, except the whole nonsense of "web sites" in 2.0. Please tell us what you're trying so we can figure out how to help. .... How do I from the WCF perspective add a SOAP header so that it is imported into the proxy object and shows up as a SOAP header object on the 2.0 client side proxy? I basically need to decorate all of my Service Contract/Operation Contract calls with the equivalent 3.0 version of this on the WCF side (or modify the SOAP header before it is sent to the client). [SoapHeader("tokenHeader", Direction = SoapHeaderDirection.In)] So how do I add a SOAP header on the WCF side that can be consumed by a dot net 2.0 web service client? Hopefully that clears it up? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |