Following several online examples, we have implemented the following using WSE 2.0:
In the Web Servic .asmx file:
namespace WebService1
{
public class Service1 : System.Web.Services.WebService
{
public class AuthenticationManager : UsernameTokenManager
{
protected override string AuthenticateToken(UsernameToken token)
{
return token.Password;;
}
}
...
And in the Service's Web.config file we have the following:
<security>
<securityTokenManager
qname="wsse:UsernameToken"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
type="WebService1.AuthenticationManager, WebService1" />
When we run the client application, we get an exception when it calls the web service:
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 WebService1.AuthenticationManager, WebService1 could not be loaded. Please check the configuration file. at System.Web.Configuration.HttpConfigurationRecord.Evaluate(String configKey, SectionRecord section)
Any clues as to what we're doing wrong?
Thanks,
Chris
I don't know if this will solve the entire issue, but the namespace looks
wrong. It should be:
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd" qname="wsse:UsernameToken"
If you are using the production build of WSE 2.0 then it uses the OASIS
standard for WS-Security.
Jeffrey Hasan, MCSD
President, Bluestone Partners, Inc.
-----------------------------------------------
Author of: Expert SOA in C# Using WSE 2.0 (APress, 2004)
http://www.bluestonepartners.com/soa.aspx
> Following several online examples, we have implemented the following using WSE 2.0:
>
[quoted text clipped - 23 lines]
>
> 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
WebService1.AuthenticationManager, WebService1 could not be loaded. Please
check the configuration file. at
System.Web.Configuration.HttpConfigurationRecord.Evaluate(String configKey,
SectionRecord section)
> Any clues as to what we're doing wrong?
>
> Thanks,
> Chris