July 2004 - Posts
Web Services Enhancements 2.0 SP1 for Microsoft® .NET (WSE) just released !
Core product changes:
WSE no longer throws an exception due to a SOAP message being signed by a KerberosToken security token in a time zone east of GMT.
The value of the maxTokens attribute for the <limits> element specifies the maximum number of security tokens that may be contained within an incoming SOAP message. Previously, only natively supported security tokens counted towards the limit.
All members of the ElementList class now use by value parameters. Previously, the Remove and IndexOf methods used by reference parameters.
When a SOAP request does not contain a SOAPAction HTTP header, WSE throws an Microsoft.Web.Services2.Addresssing.AddressingFormatException. Previously, a System.NullReferenceException was thrown.
WSE now generates WSDL files with unique operations when a Web service is built using the WSE Messaging API and it contains multiple Web service methods with identical names. Previously, WSE generated an incorrect WSDL document for this scenario.
WSE no longer throws an exception during WSDL generation for Web services built using the WSE Messaging API that contain a method with an System.Xml.XmlElement parameter.
The GetBodyObject method of the Microsoft.Web.Services2.SoapEnvelope class now supports System.Data.DataSet objects.
Invalid policy documents that contain multiple <Role> or <SubjectName> claims in a <SecurityToken> assertion will now fail to load.
SecurityContextToken and UsernameToken security tokens with the same key as a cached security token can now be cached using the CacheSecurityToken method. Previously, the security token would not be cached.
A new protected virtual method, named RaiseDispatchFailed, has been added to the Microsoft.Web.Services2.Messaging.SoapTransport class. Any class derived from SoapTransport can raise the Microsoft.Web.Services2.Messaging.SoapTransport.DispatchFailed event by calling this method.
A new flag named IncludeReferenceProperties has been added to the Microsoft.Web.Services2.Security.SignatureOptions enumeration. This flag can be used to specify that all elements in the SoapContext.Addressing.Destination.ReferenceProperties.AnyElements collection are signed. This flag is only valid for outgoing SOAP messages.
When dispatching a SOAP message based on an Microsoft.Web.Services2.Addressing.EndpointReference, the wsu:Id, SOAP actor and mustUnderstand attributes are now ignored.
While retrieving an x.509 certificate, WSE is now capable of using an RFC3280 compliant algorithm to generate a key identifier for X.509 certificates that do not have the Key Identifier extension. To enable this algorithm, add an <x509> element to the receiving application's configuration file and set the useRFC3280 attribute to "true". The default value for the useRFC3280 attribute, which is new for SP1, is "false". Setting the attribute to "false" specifies that WSE uses an algorithm that is not RFC3280 compliant, as it did prior to SP1.
After processing the SOAP envelope through all the input filters, WSE runtime will remove the SOAP header element if it no longer contains any child elements.
When a security token request does not have an Microsoft.Web.Services2.Policy.AppliesTo (RequestSecurityToken.AppliesTo is null), WSE no longer adds an AppliesTo. Previously, WSE would default the destination to the URL for the security token service.
Visual Studio tool integration changes:
The type attribute for settings on security token managers and binary security token managers is now an optional setting in the WSE Settings 2.0 tool. when the type attribute is not specified, the built-in security token managers are used, such as Microsoft.Web.Services2.Security.Tokens.X509SecurityTokenManager. Previously, it was required.
The Time Tolerance in Seconds setting on the Security tab of the WSE Settings 2.0 tool now updates the <ttlInSeconds> element in the application's configuration file, even if one already exists. Previously, the value was only inserted into the <ttlInSeconds> element when the element was not currently in the configuration file.
The X509Certificates... link on the TokenIssuing tab of the WSE Settings 2.0 tool now opens the certificate store location specified on the Security tab. Previously, it would always open the CurrentUser store.
The Security Settings Wizard can now be used on Microsoft Windows 2000 to select, add, and view X.509 certificates. Previously, the Select Certificate, Add Certificate, and View Certificate buttons were not functional on Windows 2000.
A new check box named Use RFC3280 has been added to the Security tab in the WSE Settings 2.0 tool that enables you to specify that WSE generates RFC3280 compliant key identifiers when an X.509 certificate does not contain the Key Identifier extension. When set, the Policy Wizard generates RFC3280 compliant PKI too.
WseWsdl2 tool changes:
The WseWsdl2 tool now properly generates proxy classes when an Web service exposes multiple operations with the same name but with unique action names. The tool will now create a proxy correctly for this scenario by setting the new UniqueMethodName property of the SoapMethodAttribute class to a unique name.
Proxy classes will now be generated for services containing relative URI values for SOAP action names.
Generated proxy classes for Web service methods that use a DataSet type for a parameter or return value, now use the DataSet type as the Web service method. Previously, the proxy class would generate the System.Xml.XmlElement type for DataSet types.
When a SoapService has an SoapActor attribute applied to it, an EndpointReference with a Via reference property is required to send a SOAP message to the Web service. To build a SoapClient that calls a Web service that has an SoapActor attribute applied to it, use the new WseWsdl2 tool command line parameter, name, and specify the logical name that is specified in the Web service's SoapActor attribute. The generated SoapClient proxy class will correctly address the Web service with a fully specified EndpointReference. For an example of how to specify the EndpointReference without using the WseWsdl2 tool, see the TcpSyncStockService QuickStart sample.
When a WSDL contains a schema definition that is registered with an empty namespace and if any of the message part elements contain a Type attribute the tool will no longer throw an exception.
The WseWsdl2 tool can now process WSDL documents that have nested <import> elements. That is, WSDL documents that contain an <import> element that references a WSDL document, which in turn has an <import> element that references another WSDL document, and so forth. To specify the level of recursion that the WseWsdl2 tool will go through to download the imported WSDL documents, two new command line parameters have been added to SP 1: noRecursion and recursionLevel. To specify how many levels of recursion you want the tool to go through, use the recursionLevel followed by an integer representing the number of levels or documents you want the tool to go through. The default is 3. If you do not want the tool to download WSDL documents specified in <import> elements, use the noRecursion command line parameter. If both parameters are used, the noRecursion parameter takes precedence.
Like the WSDL.exe tool, the WseWsdl2 tool now generates methods to communicate with a Web service asynchronously. That is, for every Web service method, a BeginXXX and EndXXX method are generated. The XXX in the name of the method is the name of the synchronous method. Use the BeginXXX method to initiate an asynchronous call and the EndXXX method to complete it.
X509 Certificate Tool changes:
Office 2003 Service Pack 1
contains significant security enhancements, in addition to stability and performance improvements. Service Pack 1 (SP1) also includes many performance and feature enhancements to Microsoft Office InfoPath 2003
Long long time ago... Internet wasn't exist... there was a shared network called BITNET and the world of information exchange and messaging was ruled by Bulletin Board Systems so called BBS.
I remember plugging my 300baud modem and watching the characters filling the screen as someone connected to my BBS at late night ...
How happy i was when my father came back from the states with a new amazing high speed modem 1200baud.... later upgraded to 2400baud. When i got my 40meg hd to replace my 10meg one so i will be able to host some more information i was in heaven....
Why did it all came back to me today ???
Well I was googeling for some information when I've bumped into this list (P-BBS.071.txt)
And yes... #29 on the list is me ! ... 2010 The Year We Made Contact BBS ... for several years I had this BBS running at nights...
Its so nice that due to the Internet we can brings back old good memories sometimes.
In Visual Studio 2005 Whidbey :
In Visual Studio 2002-3 :
P/Invoke to SetEnvironmentVariable
public static extern int SetEnvironmentVariable( string name , string value ) ;
I was asked how to ask control to scroll using C#, Well here is a very simple way :
Declare some constants:
private const int WM_SCROLL = 276; // Horizontal scroll
private const int WM_VSCROLL = 277; // Vertical scroll
private const int SB_LINEUP = 0; // Scrolls one line up
private const int SB_LINELEFT = 0;// Scrolls one cell left
private const int SB_LINEDOWN = 1; // Scrolls one line down
private const int SB_LINERIGHT = 1;// Scrolls one cell right
private const int SB_PAGEUP = 2; // Scrolls one page up
private const int SB_PAGELEFT = 2;// Scrolls one page left
private const int SB_PAGEDOWN = 3; // Scrolls one page down
private const int SB_PAGERIGTH = 3; // Scrolls one page right
private const int SB_PAGETOP = 6; // Scrolls to the upper left
private const int SB_LEFT = 6; // Scrolls to the left
private const int SB_PAGEBOTTOM = 7; // Scrolls to the upper right
private const int SB_RIGHT = 7; // Scrolls to the right
private const int SB_ENDSCROLL = 8; // Ends scroll
Add a using reference
Declare external SendMessage:
private static extern int SendMessage(IntPtr hWnd, int wMsg,IntPtr wParam, IntPtr lParam);
If you have some textbox on the form...
SendMessage( Control Handle , WM Scroll Message, (IntPtr) Scroll Command ,IntPtr.Zero);
Scroll page up
Scroll page down
article shows how to use the XmlDiff class to compare two XML files and show these differences as an HTML document in a .NET Framework 1.1 application. The article also shows how to build a WinForms application for comparing XML files.
Click here to download xmldiff.
Mark Treadwell has a great post with lots of sources regarding exception management
- MSJ, Matt Pietrek: A Crash Course in Structured Exception Handling
- MSDN Mag, Matt Pietrek: Under the Hood - New Vectored Exception Handling in Windows XP
- Blog, Chris Brumme: The Exception Model
- PAG, MSDN, Exception Management Architecture Guide [article only]
- PAG, MSDN, Exception Management Application Block for .NET [article only]
- Cat Francis, MSDN, Introduction to Exception Handling in Visual Basic .NET [article only]
- Eric Gunnerson, MSDN, Writing Exceptional Code [article only]
- Eric Gunnerson, MSDN, The Well-Tempered Exception [article and code: exception.exe]
- MSDN Library, .NET Framework Class Library, Exception Class
- MSDN Library, .NET Framework SDK, .NET Framework Developer's Guide, Handling and Throwing Exceptions, with the following subsections:
- Jesse Liberty, MSDN Magazine, December 2002, .NET Exceptions: Make the Transition from Traditional Visual Basic Error Handling to the Object-Oriented Model in .NET [article only]
- Wesner Moise, Assert Enhancements [article and code, assert_src.zip]
- Kevin McFarlane, Code Project, Managing Unhandled Exceptions in .NET [article and code]
- Marc Clifton, Code Project, A Treatise on Using Debug and Trace classes, including Exception Handling [article and code, DebugTreatise_src.zip]
- Jason Bock, Creating a Reusable Error Dialog for .NET Applications [article and code]
- Kathleen Dollard, Visual Studio Magazine, Display Dissected Exceptions [article and code]
Web Services Enhancements for Microsoft .NET version 2.0 includes a number of enhancements over earlier versions of WSE to more easily apply security policy, establish long-running secure conversations, and work in multiple hosted environments. Some of these enhancements, such as the WSE 2.0 support for the newly-approved Oasis standard version of WS-Security, mean WSE 2.0 cannot exchange SOAP messages with WSE 1.0. The good news is that you can use the WSE 2.0 assemblies in the same applications as your WSE 1.0 assemblies so that a single application can communicate with both WSE 1.0 and WSE 2.0 Web services
To read more about WSE 2.0 Enhanced features like:
WS-Trust and Security Context Tokens
Kerberos Security Tokens
Role-based Security Using Security Tokens
Signing and Encrypting Security Tokens
XML Security Token Support
Check this article
More Posts Next page »