簡體   English   中英

具有NuSoap和C#的UTF-8!= utf-8

[英]UTF-8 != utf-8 with NuSoap and C#

我正在使用Xamarin使用CodeIgnitor后端制作Android APP。 對於肥皂連接,我正在使用NuSoap。 最初,我收到有關不支持UTF-8的錯誤,但是通過添加$ this-> nusoap_server-> soap_defencoding ='UTF-8'並更改了NuSoap中的幾個似乎不使用這些設置的位置來解決此問題。

我沒有收到下面的錯誤,由於大小寫原因,我第一次猜到了,但是我不確定。 它似乎僅在發送復雜類型時發生。

System.AggregateException
HResult=0x80131500
Message=One or more errors occurred.
Source=System.Private.CoreLib
StackTrace:
  at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
  at System.Threading.Tasks.Task.Wait()
  at tbq_test.Program.Main(String[] args) in 
  D:\WebSites\Projects\tbq-test\tbq-test\Program.cs:line 20

Inner Exception 1:
ProtocolException: The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).

嘗試添加

header('Content-Type: text/xml; charset=utf-8');

從PHP發送數據之前。 您的錯誤抱怨預期的響應內容類型不匹配。 您正在發送text/html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM