[英]The request failed with HTTP status 401: Unauthorized while calling web service
[英]Request format determination failed in soap service while calling rest service
我試圖調用在SOAP服務中使用WebChannelFactory創建的REST服務。 我正在使用.net Framework 4.0。
我的請求格式有問題。
單元測試和樣本aspx頁面按預期工作。 但是,當以soap方法調用rest服務時,請求格式設置為xml而不是json。
它看起來像用於新的rest標頭的soap內容類型請求標頭。
在出現如下要求之前,我們為休息環境選擇了新的OperationContextScope。
using (OperationContextScope scope = new OperationContextScope((IContextChannel)proxy))
{
proxy.myMethod();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.