在Android中使用WCF服务时的参数异常

时间:2015-08-04 06:17:56

标签: android wcf exception ksoap2

我一直在使用KSOAP2 SOAP实用程序来使用WCF服务,从中我可以准确地获取数据。我甚至可以将原始类型发送到服务器,但是当我尝试发送复杂类型(类对象的列表列表)时。它向我展示了以下异常。

<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:InternalServiceFault</faultcode>
     <faultstring xml:lang="en-US">Parameter is not valid.</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 i:nil="true"/>
         <Message>Parameter is not valid.</Message>
         <StackTrace>at System.Drawing.Image.FromStream(Stream stream,     Boolean useEmbeddedColorManagement, Boolean validateImageData)&#xD;
   at LoopInfra.WebHost.InfraManager.SaveVisitInfraDetail(List`1        lstInfraVisit, Int32 VisitMasterId)&#xD;
   at SyncInvokeSaveVisitInfraDetail(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object        instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at        System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin       (MessageRpc&amp; rpc)&#xD;
   at                     System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5     (MessageRpc&amp; rpc)&#xD;
   at       System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41     (MessageRpc&amp; rpc)&#xD;
   at      System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4     (MessageRpc&amp; rpc)&#xD;
   at      System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31    (MessageRpc&amp; rpc)&#xD;
  at       System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3     (MessageRpc&amp; rpc)&#xD;
  at      System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2     (MessageRpc&amp; rpc)&#xD;
   at     System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11     (MessageRpc&amp; rpc)&#xD;
   at      System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1     (MessageRpc&amp; rpc)&#xD;
  at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean     isOperationContextSet)        </StackTrace>
                    <Type>System.ArgumentException</Type>
           </ExceptionDetail>  
         </detail>
      </s:Fault>
    </s:Body>
</s:Envelope>

我已经实现了DataContractResolver以及KnownType来解决,但它不适用于我们。

0 个答案:

没有答案