顯示具有 WCF 標籤的文章。 顯示所有文章
顯示具有 WCF 標籤的文章。 顯示所有文章

2014年8月27日 星期三

[WCF] WebClient post api

用於測試WCF資料,作為客戶端傳送資料到wcf

  1. string data = @"
  2.                    {
  3.                             ""B"" : ""88888888-4444-4444-4444-121212121212"",
  4.                             ""QID"" : ""0610a3ac-4262-4b1b-aa23-3a16edb5c7b3"",
  5.                             ""QID"" : ""1ae67bee-e819-451d-bc20-54dffdf839b8"",
  6.                             ""Anr"" : """",
  7.                             ""Der""  : ""54026fee464f7456"",
  8.                             ""An"" :""1c440ab1-7b00-4dcc-8faa-e1c3f1375eb9""
  9.                    }";
  10.             WebClient webClient = new WebClient();
  11.             webClient.Headers["Content-type"] = "application/json";
  12.             webClient.Encoding = Encoding.UTF8;
  13.             webClient.UploadString("http://localhost:3415/WcfService.svc/TEST", "POST", data);

2014年7月23日 星期三

[WCF Error] 發佈上IIS,呼叫某支API出錯 : The underlying provider failed on Open


WCF發佈到IIS,Call某支出錯~










關鍵字 : The underlying provider failed on Open


原因 :

因為使用EF時,連線用Windows authentication,但IIS找不到此USER,因此請改用sql帳密登入。

請將
integrated security=True;
置換
persist security info=True;user id=xxx;password=xxx;


參考
http://stackoverflow.com/questions/2475008/the-underlying-provider-failed-on-open
http://th2tran.blogspot.tw/2009/06/underlying-provider-failed-on-open.html