Professional ASP.NET 1.0 Special Edition- P39

Professional Special Edition- P39:Those of us who are Microsoft developers can't help but notice that .NET has received a fair amount of visibility over the last year or so. This is quite surprising considering that for most of this period, .NET has been in its early infancy and beta versions. I can't remember any unreleased product that has caused this much interest among developers. And that's really an important point, because ignoring all the hype and press, .NET really is a product for developers, providing a great foundation for building all types of applications | SayHelloResponse soap Body soap Envelope The value of the SayHelloResult element is now an array of bytes. These bytes are a single-pass symmetric DES encryption of the string Secret Message . The EncryptionExtension attribute that we added to the function encrypts the value after the message is serialized into SOAP - allowing us to send a valid SOAP message that can be routed between various intermediaries as well as sent over alternative protocols. And our data remains secure as it is sent over the network. To decrypt the message we use the same attribute but add it to the proxy that the application using our service uses EncryptionExtension Decrypt SoapDocumentMethodAttribute http SayHello Use ParameterStyle _ Public Function SayHello As String Dim results As Object SayHello New Object 0 Return CType results 0 String End Function Instead of setting an Encrypt property in the EncryptionExtension attribute we now set a Decrypt property. This instructs the EncryptionExtension to decrypt any incoming messages. The result is that data is encrypted on the wire as it s exchanged and decrypted again by the intended recipient. The ProcessMessage function of EncryptionExtension follows public override void ProcessMessage SoapMessage message switch case break case Encrypt break case Decrypt break case break default throw new Exception invalid stage It s very similar to the tracing extension we looked at earlier. However instead of writing the SOAP message to a file this extension is capable of using DES encryption to both encrypt and decrypt the SOAP message. Here s the Encrypt routine that is called private void Encrypt 0 if encryptMode newStream EncryptSoap newStream Copy newStream oldStream If

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.