我从服务获得以下SOAP响应...
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetSomethingResponse xmlns="http://namespace/services">
<GetSomethingResult xmlns:a="http://namespace/model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:SomethingData>
<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<Persons xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Person>
<Name>John Doe</Name>
</Person>
<Person>
<Name>Jane Doe</Name>
</Person>
</Persons>]]>
</a:SomethingData>
<a:ExampleProperty1>0</a:ExampleProperty1>
<a:ExampleProperty2>0</a:ExampleProperty2>
<a:ExampleProperty3>0</a:ExampleProperty3>
</GetSomethingResult>
</GetSomethingResponse>
</s:Body>
</s:Envelope>
SomethingData
,ExampleProperty1
,ExampleProperty2
和ExampleProperty3
都是来自WSDL的字符串数据类型。
有什么办法可以告诉DataContractSerializer
自动反序列化SomethingData中的XML?