尚豪's profile來自巴哈姆索拉星球的內江先生PhotosBlogListsMore Tools Help

尚豪 紀

Occupation

來自巴哈姆索拉星球的內江先生

May 20

Last working day in Microsoft

今天是我在微軟的最後一天,
差不多也快四年了, 感覺還滿快的
四年,
有了兩個小孩, 買了房子, 買了車子,進入了一種完全不同的人生階段
四年,
跟不少厲害的人共事, 見了許多不同的客戶跟專案, 不管是技術上, 還是business上, 還是專案上, 都長了不少見識
 
不論如何,
最後還是決定了,
祝福微軟的同事們事業順利,  UT填不完. balance your life and work as well as fun and functionality.
 
也希望我可以盡快適應下一個工作.
 
另外...
今天的離職流程跑得之順利...跟Alex講的不一樣啊...真是讓我大吃了一斤...:-P
April 27

[BizTalk]Could not store transport type date for Receive location

I got this error message when trying to deploy BTS assembly and to Stop/Start existing applicaiton.

Could not store transport type data for Receive Location ‘Recv.Loc’ to config store. Primary SSO Server ‘Sql-server’ failed. The external credentials in the SSO database are more recent.

This error occurs due to the system date is not in correct date, I did change the system date for some tests, so to correct SSO db, execute the following script against SSO db.

update SSODB..SSOX_ExternalCredentials 
set  ec_timestamp = dateadd(m,-1,ec_timestamp) 
where datediff(m,ec_timestamp,getdate())<>0 

update SSODB..SSOX_ExternalCredentials 
set  ec_timestamp = dateadd(year,-1,ec_timestamp) 
where datediff(year,ec_timestamp,getdate())<>0
April 22

[WCF]CommunicationException when invoking Web Service via WCF Client

I added aweb service as a Service Reference in VS2008, while invoking, a CommunicationException was thrown indicate that WCF could not serialize response message due to XmlNameTable legth exceed maxinum allowed.

CommunicationException can be throw in various scenario. In my case, the exception message has indicate that XmlNameTalbe name has exceed the max length.

We can fix this by modifying app.config.

Open the app.config, find the basicHttpBinding section(since this is a regula web service, it has to be basicHttpBinding). Find related attribute and change the value to an acceptable value. In my case the attribute will be [maxNameTableCharCount]

    <bindings>
      <basicHttpBinding>
        <binding name="WebService_SIPSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
          receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="2147483647" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

[WCF][VS2008] How to add web reference in VS2008

Right click on [Server Reference] then [Add Service Reference…]

sc_1.jog

On the Popup dialog, Click on [Advenced…]

sc_2

Click on [Add Web Reference…]

sc_3.jog

Now you can add Web Reference here

sc_4.jog

April 17

[SQL] Could not open a connection to SQL Server Error 53 while setting up Linked Server on SQL 2005

When trying to setup Linked Server on SQL 2005, I got [Name Pipe Provider: Could not open a connection to SQL Server [53]] error message.

Error 53 is basically a OS level error which maps to ERROR_BAD_NETPATH (network path not found). Which usually means that the SQL process have no access to remote server you are trying to connect. So here are some thing you may want to check first.

  1. Check if your SQL service account has network access.
  2. Check if your SQL server is able to resolve the remote server name. If not, add a record to host file, or add an alias for the remote server in SQL configuration Manager.
  3. Force using TCP/IP procotol instead of named pipes by prefixing the server name with “tcp:” or by setting protocol order via SQL Configuration Manager
April 16

[VPC] Disable host time sync

I happen to have a PDC (Windows Server 2003 R2) inside a VM running on Virtual Server 2005. For testing purpose, we have to forward it’s time clock to 1 month after. To fully disable timesync feature on the VM. We have to  disable time sync feature of the OS and of the Virtual Server.

To disable time sync of Virtual Server 2005, open the Virtual Server 2005 management console, there’s a checkbox on the [Virtual Machine Additionals] tab, simply shutdown the OS, check this option and restart the VM.

To disable time sync of a PDC, which is more cpmplicate since a root PDC is also a time server for it’s AD. Follow the instruction to configure time service on the PDC.

In additional, to disable host time sync in VPC 2007, open the .vmc file via notepad, it’s a xml formatted document, add the following elements to the file or modify existing element.

<integration> 
    <microsoft> 
        <mouse> 
            <allow type="boolean">true</allow> 
        </mouse> 
        <components> 
            <host_time_sync> 
                <enabled type="boolean">false</enabled> <!—- add here… --> 
            </host_time_sync> 
        </components> 
<!-- other settings -->
    </microsoft> 
</integration>
April 09

[SQL] FOR XML Clause and ExecuteScalar()

When reterive data via ExecuteScalar() against a SQL statement with FOR XML Clause, you may find that return value is truncate at 2033 characters.

SQL Server 2005 seperates xml result into multi rows of 2033 characters each when FOR XML clause creates xml data greater than 2033 characters.

To avoid this behavior from impact you code, use other Execute() method instead and concate each row in code, or, in your stored procedure declare a variable in xml type, select this variable instead of select directly.

Declare @xml xml
set @xml = (Select …… for Xml raw,Elements)
select @xml
February 09

[Windows7] Office 2007 on Windows 7

Office 2007 prompt the following error on Windows 7

登錄VB Script DLL 失敗,請重新安裝或執行 Regsvr32.exe Vbscript.dll 來進行登錄

And this error stills even if I register vbscript.dll with Regsvr32.exe.

This error occurs due to the incompatible between OS language and Office language, but we can fix this by correcting Office’s language setting via [Start]->[Programs]->[Microsoft Office]->[Microsoft Office Tools]->[Office 2007 Languages]

Capture

Just correct the language setting here and you office 2007 should be working fine with Windows 7.

[BizTalk] Promote Property in Orchestration

We can easily promote properties in pipeline by code, but how can we promote properties in orchestration ?

Although BizTalk does not provide a built-in function to do this, we can still promote properties in an Orchestration by creating a correlation set and initialize the created correlation set in a send shape (in Direct binding scenario). We don’t have to create a following-correlation-set since the created correlation set is only for promoting properties, not for correlation.

Note that, a correlation set is a set of properties which Orchestrations subscribe them for correlation, since these properties has to be subscribed for routing purpose, these properties are automatically promoted when they were added into a correlation set.

February 04

[BizTalk] Invoke web service dynamically in Orchestration

There’re times you have to invoke various web method of one single web service in orchestration. To create a dynamic send port is not a solution since the [Operation] name of the dynamic send port has to be exactly the same with the web method you are to invoke.

However, this can be done with a static SOAP send port.

First we create a webservice proxy assembly, and setup a SOAP send port with the assembly specified in SOAP Adapter configuration page. Note that in the [Method] combobox, we have to select [Specify later]

Now return to your orchestration, create a configured port on the port surface, and a [Expression] shape before [Send] shape.

In [Expression] shape, use the following script to specify Method name of the proxy class.

outputMessage(BTS.MethodName) = "YourWebMethodName";

[BizTalk] Transform dynamically in Orchestration

To dynamically transform one message to another, we need to create mapper object on our own rather then use the Transform shape provided by BizTalk Server.

When we create and deploy a BizTalk Mapper, BTS Engine compiles the created mapper (btm file) into a .Net type, so what we need to do is to obtain the mapper class type and then invoke BizTalk buildin function “transform”to do the transformation.

To obtain mapper type, simply drag an Expression shaep into the orchestration and type the following script in it

var_mapper = Type.GetType(MapperFullQualifiedName);

And in a [Construct Message] shape

transform(outputMessage) = var_mapper(inputMessage)

(紀小弟和紀二寶的)寶寶日記 - 鵝口瘡 + 泡疹

初四初五左右
紀二寶突然變得會抗拒喝奶
嘴巴裡也長了很多白色的東西,嘴角、舌頭和口腔四周也有發腫破洞
而紀馬麻的乳頭也似乎被感染到
不但變得紅腫
餵奶時也有刺痛的感覺
大人小孩都不舒服的狀況下
紀二寶更是不喝奶
結果也才一天
臉頰就瘦了一圈 :-(
DSC02962
上網估狗的結果,這似乎是鵝口瘡
帶給三重附近的醫生檢查也是同樣的答案
醫生開了種塗抹的藥
試著塗了幾天
好像有比較好
但是紀二寶嘴裡的破洞仍然沒有痊癒

而且似乎破洞越來越痛的樣子
雖然知道他很餓
但是只要把奶嘴塞給他
他舌頭舔了一下
就痛得撇過頭不肯吸
看著他越來越瘦
實在很難過
 
於是趁著收假第一天帶著紀二寶到長庚去看醫生
雖然是掛到32號,等看到我們的時候已經是中午十二點多的
顏盟修醫生看上去雖然已是滿臉倦容
卻還是很合顏悅色的檢查了紀二寶的嘴巴
[鵝口瘡看起來已經差不多好了]他說[不過這個泡疹還沒有痊癒]
我是第一次看到一個醫生用這種關心的眼神對我解釋病情
在此再次推薦這位台北長庚醫院的兒童內科的醫生 - 顏盟修醫生
[不過,因為寶寶才三個月,也沒有辦法使用甚麼藥物,我先開個不含類固醇的止痛劑給他噴,讓他比較好喝奶]
[泡疹一般是七到十天可以痊癒,現在已經四天了,我想應該就讓小朋友的抵抗力自己來痊癒就可以了]他說

開春第一天
也是紀二寶到新保母家的第一天
我跟保母簡單的交代了一下紀二寶的狀況
請他幫忙多看看
因為明天開始又要到高雄去住一個禮拜
心裡其實很不放心


當晚
噴了止痛藥的紀二寶似乎真的比較不痛了
奶嘴塞給他
雖然還是會抗拒
但是終於願意喝奶了
我看著懷裡邊喝邊張大著眼睛盯著我的小臉蛋
眼睛突然就跑進不知哪來的沙子了…
DSC02980
二寶
你不會知道看到你又願意喝奶
把拔心裡有多開心啊…

(紀小弟和紀二寶的)寶寶日記

紀二寶的名字依舊是在同一家命相館裡決定了
同樣的地點
同樣的時間
同樣的老師
連說的內容好像也差不多
老師這行
應該是景氣之下
少數幾個不會受影響
又可以輕鬆賺的行業了吧?
DSC02890
因為是餵母奶
半夜裡不必再被老婆的腳叫起來泡奶
不過也沒有睡得比較好
畢竟
小孩子在哭的時候
如果不起來表示一下關心的話
難保老婆不開心一腳踢過來…XD
再加上紀二寶的哭聲還滿宏亮的
常常是紀二寶一哭
把紀小弟吵醒了
之後就兩個一起哭
其實並沒有比較輕鬆…
 DSC02941
老婆好不容易做完月子
回桃園住了一個禮拜
然後我就開始南北奔波
幾乎是在高雄住了一個多月
這期間
只有老婆在娘家一個人顧兩個小朋友
到現在紀二寶滿三個月了
算算我們從老婆到醫院待產
到現在回家過年
好像也只有在自己家裡住了差不多一個禮拜的樣子
幸好老婆不但體貼、溫柔又識大體
並不會跟我發牢騷…(真的!)
又能幹
把紀二寶養的白白胖胖
三個月大的寶寶
看起來根本就跟紀小弟快一歲時差不多的樣子
老婆真是太了不起了啊啊啊啊啊啊啊啊啊
讓我再次高呼
老婆真行啊!!!
 DSC02974
不過
紀小弟看著天天都被馬麻抱在手上的紀二寶
免不了還是會忌妒
雖然常常對著紀二寶親密的底迪底迪的叫
但也常常有意無意的偷偷的搞一下紀二寶
不是趁馬麻抱著二寶喝ㄋㄟㄋㄟ時用力壓著紀二寶
就是偷偷趁打馬麻的時候手滑打到紀二寶
而紀二寶
只是溫和的阿咕阿咕兩聲抗議一下
就繼續閉著眼睛喝ㄋㄟㄋㄟ了
 DSC02887
紀二寶非常喜歡笑
只要有人抱著他讓他坐著
他就會開始咯咯的笑
還會阿咕阿咕的跟你對話
年初一時
紀二寶就這樣跟奶奶對話了半天
大概也沒甚麼人知道他們到底說了些甚麼
只知道紀二寶聊得挺開心的
一直唉咿的笑著
DSC02904

December 18

[BizTalk]Fail to retrieve master secrets when accessing BizTalk port configuration

I got [Fail to retrieve master secrets] error message while trying to disable a receive port via BTS Administration console.

This error indicates that the SSO service shomhow could not retrieve the account information from SSO database, generally speaking, this should not cause by incorrect user identity you are using to access database since if that's the case, error message should state that SSO could not connect to SQL server.

In my case, I duplicate a new BTS VM and try to make it work in an AD environment and forgot to create a new SID for the duplicated machine.

To solve this issue,

  • open command prompt, change directory to %\Program Files%\Common Files\Enterprise Single Sign-on
  • execute the following command
    • ssoconfig -restoresecret <SecretKeyFileName>
November 20

[BizTalk]Receive unexcepted message type in Orchestraion with SOAP Adapter

I was quite busy for the past few weeks, my wife gave birth to my second child, a lovely boy, we are now staying with my parents in law and has limited access to the internet. Which makes me diffcult to update this blog.

When invoking web service in orchestration via SOAP adapter, I got error states that unexcepted message type was received. The web service I am invoking has a return type of String, the event log shows that the orchestraion is expecting string, but WS.Response was received (or vice-versus, can't remember the detail).

This exception is thrown because when you create a SOAP port, BizTalk configure its receive pipeline as [Passthru pipeline]. A [Passthru] pipeline does not try to resolve message pass thru it, hence the SOAP response does not deserialize into string type.

To resolve this issue, simply change the receive pipeline of the SOAP port from [Passthru] to [XMLReceive].

 
Photo 1 of 12
謝謝您的瀏覽!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.