我正在使用KSOAP2来使用WCF Web服务,但它给了我一些例外 我的要求如下
03-06 12:13:27.500: D/RequestDump is :(29065): <v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"><v:Header /><v:Body><CreateNewUser xmlns="http://tempuri.org/" id="o0" c:root="1"><adminUserName i:type="d:string">khurram@office365trial.com.au</adminUserName><adminPassword i:type="d:string">friday@123</adminPassword><user i:type="n0:User" xmlns:n0="http://tempuri.org/"><AlternateEmailAddress i:type="d:string">bilal@gmail.com</AlternateEmailAddress><ErrorMessage i:null="true" /><FirstName i:type="d:string">bilal</FirstName><ForcePasswordChange i:null="true" /><IsLicensed i:null="true" /><LastName i:type="d:string">nasir</LastName><NewPassword i:null="true" /><ObjectId i:null="true" /><UserDisplayName i:null="true" /><UserPrincipalName i:type="d:string">bilal</UserPrincipalName></user></CreateNewUser></v:Body></v:Envelope>
这给了我以下回复
03-06 12:13:27.505: D/ResponseDump is :(29065): <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 http://tempuri.org/:user. The InnerException message was 'Error in line 1 position 485. Element 'http://tempuri.org/:user' contains data from a type that maps to the name 'http://tempuri.org/:User'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'User' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Error in line 1 position 485. Element 'http://tempuri.org/:user' contains data from a type that maps to the name 'http://tempuri.org/:User'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'User' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.</Message><StackTrace> at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract)
任何想法发生了什么???