Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / August 2004

Tip: Looking for answers? Try searching our database.

Null RequestSoapContext.Current in Soap Client problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WSE_Developer - 06 Aug 2004 14:21 GMT
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.

Thanks!
Lucien - 06 Aug 2004 19:00 GMT
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));

> Hello all,
>    I'm building a TCP web service using SoapClient/SoapService as my base
[quoted text clipped - 5 lines]
>
> Thanks!
WSE_Developer - 06 Aug 2004 19:13 GMT
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.

> There's an example in TcpSyncStockService (you need to use context on
> envelope):
[quoted text clipped - 26 lines]
> >
> > Thanks!
Lucien - 09 Aug 2004 21:57 GMT
Yes it works the same may. Access the context of the returned SoapEnvelope.

> 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
[quoted text clipped - 37 lines]
> > >
> > > Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.