|
|
|
start date: Tue, 31 Jul 2007 08:12:03 -0700,
posted on: microsoft.public.dotnet.framework.webservices.enhancements
back
| Thread Index |
|
1
Robert Achmann Robert
|
|
2
Robert Achmann
|
|
3
Robert Achmann
|
Defining custom userNameToken type
Hi.
No mater what I do, I can't seem to define my custom usernameTokenManager
type properly in my client app pointing to my WSE 3.0 web service.
my custom usernameTokenManager is in the root name space of my web service
Public Class customUsernameTokenManager
Inherits UsernameTokenManager
the config is:
<microsoft.web.services3>
<security>
<securityTokenManager>
<add
type="WebSvcsNameSpace.customUsernameTokenManager,WebSvcsAssemblyNameName"
namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
</securityTokenManager>
<policy fileName="wse3policyCache.config" />
</security>
</microsoft.web.services3>
just for your notes, WebSvcsAssemblyNameName and WebSvcsNameSpace are the
same name in my world - let's call is XWebService
I'm lost.
Any attempt any any combination of naming fails.
Help!
Date:Tue, 31 Jul 2007 08:12:03 -0700
Author:
|
RE: Defining custom userNameToken type
ok - here's the exception I get:
System.Configuration.ConfigurationErrorsException was unhandled
BareMessage="WSE032: There was an error loading the
microsoft.web.services3 configuration section."
Line=0
Message="WSE032: There was an error loading the microsoft.web.services3
configuration section."
Source="Microsoft.Web.Services3"
StackTrace:
at
Microsoft.Web.Services3.Configuration.WebServicesConfiguration.get_Current()
at
Microsoft.Web.Services3.Configuration.WebServicesConfiguration.get_MessagingConfiguration()
at Microsoft.Web.Services3.WebServicesClientProtocol..ctor()
at ConsoleTestBed.ws_xWebService.xWebServiceWSWse..ctor() in
C:\Projects\xWebServiceWS\ConsoleTestBed\Web
References\ws_xWebService\Reference.vb:line 40
at ConsoleTestBed.Module1.Main() in
C:\Projects\xWebServiceWS\ConsoleTestBed\Module1.vb:line 9
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Inner Exception is also a System.Configuration.ConfigurationErrorsException:
{"WSE040: Type xWebServiceWS.customUsernameTokenManager,xWebService could
not be loaded.
Please check the configuration file.
(C:\Projects\xWebServiceWS\ConsoleTestBed\bin\Debug\ConsoleTestBed.vshost.exe.config line 14)"}
Hope this helps.
"Robert Achmann" wrote:
> Hi.
>
> No mater what I do, I can't seem to define my custom usernameTokenManager
> type properly in my client app pointing to my WSE 3.0 web service.
>
> my custom usernameTokenManager is in the root name space of my web service
>
> Public Class customUsernameTokenManager
> Inherits UsernameTokenManager
>
> the config is:
>
> <microsoft.web.services3>
> <security>
> <securityTokenManager>
> <add
> type="WebSvcsNameSpace.customUsernameTokenManager,WebSvcsAssemblyNameName"
> namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
> </securityTokenManager>
> <policy fileName="wse3policyCache.config" />
> </security>
> </microsoft.web.services3>
>
> just for your notes, WebSvcsAssemblyNameName and WebSvcsNameSpace are the
> same name in my world - let's call is XWebService
>
>
> I'm lost.
>
> Any attempt any any combination of naming fails.
>
> Help!
>
Date:Tue, 31 Jul 2007 08:20:05 -0700
Author:
|
RE: Defining custom userNameToken type
I got it all working!!!
I noticed a couple of things to make it really easy to work with the wizard,
and so that changes the wizard makes actually go into the web service site.
I don’t create an ASP web service from any project template in VS 2005.
I create a virtual dir on the web server that points to an empty directory
and allow execute permissions with a Low (IIS Process) Application Protection
setting. ( I will be depending on hardware SSL)
I then open up my solution that has NO web services in it.
I add the existing empty web site manually (not create a new web service)
I add a new asmx web service file, and web.config file, to the web site.
I set up a web method call and make sure my client is updated with that web
reference, and test it.
THEN I use the WSE 3.0 wizard to set up my custom Policy….
THEN I follow the code steps in the Hands on Lab for WSE3.0 Security:
(this meant I had to read something...
....If all else fails, read the instructions)
Hands-On Lab - HOL202 Introduction to WSE 3.0 Security
It all works. Yay!
I can wrap up my test client and web service for anyone who wants it.
R.
Date:Wed, 1 Aug 2007 12:10:02 -0700
Author:
|
|
|