2013-01-17 52 views
0

我在iOS應用程序中使用sudzc soap客戶端。sudzc soap客戶端反序列化錯誤

這裏是肥皂方法聲明

(SoapRequest*) UploadData: (myid <SoapDelegate>) handler myid: (NSString*) myid props: (NSString*) props

例如,如果我通過字符串中的第二個參數 「<測試>」,我得到以下錯誤:

a:DeserializationFailed The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'UploadData'. End element 'props' from namespace 'http://tempuri.org/' expected. Found element 'test' from namespace 'http://tempuri.org/'. Line 1, position 338.

爲什麼可以」 t sudzc處理「<」或「>」字符串參數?我必須手動轉義這些字符嗎?

回答

0

我不認爲這個錯誤是關係到iOS或sudzc發電機。 SOAP使用XML進行數據傳輸,因此您必須根據XML spec編碼任何特殊字符。請參閱following answer

+0

我的理解是肥皂在內部逃脫所有的特殊字符。你的意思是說,字符串參數不能有< or > char? –

+0

SOAP不是一個庫,它只是一個基於XML的標準。因此,如果庫(在你的情況下爲sudzc)支持字符轉義,它會轉義它們。否則,你應該照顧逃跑。 – kovpas

+0

我知道什麼是SOAP。雖然你沒有回答我的問題。 –