UsernameToken is expected but not present
- From: Dan Fergus <dan@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 11 Jan 2007 08:52:02 -0800
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
.
- Prev by Date: Re: Wse3 'Add web reference' Vista 64 bit
- Next by Date: WSE 3 SoapFilter: envelope.Context does not contain items added in the Service Entry Filter
- Previous by thread: Re: Wse3 'Add web reference' Vista 64 bit
- Next by thread: WSE 3 SoapFilter: envelope.Context does not contain items added in the Service Entry Filter
- Index(es):
Relevant Pages
|