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 / January 2004

Tip: Looking for answers? Try searching our database.

Soap Extensions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher Padgett - 16 Jan 2004 07:51 GMT
Hello Al

I have to invoke a Web service that expects a MIME message that contains a SOAP message.  The SOAP message's header contains a security token that accords the WS-Security specification

I am guessing the Web service's client must undertake a couple steps

(1)  It must build the SOAP message that contains the security token.  I extended the Microsoft.Web.Services.WebServicesClientProtocol class because it offers the output filter that renders the security token

(2)  It must build the MIME message that contains the SOAP message.  I implemented a derived class of the SoapExtension class, attributed it to the client's method that invokes the service's method, and expected its ProcessMessage method to be invoked after the SOAP message had been serialized.  No luck!  The ProcessMessage method is invoked before the SOAP message has been serialized

Is it possible to "prioritize" the ProcessMessage method to be invoked after the output filters have been invoked

Should I be attacking my little problem from a different angle

Cheers Chri
Steven Cheng[MSFT] - 17 Jan 2004 06:02 GMT
Hi ,

Thank you for using Microsoft Newsgroup Service. Regarding on the issue, I
am
finding proper resource to assist you and we will update as soon as posible.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)
MSFT - 20 Jan 2004 06:51 GMT
Hi Chris,

Thank you for using MSDN Newsgroup. I am Luke and I am review this issue
currently. Regarding the issue, you want the ProcessMessage function can be
executed after the SOAP message has been serialized. In fact, the
ProcessMessage of a SOAPExtension will be executed four times in a round:

AfterDeserialize
AfterSerialize
BeforeDeserialize
BeforeSerialize

We can determine the current stage from SoapMessage's Stage property:

Public Overrides Sub ProcessMessage(message As SoapMessage)
       Select Case message.Stage
          Case SoapMessageStage.BeforeSerialize
          Case SoapMessageStage.AfterSerialize
               ' Write the SOAP message out to a file.
               WriteOutput(message)
          Case SoapMessageStage.BeforeDeserialize
               ' Write the SOAP messae out to a file.
               WriteInput(message)
          Case SoapMessageStage.AfterDeserialize
          Case Else
               Throw New Exception("invalid stage")
       End Select
   End Sub

For more information about the order of SOAP Extensions Methods Invoked,
may refer to following article:

Altering the SOAP Message Using SOAP Extensions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconAlteringSOAPMessageUsingSOAPExtensions.asp

How ASP.NET Web Services Work
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebsrv/ht
ml/howwebmeth.asp

Hope this help.

Luke
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Christopher Padgett - 22 Jan 2004 01:39 GMT
Luke

Thank you for your reply.

I have implemented the ProcessMessage logic but when I am debugging it
during the AfterSerialize stage, the output stream doesn't contain the
WSE elements (eg, the UserNameToken element).  It seems to suggest that
the WSE filters in WSE are applied after the AfterSerialize stage.

This is my problem.  If possible, I want to "prioritize" the WSE filters
before the AfterSerialize stage.

Your suggestions are appreciated.

Chris
MSFT - 23 Jan 2004 05:45 GMT
Hi Chris,

Due to the natrue of WSE, we can't use it before AfterSerialized. If you
want to perform some management on the SOAP message after all WSE filter,
you may create custom Filter (whthin WSE). For more information on this,
you may refer to:

Inside the Web Services Enhancements Pipeline
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwse/html/
insidewsepipe.asp

Luke
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


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.