I am playing the the soapenvelope and Im trying to add a UsernameToken
to the soapEnvelope like this:
Dim token As UsernameToken
token = New UsernameToken("kelly", "kelly",
PasswordOption.SendNone)
Dim s As SoapEnvelope = New SoapEnvelope
Dim p As Pipeline = New Pipeline
s.Context.Security.Tokens.Add(token)
but when I view the outerxml of the soapenvelope object i looks like
this:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
envelope/"><soap:Body /></soap:Envelope>
kelphis - 27 Sep 2007 16:22 GMT
> I am playing the the soapenvelope and Im trying to add a UsernameToken
> to the soapEnvelope like this:
[quoted text clipped - 13 lines]
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/
> envelope/"><soap:Body /></soap:Envelope>
Well like everything else Ive posted in the google groups I had to
answer this myself.
Before the soapenvelope XML is compiled it has to be processed by
sending it through the pipeline. You can force this through the
pipeline by calling the ProcessOutputMessage(soapenvelope) sub.
make sure that you clear the addressing section if you are not using
it otherwise you will be getting lots of errors.
Dim un As UsernameToken = New UsernameToken("asdfasdf",
"asdfasfd", PasswordOption.SendPlainText)
Dim senv As SoapEnvelope = New SoapEnvelope
senv.Context.Security.Tokens.Add(un)
senv.Context.Addressing.Clear()
Dim p As Pipeline = New Pipeline
p.ProcessOutputMessage(senv)
senv.Save("c:\test.xml")