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 / December 2004

Tip: Looking for answers? Try searching our database.

Custom UsernamtTokenManager not being called in Windows service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 02 Sep 2004 00:25 GMT
I wrote a custom UsernameTokenManager class that works as intended
when installed in a sample ASP.NET application. I tested first using a
simple asmx, then again with a class derived from SoapService and
registered in web.config.
I am now attempting to host the same SoapService code in a service,
registering an endpoint as a SoapReceiver. This also works, but I
cannot get my custom user token class to get called. In the service's
app.config, I have

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <configSections>
   <section name="microsoft.web.services2"
type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
 </configSections>

 <microsoft.web.services2>
   <security>
     <securityTokenManager
type="Test.Web.Services.TestUserTokenManager, Test.Web.Services"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
qname="wsse:UsernameToken" />
   </security>
 </microsoft.web.services2>
</configuration>

A breakpoint in the token authenticator is never called. I cannot see
where I have the configuration set up incorrectly. The same
configuration works in web.config for the ASP.NET application.
David - 02 Sep 2004 17:01 GMT
OK, so mea culpa. If one doesn't attach a username token header to
one's soap message, the WSE framework sees no point in calling the
username token manager. Duh.
db - 23 Nov 2004 20:37 GMT
Hi

I have some kind of problem...
The example Username Token works fine.
When i try to use it one my own app I am getting the following error msg.
An unhandled exception of type
'System.Web.Services.Protocols.SoapHeaderException' occurred in
system.web.services.dll

Additional information: System.Web.Services.Protocols.SoapHeaderException:
Server unavailable, please try later --->
System.Configuration.ConfigurationException: WSE032: There was an error
loading the microsoft.web.services2 configuration section. --->
System.Configuration.ConfigurationException: WSE040: Type EBAuthManager, EB
could not be loaded. Please check the configuration file.
  at System.Web.Configuration.HttpConfigurationRecord.Evaluate(String
configKey, SectionRecord section)
  at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String
configKey, Boolean cacheResult)
  at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String
configKey, Boolean cacheResult)
  at System.Web.HttpContext.GetConfig(String name)
  at
System.Web.Configuration.HttpConfigurationSystemBase.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
  at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
  at
Microsoft.Web.Services2.Configuration.WebServicesConfiguration.Initialize()
  --- End of inner exception stack trace ---
  at
Microsoft.Web.Services2.Configuration.WebServicesConfiguration.Initialize()
  at
Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
  --- End of inner exception stack trace ---

I can not seem to figure out what is wrong with my web.config file

<webServices>      
     <soapExtensionTypes>
       <add type="Microsoft.Web.Services2.WebServicesExtension,
Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" priority="1" group="0" />
     </soapExtensionTypes>
   </webServices>
 </system.web>
 <microsoft.web.services2>
   <diagnostics>
     <detailedErrors enabled="true" />
   </diagnostics>
   <security>
     <securityTokenManager type="PC.EBAuthManager, PC"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" qname="wsse:UsernameToken" />
   </security>
 </microsoft.web.services2>

Can you help me out?

Thanks

> OK, so mea culpa. If one doesn't attach a username token header to
> one's soap message, the WSE framework sees no point in calling the
> username token manager. Duh.
Oneal - 29 Dec 2004 11:33 GMT
I have encountered a similar problem.  I don't think somebody has actually
posted viable solution for this.  If anyone has experience on working around
this problem, please tell us how to go about this.  Thanks!

> I wrote a custom UsernameTokenManager class that works as intended
> when installed in a sample ASP.NET application. I tested first using a
[quoted text clipped - 27 lines]
> where I have the configuration set up incorrectly. The same
> configuration works in web.config for the ASP.NET application.
Dilip Krishnan - 29 Dec 2004 14:45 GMT
Hello Oneal,
  It will only be called if you are supplying a Usernametoken from your
client. Try doing so if you arent doing that already

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> I have encountered a similar problem.  I don't think somebody has
> actually posted viable solution for this.  If anyone has experience on
[quoted text clipped - 31 lines]
>> where I have the configuration set up incorrectly. The same
>> configuration works in web.config for the ASP.NET application.
Martin Kulov - 29 Dec 2004 21:41 GMT
Hi Oneal and David,

I assume that you are already passing UsernameToken from the client.
I had a similiar problem when I tried to debug a Web Service with Window
Forms client.
You can go to Debug/Processes menu and attach to w3wp.exe or aspnet_svc.exe
(depending on your Windows installation and assuming that you have warmed up
the IIS server). Then start the client separately from VS. For example start
it using Windows Explorer.

Let us know if this helps you.

Regards,
Martin Kulov
http://www.codeattest.com

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
SA - 30 Dec 2004 20:18 GMT
Hi David, Oneal:

This same scenario works fine for me...

This might seem like a dumb question, but how do you know that the
UsernameTokenManager does not get called? (In order to debug a Windows
Service, you will need to attach the debugger manually to the process that's
running the service).

In any case, it is possible to use the same configuration as for an IIS Web
Service (that's how I do it too).

Does the web service operate? What if you supply bad credentials?

---

Sven.

> I have encountered a similar problem.  I don't think somebody has actually
> posted viable solution for this.  If anyone has experience on working around
[quoted text clipped - 22 lines]
> >       <securityTokenManager
> > type="Test.Web.Services.TestUserTokenManager, Test.Web.Services"

xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd"
> > qname="wsse:UsernameToken" />
> >     </security>
[quoted text clipped - 4 lines]
> > where I have the configuration set up incorrectly. The same
> > configuration works in web.config for the ASP.NET application.

Rate this thread:







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.