No SoapContext

Discussion in 'ASP .Net Web Services' started by APA, Jan 17, 2007.

  1. APA

    APA Guest

    In the constructor of my web service I have no access to the SoapContext (i.e. RequestSoapContext.Current). Not only that but I have implemented a
    customer UsernameTokenmanger.AuthenticateToken method and it doesn't call that either. I have the following setup in my web.config

    <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3,
    Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <securityTokenManager type="AppCommonProj.CustomUsernameTokenManager, AppCommonProj"
    xmlns:wsse="" qname="wsse:UsernameToken"/>

    I'm using a testing tool (that works fine with other web services that I've developed in .NET 1.1 but this web service is developed in .NET2.0 using
    WSE3. I'm not really doing anything odd just checking the SoapContext to see if the request was made using SOAP and not using POST or GET. Here's
    what I'm doing in my web service's constructor.

    SoapContext sContext = RequestSoapContext.Current;
    if (sContext == null)
    throw new Exception("Invalid web service request.");

    sContext is always null. Have no idea why and I don't understand why the UsernameTokenmanger.AuthenticateToken method is not being called either.

    APA, Jan 17, 2007
    1. Advertisements

  2. APA

    APA Guest

    Well I got by this problem when I went through the WSE3 setup wizard and then deleted all the policy crap that it created. However, my custom
    AuthenticateToken method is still not called. The WSE3 setup wizard modifed the securityTokenManager element to look like this but it still never
    calls it (and never tried even with the policy stuff).

    <add type="AppCommonProj.ASPDNSFUsernameTokenManager, AppCommonProj"
    namespace="" localName="UsernameToken" />
    <diagnostics />

    What took me 10 minutes in WSE2 is taking 6 hours in WSE3 what a POS.
    APA, Jan 17, 2007
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerry
    Aug 1, 2003
  2. WSE 1.0, InputFilter, SoapContext

    , Feb 1, 2004, in forum: ASP .Net Web Services