Re: How do you view the SoapEnvelope xml?



On Sep 21, 3:15 pm, kelphis <amcha...@xxxxxxxxxxx> wrote:
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>

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")

.



Relevant Pages

  • Simple SoapClient Question
    ... Trying to create a simple request/response application. ... Using network capture, I see the request is sent and the server responds ... Public Function RequestResponseMethod(ByVal envelope As SoapEnvelope) As ... Dim destination As EndpointReference = New EndpointReference ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • ReferenceProperty is Invalid element ?
    ... Added this ReferenceProperty to the ReplyTo header but got an 'Invalid element supplied' exception. ... Dim Env As SoapEnvelope = New SoapEnvelope ... Dim wsaReferenceProperties As New ReferenceProperties ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • are xmlns required?
    ... soap XML for me to review ... Dim un As UsernameToken = New UsernameToken("asdfasdf", ... Dim senv As SoapEnvelope = New SoapEnvelope ... Dim p As Pipeline = New Pipeline ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • How do you view the SoapEnvelope xml?
    ... I am playing the the soapenvelope and Im trying to add a UsernameToken ... Dim token As UsernameToken ... Dim p As Pipeline = New Pipeline ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Calling WSE filters directly
    ... I would like to make use of WSE filters directly bypassing standard pipeline ... In other words I have a payload in a form of raw XML and would like to apply ... SoapEnvelope se = new SoapEnvelope; ...
    (microsoft.public.dotnet.framework.webservices.enhancements)

Loading