建立Windows server時呼叫web service介面時的幾個問題
阿新 • • 發佈:2018-12-13
問題1:提供的 URI 方案“https”無效,應為“http”。 引數名: via
解決方案:
在app.config配置檔案中,搜尋“https”,把"Https”全部修改為“http”;
<httpsTransport authenticationScheme="Basic" />
修改為:
<httpTransport authenticationScheme="Basic" />
問題2:在呼叫web service介面時,報接受伺服器超時問題,
解決方案:設定超時時間,加大超時時間
<binding name="ZHRIOA09_binding" sendTimeout="00:30:00" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00">
問題3: MaxReceivedMessageSize:已超過傳入訊息(65536)的最大訊息大小配額
解決方案:擴大訊息配額
<httpTransport authenticationScheme="Basic" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
最後的配置程式碼如下:
<bindings> <customBinding> <binding name="ZHRIOA09_binding" sendTimeout="00:30:00" closeTimeout="00:30:00" openTimeout="00:30:00" receiveTimeout="00:30:00"> <textMessageEncoding messageVersion="Soap11" /> <httpTransport authenticationScheme="Basic" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> </binding> <binding name="binding_oa08"> <textMessageEncoding messageVersion="Soap11" /> <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" authenticationScheme="Basic" maxBufferSize="2147483647" /> </binding> </customBinding> </bindings>