all groups > dotnet web services enhancements > december 2004 >
You're in the

dotnet web services enhancements

group:

HttpModule not able to access SoapEnvelope


HttpModule not able to access SoapEnvelope SA
12/15/2004 11:00:02 AM
dotnet web services enhancements: Hi all,

I want to ensure that my wSE 2.0 web service is being called with at least
one security token.

I have a function that validates that using the
RequestContext.Security.Tokens collection.

Instead of calling that function from every Soap Method, I want to put this
in an HttpModule. While I haven't actually tried it yet, I believe this will
work just fine. I can get to the request's SoapContext object.

However, for future plans, I would also want access to the SoapEnvelope for
that request. I have tried hooking into three events: AUthenticateRequest,
BeginRequest, and PreRequestHandlerExecute. In all of these events, the
Envelope property of my SoapContext is Nothing (null).

Is there a way I can access the Envelope in an HttpModule?

Thanks,

---

Sven.

Re: HttpModule not able to access SoapEnvelope SA
12/15/2004 11:39:04 AM

[quoted text, click to view]

Yes, I realize that. The customer will have the ability to add policy using
policy files. But the minimum requirement will always be that there should
be at least one SecurityToken.
[quoted text, click to view]

I'll look into implementing a filter for this. Thanks.
[quoted text, click to view]

Re: HttpModule not able to access SoapEnvelope SA
12/15/2004 11:40:01 AM
Actually, it turns out that the Security.Tokens collection of that
SoapContext object I have access to is empty as well... (it's not Nothing,
just empty).

I am sure I am passing a security token, because if I put the check in a web
method, it works.

--

---

Sven.

[quoted text, click to view]

RE: HttpModule not able to access SoapEnvelope danro NO[at]SPAM microsoft.com
12/15/2004 5:42:12 PM
------=_NextPart_0001_0F91A7C3
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

In an HTTP module you have access to the request stream - and this contains
an HTTP request, which in turn contains an HTTP header and then a SOAP
request. You have to find the envelope yourself - since it hasn't been
pulled apart by the ASP.net stack yet.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: "SA" <informatica@freemail.nl>
Subject: HttpModule not able to access SoapEnvelope
Date: Wed, 15 Dec 2004 11:00:02 -0600
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.224
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.224
Message-ID: <#i#bfes4EHA.3908@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: 65.82.123.185
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5157
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

Hi all,

I want to ensure that my wSE 2.0 web service is being called with at least
one security token.

I have a function that validates that using the
RequestContext.Security.Tokens collection.

Instead of calling that function from every Soap Method, I want to put this
in an HttpModule. While I haven't actually tried it yet, I believe this will
work just fine. I can get to the request's SoapContext object.

However, for future plans, I would also want access to the SoapEnvelope for
that request. I have tried hooking into three events: AUthenticateRequest,
BeginRequest, and PreRequestHandlerExecute. In all of these events, the
Envelope property of my SoapContext is Nothing (null).

Is there a way I can access the Envelope in an HttpModule?

Thanks,

---

Sven.



------=_NextPart_0001_0F91A7C3
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 In an HTTP module you have access to the request stream - and this contains an HTTP request, which in turn contains an HTTP header and then a SOAP request. You have to find the envelope yourself - since it hasn't been pulled apart by the ASP.net stack yet.
\par
\par I hope this helps
\par
\par Dan Rogers
\par Microsoft Corporation
\par \pard\li720 --------------------
\par From: "SA" <informatica@freemail.nl>
\par Subject: HttpModule not able to access SoapEnvelope
\par Date: Wed, 15 Dec 2004 11:00:02 -0600
\par Lines: 26
\par X-Priority: 3
\par X-MSMail-Priority: Normal
\par X-Newsreader: Microsoft Outlook Express 6.00.3790.224
\par X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.224
\par Message-ID: <#i#bfes4EHA.3908@TK2MSFTNGP12.phx.gbl>
\par Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
\par NNTP-Posting-Host: 65.82.123.185
\par Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
\par Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.webservices.enhancements:5157
\par X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements
\par
\par Hi all,
\par
\par I want to ensure that my wSE 2.0 web service is being called with at least
\par one security token.
\par
\par I have a function that validates that using the
\par RequestContext.Security.Tokens collection.
\par
\par Instead of calling that function from every Soap Method, I want to put this
\par in an HttpModule. While I haven't actually tried it yet, I believe this will
\par work just fine. I can get to the request's SoapContext object.
\par
\par However, for future plans, I would also want access to the SoapEnvelope for
\par that request. I have tried hooking into three events: AUthenticateRequest,
\par BeginRequest, and PreRequestHandlerExecute. In all of these events, the
\par Envelope property of my SoapContext is Nothing (null).
\par
\par Is there a way I can access the Envelope in an HttpModule?
\par
\par Thanks,
\par
\par ---
\par
\par Sven.
\par
\par
\par \pard
\par
\par }
------=_NextPart_0001_0F91A7C3--
Re: HttpModule not able to access SoapEnvelope Pierre Greborio
12/15/2004 6:19:42 PM
[quoted text, click to view]

You could use a policy instead.

[quoted text, click to view]

I suggest to implement a filter (input or output or both) which contains all
information (security, addressing, etc).

But probaly you have to do something else ?

Regards,
Pierre

--
-------------------------------------------
Pierre Greborio
Microsoft .NET MVP
http://blogs.ugidotnet.org/pierregreborio
http://www.amazon.com/infopath
-------------------------------------------

Re: HttpModule not able to access SoapEnvelope danro NO[at]SPAM microsoft.com
12/16/2004 8:12:53 PM
Hi,

yes, this also makes sense. In the HTTP module, no SOAP processing has
happened yet. The SoapContext stuff is filled in for you AFTER the stage
in the ASP pipeline where the HTTP module gets control. If you want to get
access to the payload data from the HTTP module, you need to crack the
input stream yourself.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
From: "SA" <informatica@freemail.nl>
References: <#i#bfes4EHA.3908@TK2MSFTNGP12.phx.gbl>
Subject: Re: HttpModule not able to access SoapEnvelope
Date: Wed, 15 Dec 2004 11:40:01 -0600
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.224
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.224
Message-ID: <uVOf10s4EHA.2624@TK2MSFTNGP11.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
NNTP-Posting-Host: 65.82.123.186
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices.enhancements:5162
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices.enhancements

Actually, it turns out that the Security.Tokens collection of that
SoapContext object I have access to is empty as well... (it's not Nothing,
just empty).

I am sure I am passing a security token, because if I put the check in a web
method, it works.

--

---

Sven.

[quoted text, click to view]
AddThis Social Bookmark Button