各位,遇到一個問題,d7使用idhttp,發送post請求webservice介面,用網上的模擬介面是沒問題的,但是訪問公司的服務就出問題:報 HTTP/1.1 500 Internal Server Error?百思不得其解!!!
http://192.168.5.10//DeviceInterface/DeviceInterface.asmx/DeviceInformation_Coating
DeviceInfo_Coating={"MachineID": "ABC-001","RunTime": "3500","DateTime": "2020-10-20 21:50:00","Status": "0","DetailsInfo": [{"ItemCode": "909","Result": "OK","Value": "","Remark": "正常"}]}
***************************
log@2020-10-26 08:13:16>>
發送資料:Verify_BarcodeInfo_Coating={"OperatorID": "113671","MO": "000082165563_1","Barcode": "2102312FGVLUL8001524","MachineID": "ABC-001","DateTime": "2019-11-30 14:13:02"}
介面例外:HTTP/1.1 500 Internal Server Error
***************************
uj5u.com熱心網友回復:
你這個是內部服務器錯誤,換個簡單說法就是你的webservice服務在處理的時候出現了例外。原因應該是你的服務程式內部的程序可能有問題(包括處理接收到資料的容錯)。
uj5u.com熱心網友回復:
好的,會不會我這邊發送的的引數對方容錯沒處理,導致的例外?我往這個方向也查查!
uj5u.com熱心網友回復:
弟兄們,我的問題解決了!經過現場核查,發現對方服務采用asp.net寫的,然后呼叫測驗頁,發現只支持本地計算呼叫,然后發現說明里面只有soap說明,同時采用apipost呼叫過介面測驗,會報錯!故懷疑不支持httpost。所以要求對方檢查web.config,發現么有支持httpost的配置!故要求在web.config的<system.web></system.web>中間加入如下配置節內容
<webServices>
<protocols>
<add name="HttpSoap"/>
<add name="HttpPost"/>
<add name="HttpGet"/>
<add name="Documentation"/>
</protocols>
</webServices>
重新啟動服務后!很激動的事情發生了!
uj5u.com熱心網友回復:


轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/192735.html
標籤:網絡通信/分布式開發
