這是專案最近遇到的一個問題,還是將它記錄下來以免忘記.

若您是使用純 .NET Solution 的朋友,可以忽略它,因為 .NET 程式本身呼叫是不會有這個問題的.

 

在一個大型的專案中,Web Services 都很容易會有兩台以上的機器的部署.

架構是 Client => L4 Switch => Web Services => Database (Cluster)

https 到 L4 switch 後轉為 http 到 web services,所以 web services 收到的為 http 的 request

所以它在回給前端的 WSDL 中的 soap:address location=”http://…”

Client 收到的 URL 為 http,再拿這 URL 來呼叫即會被 L4 Switch 擋下來,因為它只允許 https 來連接

可以透過三步驟將其替換為 https

1. 新增一個 class,繼承自 SoapExtensionReflector並 override ReflectMethod

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services.Description;

namespace ChangeSoapAddressDemo
{
    public class SoapAddressReflector : SoapExtensionReflector
    {
        public override void ReflectMethod()
        {
            ServiceDescription sd = ReflectionContext.ServiceDescription;

            foreach (Service service in sd.Services)
            {
                foreach (Port port in service.Ports)
                {
                    foreach (ServiceDescriptionFormatExtension extension in port.Extensions)
                    {
                        SoapAddressBinding address = (SoapAddressBinding)extension;
                        address.Location = RemapHttpReferencesToHttps(address.Location);
                    }
                }
            }
        }

        private string RemapHttpReferencesToHttps(string location)
        {
            return location.Replace("http:", "https:");
        }
    }
}

 

2. 在 web.config 中加入下列的設定

<webServices>
        <soapExtensionReflectorTypes>
          <add type="ChangeSoapAddressDemo.SoapAddressReflector, ChangeSoapAddressDemo"/>
        </soapExtensionReflectorTypes>
      </webServices>

 

3. 瀏覽 WSDL,即可看到 soap:address location=”https://…”

image

Enjoy

anISV 發表在 痞客邦 留言(0) 人氣()

Microsoft® PowerPivot for Microsoft® Excel 2010 provides ground-breaking technology, such as fast manipulation of large data sets (often millions of rows), streamlined integration of data, and the ability to effortlessly share your analysis through Microsoft® SharePoint 2010.

 

下載位置:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e081c894-e4ab-42df-8c87-4b99c1f3c49b

anISV 發表在 痞客邦 留言(0) 人氣()

Windows HPC Server 2008 R2 provides a scalable, reliable, and secure interactive application platform that empowers developers to rapidly develop and easily modify cluster-enabled interactive applications that are based on the Service Oriented Architecture programming model.


This article provides a technical overview of cluster-enabled SOA application development. The HPC Class library includes the APIs that a client application can use to create sessions on the cluster. The APIs support creating reliable sessions and client interaction models such as file and recollect, batch, and shared session clients. This article also addresses the service configuration file, the Windows HPC infrastructure that supports SOA workloads, and broker node and session management and monitoring.

 

下載位置:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2eee1981-c0b9-4a19-859d-73755ea898e7

anISV 發表在 痞客邦 留言(0) 人氣()

This paper is the fifth in a series titled "A Guide to Data Governance for Privacy, Confidentiality, and Compliance." In it, we examine how data governance challenges change when organizations opt to use cloud-based services, and how the framework and techniques presented in the whitepaper and webcast ‘Managing Technological Risk’ can be applied in the new context.

 

下載位置:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b4a346bc-7038-470b-874b-3cee568cb9fa

 

Enjoy.

anISV 發表在 痞客邦 留言(0) 人氣()

Internet Explorer 9 Beta Product Guide

This product guide outlines new features in Internet Explorer 9 Beta.

 

Internet Explorer Platform Preview

Test drive the new Internet Explorer 9 Platform via the Internet Explorer Platform Preview

 

Windows Internet Explorer 9 Beta for Windows Vista and Windows Server 2008

Windows Internet Explorer 9 lets your websites shine and perform just like native applications on your PC.

 

Windows Internet Explorer 9 Beta for Windows 7 64-bit Edition and Windows Server 2008 R2 64-bit Edition

Windows Internet Explorer 9 lets your websites shine and perform just like native applications on your PC.

 

Windows Internet Explorer 9 Beta for Windows Vista 64-bit Edition and Windows Server 2008 64-bit Edition

Windows Internet Explorer 9 lets your websites shine and perform just like native applications on your PC.

 

Windows Internet Explorer 9 Beta for Windows 7

Windows Internet Explorer 9 lets your websites shine and perform just like native applications on your PC.

 

Headers and Libraries for Windows Internet Explorer 9 Beta

This package contains header files and libraries to help you develop Windows applications that use Windows Internet Explorer 9 Beta

 

Enjoy.

anISV 發表在 痞客邦 留言(0) 人氣()

Increase your application revenues with the new Microsoft Advertising SDK for Windows Phone 7. The SDK allow easy integration of text and banner ads into your application, and consumes ads served by Microsoft's mobile Ad Exchange, the first bidded ad exchange for mobile. The exchange includes multiple advertiser sales channels competing in real-time to purchase your ad inventory, incuding Microsoft’s national sales force and adCenter’s significant market footprint. Microsoft's best-in-class ad targeting solution means better click through rates and better monetization, and the new SDK is integrated with Microsoft pubCenter to give you actionable reporting of how ads are performing in your applications

下載位置:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b0f00afc-9709-4cc2-ba2c-57728db6cbd6

Enjoy.

anISV 發表在 痞客邦 留言(0) 人氣()

因為最近專案遇到一些問題,發現在程式 Content page 的 Page_Load 會被 Master page 的Page Laod 給蓋過,所以查了一下 Master Page 與 Content Page 一些事件的執行順序:

Master page controls Init event
Content controls Init event


Master page Init event
Content page Init event

Content page Load event
Master page Load event

Content page PreRender event
Master page PreRender event

Master page controls PreRender event
Content controls PreRender event

 

Hope this helps.

anISV 發表在 痞客邦 留言(0) 人氣()

在 ASP.NET 的網頁將 Grid 資料轉 Excel 檔格式供使用者下載,這是一個很常用的功能,

在自己的測試環境也測了 N 次,都沒有問題,但一將系統放到 Stage 的環境就無法使用,

得到的錯誤訊息為:

Internet Explorer 無法從 server 下載 file
Internet Explorer 無法開啟這個網際網路網站。可能是因為要求的網站無法使用或找不到。請稍後再試。

 

且用 FireFox 還是可以正常下載 Excel 檔,只有 IE 會有問題

心想這有可能是環境不同上的一些相關,因為 Stage 環境要使用 HTTPS.

於是搜尋了一下,果然,找到了一篇文章 Internet Explorer 無法從 SSL 網站開啟 Office 文件

剛好我們因某些需求將 ASP.NET 的網頁設為 No=Cache,再加上 SSL 即造成這個情況

解決的方式:

即是將這一個頁面不設定為 No-Cache

Hope this helps.

anISV 發表在 痞客邦 留言(0) 人氣()

在 C# 4.0 中筆者螿喜歡這個新功能,看下列的範例會較清楚它的用途

image

可以呼叫一個方法,動態選擇要給的參數有哪些,也可以不用全部的參數都給,沒有給的就算動怖上預設值

而且 Visual Studio IDE 本身會動態給使用者提示,如上圖,在第三個參數指定 name 的名稱,它就自動把提示轉換到對的地方給你看.

程式執行結果:

image

範例程式:

namespace NamedAndOptional
{
    using System;
 
    class Program
    {
        // A method with nameed and optional parameters
        public static void Search(string name, int age = 40, string city = "不惑")
        {
            Console.WriteLine("名子 = {0} - 年齡 = {1} - 城市 = {2}", name, age, city);
        }
 
        static void Main(string[] args)
        {
            // 標準寫法
            Search("Jacky", 18, "高雄市");
 
            // 省略 city 參數
            Search("Anders", 2);
 
            // 指定 city 參數, (省略 age 參數)
            Search("比爾大叔", city: "西雅圖");
 
            // 給定參數名稱, 順序不同
            Search(age: 45, city: "台北市", name: "丁丁");
 
            Console.ReadLine();
        }
    }
}

anISV 發表在 痞客邦 留言(0) 人氣()

今天同事在 Windows 7 上開發程式,因為使用 Trascation 所以要啟用  MSDTC,

由於 Windows 7 的畫面與 Windows 2003 有所不同,整理如下:

1. 使用『管理者』啟動 命令提示字元

image

2. 執行 msdtc –install ,以安裝 MSDTC

3. 由『電腦』=>『管理』=> 『服務』=> 確定 DTC 已啟動

image

 

4. Control Panel => System and Security

image

的 Administrative Tools

image

到 Components Service

image

展開到 Local DTC 按右鍵『Properties』

image

到 『Security』Tab ,確定 相關的權限都有啟用及設定

image

最後,習慣性的重新開機,以確定所有的設定皆已套用。

Enjoy


anISV 發表在 痞客邦 留言(2) 人氣()