> control in my SoapServer application; however, it never gets control. If I
> comment out all the lines except for the SendOneWay statement then SayHi
> does get control.
> I guess I'm a little confused. I have something like this:
> SoapEnvelope se = new SoapEnvelope();
[quoted text clipped - 23 lines]
> to
> > add security into your soap headers.
First, thanks for following up, your help is greatly appreciated.
Answers to your questions:
1) The server's SayHi() looks like this:
[SoapMethod("SayHi")]
public void SayHi()
{
Console.WriteLine("SayHi()");
}
2) When my clients wants to call the SayHi method its calls the following
method:
public void CallSayHi()
{
this.SendOneWay("SayHi", new SoapEnvelope());
}
This version works (i.e. if I set a breakpoint in my Server's SayHi() method
it gets hit).
However, if I change my client's code to look like this:
public void CallSayHi()
{
SoapEnvelope se = new SoapEnvelope();
se.Context.Security.Tokens.Add(this.UserToken);
se.Context.Security.Elements.Add(new MessageSignature(this.UserToken));
se.Context.Security.Elements.Add(new EncryptedData(this.UserToken));
this.SendOneWay("SayHi", se);
}
With this version the breakpoint in the Server's SayHi() method never gets
hit. I'm not sure how do check the logs you indicated, so I'm not sure what
the data looks like.
BTW, this.UserToken is initialized in my constructor like so:
this.UserToken = new UsernameToken("mike", "mike",
PasswordOption.SendHashed);
Thanks again for all your help.
> Hi,
>
[quoted text clipped - 30 lines]
> <soap:Envelope
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> ion>
>
[quoted text clipped - 7 lines]
> </wsu:Timestamp>
> <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd"
> wsu:Id="SecurityToken-b9482177-331c-4c7b-b742-abb330ecbf14">
> <wsse:Username>Username</wsse:Username>
> <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> -profile-1.0#PasswordText">Password</wsse:Password>
> <wsse:Nonce>wfj1hUZazQfBJUpYPmi3tQ==</wsse:Nonce>
[quoted text clipped - 12 lines]
> <soap:Envelope
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> ion>
>
[quoted text clipped - 7 lines]
> </wsu:Timestamp>
> <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd"
> wsu:Id="SecurityToken-a41e800d-e4d9-4201-89bd-4234eb5609a3">
> <wsse:Username>Username</wsse:Username>
> <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> -profile-1.0#PasswordText">Password</wsse:Password>
> <wsse:Nonce>GzJ01SQL/IvolzcV5yXeZQ==</wsse:Nonce>
[quoted text clipped - 46 lines]
> > to
> > > add security into your soap headers.
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/08/08/21447.aspx
> > > hth
> > message
[quoted text clipped - 26 lines]
> > > > Any advice would be greatly appreciated.
> > > > -Mike
Michael Riggio - 11 Aug 2004 16:44 GMT
I don't know what I did, but everything works now, just as you indicated it
should. I did find the trace settings in the WSE 2 properties and can now
see the information being passed back and forth.
You have been most helpful. I'm sure I'm not the only one on this board
that appreciates your time and knowledge.
Thanks again,
-Mike
> First, thanks for following up, your help is greatly appreciated.
>
[quoted text clipped - 71 lines]
> > <soap:Envelope
> > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > ion>
> >
[quoted text clipped - 7 lines]
> > </wsu:Timestamp>
> > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd"
> > wsu:Id="SecurityToken-b9482177-331c-4c7b-b742-abb330ecbf14">
> > <wsse:Username>Username</wsse:Username>
> > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > -profile-1.0#PasswordText">Password</wsse:Password>
> > <wsse:Nonce>wfj1hUZazQfBJUpYPmi3tQ==</wsse:Nonce>
[quoted text clipped - 12 lines]
> > <soap:Envelope
> > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > ion>
> >
[quoted text clipped - 7 lines]
> > </wsu:Timestamp>
> > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd"
> > wsu:Id="SecurityToken-a41e800d-e4d9-4201-89bd-4234eb5609a3">
> > <wsse:Username>Username</wsse:Username>
> > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > -profile-1.0#PasswordText">Password</wsse:Password>
> > <wsse:Nonce>GzJ01SQL/IvolzcV5yXeZQ==</wsse:Nonce>
[quoted text clipped - 51 lines]
> > > to
> > > > add security into your soap headers.
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/08/08/21447.aspx
> > > > hth
> > > message
[quoted text clipped - 30 lines]
> > > > > Any advice would be greatly appreciated.
> > > > > -Mike
Softwaremaker - 11 Aug 2004 23:29 GMT
You are very welcomed, Michael. Thank you for your compliments.

Signature
Thank you very much
Warmest Regards,
Softwaremaker
Architect | Evangelist | Consultant
Microsoft Regional Director
http://www.microsoft.com/rd
+++++++++++++++++++++++++++++++++
> I don't know what I did, but everything works now, just as you indicated it
> should. I did find the trace settings in the WSE 2 properties and can now
[quoted text clipped - 86 lines]
> > > <soap:Envelope
> > > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > > y-utility-1.0.xsd"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > > ion>
<wsa:MessageID>uuid:28d37a7b-61ab-491a-a30a-40799e56ec78</wsa:MessageID>
> > > <wsa:To>soap://www.softwaremaker.net/SomeRPCService</wsa:To>
> > > <wsse:Security soap:mustUnderstand="1">
[quoted text clipped - 4 lines]
> > > </wsu:Timestamp>
> > > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > > y-utility-1.0.xsd"
> > > wsu:Id="SecurityToken-b9482177-331c-4c7b-b742-abb330ecbf14">
> > > <wsse:Username>Username</wsse:Username>
> > > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > > -profile-1.0#PasswordText">Password</wsse:Password>
> > > <wsse:Nonce>wfj1hUZazQfBJUpYPmi3tQ==</wsse:Nonce>
[quoted text clipped - 12 lines]
> > > <soap:Envelope
> > > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > > y-utility-1.0.xsd"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > > ion>
<wsa:MessageID>uuid:45b69f19-da12-43fb-826c-fe694e527321</wsa:MessageID>
> > > <wsa:To>soap://www.softwaremaker.net/SomeRPCService</wsa:To>
> > > <wsse:Security soap:mustUnderstand="1">
[quoted text clipped - 4 lines]
> > > </wsu:Timestamp>
> > > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > > y-utility-1.0.xsd"
> > > wsu:Id="SecurityToken-a41e800d-e4d9-4201-89bd-4234eb5609a3">
> > > <wsse:Username>Username</wsse:Username>
> > > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > > -profile-1.0#PasswordText">Password</wsse:Password>
> > > <wsse:Nonce>GzJ01SQL/IvolzcV5yXeZQ==</wsse:Nonce>
[quoted text clipped - 53 lines]
> > > > to
> > > > > add security into your soap headers.
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/08/08/21447.aspx
> > > > > hth
> > > > message
[quoted text clipped - 31 lines]
> > > > > > Any advice would be greatly appreciated.
> > > > > > -Mike
Actually, I did get this to work, but when I create a UsernameToken and use:
PasswordOption.SendHashed
I get the following error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in microsoft.web.services2.dll
Additional information: The security token could not be authenticated or
authorized
I don't get this exception when I use:
PasswordOption.SendPlainText
Any advice?
Thanks,
-Mike
> Hi,
>
[quoted text clipped - 30 lines]
> <soap:Envelope
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> ion>
>
[quoted text clipped - 7 lines]
> </wsu:Timestamp>
> <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd"
> wsu:Id="SecurityToken-b9482177-331c-4c7b-b742-abb330ecbf14">
> <wsse:Username>Username</wsse:Username>
> <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> -profile-1.0#PasswordText">Password</wsse:Password>
> <wsse:Nonce>wfj1hUZazQfBJUpYPmi3tQ==</wsse:Nonce>
[quoted text clipped - 12 lines]
> <soap:Envelope
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> ion>
>
[quoted text clipped - 7 lines]
> </wsu:Timestamp>
> <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> y-utility-1.0.xsd"
> wsu:Id="SecurityToken-a41e800d-e4d9-4201-89bd-4234eb5609a3">
> <wsse:Username>Username</wsse:Username>
> <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> -profile-1.0#PasswordText">Password</wsse:Password>
> <wsse:Nonce>GzJ01SQL/IvolzcV5yXeZQ==</wsse:Nonce>
[quoted text clipped - 46 lines]
> > to
> > > add security into your soap headers.
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/08/08/21447.aspx
> > > hth
> > message
[quoted text clipped - 26 lines]
> > > > Any advice would be greatly appreciated.
> > > > -Mike
Softwaremaker - 11 Aug 2004 23:28 GMT
When you send a "PlainText" Password, you are actually invoking a Win32API
call to check with WindowsAuthentication for your local SAM. If you use a
username / password that is not stored in your SAM, then it wouldnt work
anymore.
If you use a "SendHashed" Password, you are expecting the receiver to have
the same shared secret with you. Therefore, the receiver (or the SoapServer,
in your case...) should have a framework for retrieving the
username/password from a user DB or something of that sort...This is usually
the more popular alternative in the real world and more closely parallels
real-world apps. WSE2.0 also gives you the framework extensibility for doing
by allowing you to implement your own UsernameTokenManager to retrieve the
username / password from your user DB. Look up UsernameTokenManager in the
docs for a clearer explanation. If you want some practical examples, I have
a blog here that has helped a few ppl :)
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/06/10/16012.aspx
hth.

Signature
Thank you very much
Warmest Regards,
Softwaremaker
Architect | Evangelist | Consultant
+++++++++++++++++++++++++++++++++
> Actually, I did get this to work, but when I create a UsernameToken and use:
> PasswordOption.SendHashed
[quoted text clipped - 53 lines]
> > <soap:Envelope
> > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > ion>
> >
[quoted text clipped - 7 lines]
> > </wsu:Timestamp>
> > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd"
> > wsu:Id="SecurityToken-b9482177-331c-4c7b-b742-abb330ecbf14">
> > <wsse:Username>Username</wsse:Username>
> > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > -profile-1.0#PasswordText">Password</wsse:Password>
> > <wsse:Nonce>wfj1hUZazQfBJUpYPmi3tQ==</wsse:Nonce>
[quoted text clipped - 12 lines]
> > <soap:Envelope
> > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
> > ty-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header>
<wsa:Action>http://www.softwaremaker.net/SomeRPCService/SomeRequest</wsa:Act
> > ion>
> >
[quoted text clipped - 7 lines]
> > </wsu:Timestamp>
> > <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
> > y-utility-1.0.xsd"
> > wsu:Id="SecurityToken-a41e800d-e4d9-4201-89bd-4234eb5609a3">
> > <wsse:Username>Username</wsse:Username>
> > <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token
> > -profile-1.0#PasswordText">Password</wsse:Password>
> > <wsse:Nonce>GzJ01SQL/IvolzcV5yXeZQ==</wsse:Nonce>
[quoted text clipped - 51 lines]
> > > to
> > > > add security into your soap headers.
http://dotnetjunkies.com/WebLog/softwaremaker/archive/2004/08/08/21447.aspx
> > > > hth
> > > message
[quoted text clipped - 30 lines]
> > > > > Any advice would be greatly appreciated.
> > > > > -Mike