Groups | Blog | Home
all groups > dotnet web services enhancements > august 2004 >

dotnet web services enhancements : Null RequestSoapContext.Current in Soap Client problem


WSE_Developer
8/6/2004 6:21:02 AM
Hello all,
I'm building a TCP web service using SoapClient/SoapService as my base
proxy and WS classes, and need to stuff in a Username token on the client
side. Problem is, the RequestSoapContext.Current object is null on the proxy
side. Am I doing something wrong here? What do i need to do to add security
tokens to a TCP web service using SoapClient? Any help would be greatly
appreciated.

Lucien
8/6/2004 11:00:43 AM
There's an example in TcpSyncStockService (you need to use context on
envelope):

// Example:

// SoapEnvelope e = new SoapEnvelope();

// e.SetBodyObject(message);

// KerberosToken k = new KerberosToken("host/" +
System.Net.Dns.GetHostName() );

// e.Context.Security.Tokens.Add(k);

// e.Context.Security.Elements.Add(new Signature(k));

// return (StockQuotes)base.SendRequestResponse("GetStockQuotes",
e).GetBodyObject(typeof(StockQuotes));



[quoted text, click to view]

WSE_Developer
8/6/2004 11:13:02 AM
That's great and works as expected. I'm able to get the context from the
soap envelope and stuff in my keys. The only issue i'm having now is that
then the call comes back from the service, i want to verify a custom security
token (this is still in my derived SoapClient class). Does the context in
the SoapEnvelope work the same for ResponseSoapContext? I tried using
ResponseSoapContext.Current here, but didn't work. In short, I just want to
ensure that SoapEnvelope.context can be used for both the request and
response context.

Thanks again.

[quoted text, click to view]
Lucien
8/9/2004 1:57:52 PM
Yes it works the same may. Access the context of the returned SoapEnvelope.

[quoted text, click to view]

AddThis Social Bookmark Button