Category Archives: WCF

Web Service Testing tools – WCF Test Client

最近因為公司更換了Server ..但是又沒有好好設計到和舊的Server 一樣的關係, 令到公司其中一個WCF Web Services 出現了 Localisation 的問題…
這個Web Service 和 在CodePlex 上的 Crystal Report WCF Services http://crystalrptwcfservice.codeplex.com/ 的差不多.. 只是加了更多和公司相關的功能入去..方便公司生產在Web Site 上 便用這個 Web Services 來生產 PDF..
由於這個Web Services 把公司用開的英鎊符號..變成了美金…
所以常常都使用WCFTestClient來測試這個Web Services..
最初我懂得在Visual Studio 上在WCF Debug 時便用這個WCFTestClient..
之後在上面加入要測試的Web Services Address..

今天我終於找到了這個WCFTestClient.exe 存在那裡..
現在建立了一個Desktop Short-cut 方便自己將來調試更多的Web Services
大家可以在這個路徑上找到..十分好用的…
當我在測試其他WCF或Web Service時我也使用他的
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\WCFTestClient.exe


Hope you find it useful

*最後解決這個Localisation 問題的方法是在這個WCF Services上的IIS 更變一些有關Localisation 的設定..從啟主機後便解決了這個問題

Crystal Report WCF Services 序

昨天公司有一個客戶希望我們可以在公司的客戶Portal 上加入一個新的功能…
就是可以樣客戶在我們的Portal上直接Generate一些Report..
很可惜公司還未開始使用Microsoft SQL ServerReporting Services [SSRS]..
而是使用Crystal Report 來做這個動作的…
但是…我們又沒有買Crystal Report Server來產生Report…
現在的做法是會在我們的電腦上安裝一個Crystal Report的Runtime
去令到所有同事都可以用我們的In-House Application 來生產Report…
最後終於想到了解決方法…
就是寫一個WCF 的Service來負責生產Report…
之後再把生產出的的Report Path..
發送給Web Portal令到便用者可以Download這個Report…
當我有時間時會整理一下我的筆記…
再和大家分享如何寫一個WCF Service來解決這個 Crystal Report的問題
待續 =)

Run SSIS Services From Client Machine How to use SSIS WCF Services Part I—在客戶端中使用SSIS Services 怎樣使用SSIS WCF Services Part I

今日想在這裡和大家分享怎樣發佈 這個SSIS WCF Services
大家可以到CodePlex Download 這個Zip 檔案

http://ssisservices.codeplex.com/releases
Download 完成後我們可以把檔案解壓縮到一個地方儲存..
以備一會兒使用

以下這個例子是用Windows 7中的IIS 7.5 來做的
使用這個SSIS WCF Services 的 系統一定要已安裝 SSIS Services
因為我們需要通過這部電腦的 來執行SSIS Package

首先我們要在設定好IIS…
1) 我們可以 以”Start” -> “Control Panel” ->”Administrative Tools” ->”Internet Information Services (IIS) Manager”  我的這個例子是使用Windows 7 中的 IIS 7.5

2) 在” Default Web Site” 中 按右鍵 -> 選擇 ->”Add Application…/加入應用程式

3) 在”Add Application” 視窗 填入適當的資料 , “Physical Path…” 中選擇之前 “SSISServices.zip” Download 完成後解壓縮到的地方, 之後按 “OK/確定

4) 之後你便可以看到剛剛建立的”Web Application“, 按一下”Content View” 分頁

5) 選擇 “SSISServices.svc” 檔案後, 用右鍵 按一下 “Browse/瀏覽

6) 之後電腦便會在”瀏覽器“中把開這個SSIS WCF web services

7) 按一下WSDL 連結後便會看到 WSDL 的內容了

之後你便可以把 這個SSIS WCF Services 加進到你的 Project上使用了

Hope you find it useful

SSIS WCF Services on CodePlex — Execute SSIS Package Via Web Services

今日終於在CodePlex 上和大家分享了我第二個Project了
這個Project 是一個WCF Service, 如果執行 SQL Server Integration Services [SSIS] 的…
在大概一年多前才剛剛在朋友身上學會了使用 Data Transformation Services [DTS]
一個在SQL Server 2000 或之前版本的 SQL 功能
令我們可以寫一些DTS Package 之後在自己寫的.Net Application 上執行..
最好的地方是可以在客戶端執行..
又不需要客戶端的電腦上安全 SQL Server 2000 有關DTS 的元件
當然要在你的 Project 上的安裝包上做一些動作
令到 用戶在安裝程式時 把適當的 DLL 複製到客戶的系統中…
而我對DTS 的認識不多…
所以當公司升級了SQL ServerSQL Server 2008 之後我便開始使用 SSIS
誰不知…當我把 之前寫的DTS Package 轉成了SSIS
當我在客戶的電腦了執行這功能時便出現錯誤信息…
嘗試了很多方法也解決不了…
到最後有朋友說要在客戶的電腦上安裝 SSIS Service 才可以執行SSIS Package
又說不可以在客戶的電腦上安裝SSIS Service 因為版權問題 …ETC
Please correct me if my concept is wrong
所以最後便想到用WCF 的做法…
做一個服務端來解決 SSIS 的問題了..
如果大家遇到差不多的問題 可以嘗試用這個SSIS WCF Services 看看能不能解決你的問題
或者如果你有更好的解決方案..希望你能夠和我們分享
SSIS Service
ShareChiWaiLib
當我有空的時候會在程式碼中加入註解
和寫多一些文章關於怎樣使用這個 SSISServicesShareChiWaiLib
希望大家可以給我一點Feedback 令到這個2個Projects 更完美
Happy coding =)

HTTP Error 500.21 – Internal Server Error – Handler “svc-Integrated” has a bad module “ManagedPipelineHandler” in its module list when try to deploy WCF to IIS

After fixing the HTTP Error 404.3, I have refreshed my application then I have received another error

Error Summary
HTTP Error 500.21 – Internal Server Error
Handler “svc-Integrated” has a bad module “ManagedPipelineHandler” in its module list
Error Code    0x8007000d

Fortunately, I have managed to fix it.

Here it is the solution:

1) Click on “Start” -> “Run” -> Enter “cmd” to launch “Command Prompt

2) Type: “C:” and press “Enter

3) Enter the following command on the command prompt
cd “WINDOWSMicrosoft.NETFrameworkv4.0.30319” <-for 32bit machine
cd “WINDOWSMicrosoft.NETFramework64v4.0.30319” <-for 64bit machine
The version number maybe different on different machine, at the moment the .net framework which installed on my machine is v4.0.30319.
If you could not found it you can try to use the search feature on Windows to local “aspnet_regiis.exe” file
4) Then you can enter the following command to register asp.net to your IIS server
aspnet_regiis.exe -i

Once you have installed it you should be able to view the WCF service which you deployed to your IIS server.

Hope you found it useful

HTTP Error 404.3 – Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Error Code 0x80070032. When try to use IIS to host WCF services

When I try to deploy the WCF application which I created in VS2010 to the development machine that is using Win7 64bit and IIS 7.5, I have received the following error message.

HTTP Error 404.3 – Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Error Code: 0x80070032

As I am a absolute beginner in creating a WCF. I have no idea what have a done wrong.
I used Microsoft Web Platform to set up the IIS Web Server and then I published into a file system, so that I can copy and paste it to the web-server like what I did when I publish a web-application.
Finally I have realise it is something to do with the extension configuration / MIME map. I guess something is missing on the web server.

Here it is the solution.
1)  Click on “Start” Menu -> “Control Panel” -> “Programs and Features
or paste the line below, onto your address bar and press Enter
 “Control PanelAll Control Panel ItemsPrograms and Features

2) Click on “Turn Windows features on or off
3) On the “Windows Features” window,
4) Expands “Microsoft .Net Framework 3.5.1” or “Microsoft .Net Framework 3.0” depends on which version of windows you are using
5) Tick “Windows Communication Foundation HTTP Activation”  and “Windows Communication Foundation Non-HTTP Activation
6) click “OK” and try to refresh the webpage.

If you are using older version of Windows Server E.g. 2003/ WinXP, you can try to use command prompt.
1) Click on “Start” -> “Run” -> Enter “cmd” to launch “Command Prompt
2) Type: “C:” and press “Enter
3) Enter the following command on the command prompt
cd “windowsMicrosoft.NetFrameworkv3.0Windows Communication Foundation”
4) Then you can enter the following command to setup WCF on your computer.
servicemodelref -i

5)Then you should see a similar screen as above.

If everything setup properly on you server, you should be able to view the WCF service you have deployed to the IIS.

However…Once I solved the HTTP Error 404.3 error I have received another error like below.

HTTP Error 500.21 – Internal Server Error
Handler “svc-Integrated” has a bad module “ManagedPipelineHandler” in its module list
Error Code 0x8007000d

I will explain how I solve it in my next post.
HTTP Error 500.21 – Internal Server Error Handler “svc-Integrated” has a bad module “ManagedPipelineHandler” in its module list

Hope you found it useful

The request channel timed out while waiting for a reply after 00:00:57.6118634. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

I am working on a application, which need to consume a web-service which is provided by another company. When I try to make a Web-service request/RPC call, I have received a timeout exception from my application.
The request channel timed out while waiting for a reply after 00:00:57.6118634. Increase the timeout value passed to the call to Request or increase the Timeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

I guess, it is something to do with their web-service, E.g. the web service did not work properly and it used to work in Visual Studio 2005 [I am using Visual Studio 2008 for this application]. When I check the application config file. I have found something interesting, which is related with timeout. Then I have figured out what is causing the timeout exception. =).


Here it is my solution:
To resolve the timeout exception, you can simply increase the timeout value to a appropriate time, which will not affect the performance of your application. E.g. If you set the timeout value too high, when the web-service do gone down, your application will waste lots of time, because it think the web-service is doing something.

For my application, I have updated the timeout value to 3 minutes which is 00:03:00. [hh:mm:ss].

Hope you find it useful. =)