Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / December 2004

Tip: Looking for answers? Try searching our database.

HttpModule not able to access SoapEnvelope

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SA - 15 Dec 2004 17:00 GMT
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.
Pierre Greborio - 15 Dec 2004 17:19 GMT
> I want to ensure that my wSE 2.0 web service is being called with at
> least one security token.
[quoted text clipped - 6 lines]
> believe this will work just fine. I can get to the request's
> SoapContext object.

You could use a policy instead.

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

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

Signature

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

SA - 15 Dec 2004 17:39 GMT
> > 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.
>
> You could use a policy instead.

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.

> > However, for future plans, I would also want access to the
> > SoapEnvelope for that request. I have tried hooking into three
[quoted text clipped - 6 lines]
>
> But probaly you have to do something else ?

I'll look into implementing a filter for this. Thanks.

> Regards,
> Pierre
SA - 15 Dec 2004 17:40 GMT
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.

Signature

---

Sven.

> Hi all,
>
[quoted text clipped - 20 lines]
>
> Sven.
Dan Rogers - 16 Dec 2004 20:12 GMT
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.

Signature

---

Sven.

"SA" <informatica@freemail.nl> wrote in message
news:#i#bfes4EHA.3908@TK2MSFTNGP12.phx.gbl...

> Hi all,
>
[quoted text clipped - 5 lines]
>
> 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
[quoted text clipped - 7 lines]
>
> Sven.
Dan Rogers - 15 Dec 2004 17:42 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.