UsernameToken is expected but not present



I've seen this asked on several sites, but no real answer. So let's try again;

I'm use WSE 3, Winforms app calling a custom proxy, to a WebApplication
contaning WebServices. Since WSE 3 configuration doesn't see the
WebApplication as an ASP applicatin I had to do hand fixing of the web.config
file.

My output files shows the usernameToken IS included

<wsse:Security soap:mustUnderstand="1">
<wsu:Timestamp
wsu:Id="Timestamp-5606f854-d963-44a5-b001-0c9622243562">
<wsu:Created>2007-01-11T16:28:00Z</wsu:Created>
<wsu:Expires>2007-01-11T16:33:00Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; wsu:Id="SecurityToken-0ced34dd-a093-4fba-b742-932b5c0546ec">
<wsse:Username>dfergus</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText";>C82a958tMuhWpO5rmarlnBha9MM=</wsse:Password>
<wsse:Nonce>NcCe1NrzP+Klqb025aE6aQ==</wsse:Nonce>
<wsu:Created>2007-01-11T16:28:00Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>

but the webservice returns an error that there is no usernameToken. Here is
the InputTrace snippet


<wsse:Security>
<wsu:Timestamp
wsu:Id="Timestamp-bfe0c6b7-1792-4b0e-b1aa-044b074b9709">
<wsu:Created>2007-01-11T16:28:20Z</wsu:Created>
<wsu:Expires>2007-01-11T16:33:20Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>

I did check the uuid and the relatesto id to make sure that they ar ethe
same request, and they are.


<wsa:RelatesTo>urn:uuid:3bdf8165-240e-43f1-9d64-e0a60c313cf2</wsa:RelatesTo>

<wsa:MessageID>urn:uuid:3bdf8165-240e-43f1-9d64-e0a60c313cf2</wsa:MessageID>

--
My proxy looks like this;
private static Microsoft.Web.Services3.Security.Tokens.UsernameToken
token;
private static AccountServiceProxy instance = new
AccountServiceProxy();

public static AccountServiceProxy Instance
{
get
{
if (token != null)
{
instance.SetPolicy("usernameTokenSecurity");
instance.SetClientCredential(token);
}
return instance;
}
}
My WebService looks liek this;
[WebService(Namespace = "http://blah.com/webservices/Account";)]
[SoapDocumentService(RoutingStyle =
SoapServiceRoutingStyle.RequestElement)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("usernameTokenSecurity")]
public class AccountService : System.Web.Services.WebService
{

My function call looks like;

msg = new AccountDOCollectionMessage();
msg.AccountDOCollection =
AccountServiceProxy.Instance.GetAccountSearchCollection(where);

I cannot understand or figure out how the correct information is being sent
in the request, but is not getting to the service. I've checked and
rechecked web.config and wse3policyCache.config and can find nothing.

Dan Fergus
Device Development MVP
.



Relevant Pages

  • RE: how can we restrict what certificate WSE will use?
    ... \par As for the question on the X509 certificate verification in .net webservice using WSE, here are some of my understanding and suggestions: ... how can we restrict what certificate WSE will use? ... \par webservice, each client will send in properly encrypted and signed request, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: VBA access to WSE web service?
    ... \par Yes, you're right, COM interop is one possible approach as long as the client machine also has .net framework and WSE installed... ... \par Microsoft Online Support ... \par Subject: Re: VBA access to WSE web service? ... \par>Regarding on the calling WSE protected XML Webservice through Office ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Passing tokens down multiple layers of web services
    ... I'm facing a challenge in designing a Service Oriented Architecture based on ... WSE 2.0 SP1. ... Is there a way to pass on the token from the inputfilter of a webservice to ... My idea was that as you are in the context of a call from a client, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: secure a WS called via GPRS
    ... You can use the WSE 2.0 implementation for the Compact Framework here. ... I understand you're consider a security mechanism ... secure your ASP.NET webservice which will be consumed by many smart ... since WSE 3.0 only support .net framework ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Web service with Push to client ?
    ... to keep alive so much sockets at the server ... Is WSE 3.0, or WCF support it? ... purely and dedicated for webservice. ...
    (microsoft.public.dotnet.framework.webservices)