クライアントがC#コンソールアプリケーションの場合に機能するWCFサービスで以下のデータコントラクトを使用しています
[DataContract]
public class PersonField
{
private string _fieldName;
private object _fieldValue;
public PersonField()
{
}
public PersonField(string FieldName, object FieldValue)
{
_fieldName = FieldName;
_fieldValue = FieldValue;
}
[DataMember]
public string FieldName
{
get { return _fieldName; }
set { _fieldName = value; }
}
[DataMember]
public object FieldValue
{
get { return _fieldValue; }
set { _fieldValue = value; }
}
}
しかし
SOAP UI(http://www.soapui.org/)から試してみると、次の応答が返されます
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode>
<faultstring xml:lang="en-US">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter entities. The InnerException message was 'Element FieldValue from namespace http://schemas.datacontract.org/2004/07/Entities.Person cannot have child contents to be deserialized as an object. Please use XmlNode[] to deserialize this pattern of XML.'. Please see InnerException for more details.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
WCF で型オブジェクトを使用できませんか?