简体   繁体   English

System.ServiceModel.FaultException - 如何解决这个问题

[英]System.ServiceModel.FaultException - how to solve this

I am standing up an API that connects to a WSDL for an imaging system.我正在安装一个 API,它连接到一个 WSDL 用于成像系统。 I can successfully make the call I am attempting with SoapUI, so there isn't an issue with the WSDL.我可以成功拨打我正在尝试使用 SoapUI 的电话,因此 WSDL 没有问题。 Before making the call that is throwing this exception I can successfully return the login session token (If I comment out this code I an release the session as well).在进行引发此异常的调用之前,我可以成功返回登录 session 令牌(如果我注释掉此代码,我也会释放 session)。 So I can communicate with the WSDL, just not this call.所以我可以和 WSDL 通信,只是不是这个调用。 I don't really understand this exception and online searches have just confused me more.我真的不明白这个例外,在线搜索让我更加困惑。

This is a .NET Core project (C#).这是一个 .NET 核心项目(C#)。

$exception {"Synergy Application Error"} System.ServiceModel.FaultException Action null string $exception {"Synergy Application Error"} System.ServiceModel.FaultException 操作 null 字符串

  • Code {System.ServiceModel.FaultCode} System.ServiceModel.FaultCode
  •  D HelpLink null string
  •  InnerException null System.Exception Message "Synergy Application Error" string
  •  Reason {Synergy Application Error} System.ServiceModel.FaultReason Source "System.Private.ServiceModel" string StackTrace " at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)\r\n at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n at Simnet.SimnetConnector.<GetCheckBySearchInteralAsync>d__1.MoveNext() in C:\\Repositories\\SynergyApi\\SynergyApi\\SimnetServices\\Session\\Checks\\GetCheckImageAsync.cs:line 29" string
  •  TargetSite {Void HandleReply(System.ServiceModel.Dispatcher.ProxyOperationRuntime, System.ServiceModel.Dispatcher.ProxyRpc ByRef)} System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}
  •  Static members
  •  Non-Public members
  •  this {Simnet.SimnetConnector} Simnet.SimnetConnector
  •  checkSearchDto {SynergyApi.Models.CheckSearchDto} SynergyApi.Models.CheckSearchDto sessionToken "I removed the sessioni token that was here" string
  •  e {"Synergy Application Error"} System.Exception {System.ServiceModel.FaultException}
  •  ex null System.Exception

Please help me understand this exception and how to fix it.请帮助我了解此异常以及如何修复它。 I have asked the other programmers at work and got an I don't know.我问过工作中的其他程序员,得到了一个我不知道的答案。

Here is the code that calls the wsdl这是调用 wsdl 的代码

    using System;
using System.Threading.Tasks;
using SimnetWebService;
using SynergyApi.Models;

namespace Simnet
{
    public partial class SimnetConnector :ISimnetConnector
    {
        public Task<GetItemBySearchResponse> GetCheckBySearchAsync(CheckSearchDto checkSearchDto, string sessionToken)
        {
            return GetCheckBySearchInteralAsync(checkSearchDto, sessionToken);
        }

        private async Task<GetItemBySearchResponse> GetCheckBySearchInteralAsync(CheckSearchDto checkSearchDto, string sessionToken)
        {
            try
            {
                SynOptionEnums[] synOptionEnums = new SynOptionEnums[1];
                synOptionEnums[0] = 0;
                SynItemRequest synItemRequest = new SynItemRequest()
                {
                    StartPage = CheckSearchOptions.StartPage,
                    NumberOfPages = CheckSearchOptions.NumberOfPages,
                    Extension = string.Empty,
                    Options = synOptionEnums
                };

                GetItemBySearchResponse getItemBySearchResponse =
                    await _service.GetItemBySearchAsync(sessionToken, CheckSearchOptions.CheckSearchName, CheckSearchEnum,
                    checkSearchDto.CheckSearchXML, CheckSearchOptions.SearchTimeout, synItemRequest);

                return getItemBySearchResponse;
            }
            catch (Exception e)
            {
                //TODO: handle exception, log exception
                var ex = e;
                throw;
            }
        }
    }   
}

Ok so I have solved the issue.好的,我已经解决了这个问题。 It was an error in the XML search parameter.这是 XML 搜索参数中的错误。 The exception was totally not helpful in finding that.这个例外对发现这一点完全没有帮助。 Another coworker found where the error was...you know you can't see your own mistakes.另一位同事发现了错误所在……你知道你看不到自己的错误。 Thank you to anyone that attempted to look at this for me.感谢任何试图为我看这个的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决此错误“ System.ServiceModel.FaultException” - How can i solve this error “System.ServiceModel.FaultException” 如何克服System.ServiceModel.FaultException - how to overcome System.ServiceModel.FaultException System.dll中的System.ServiceModel.FaultException - System.ServiceModel.FaultException in System.dll System.ServiceModel.dll中的“ System.ServiceModel.FaultException”:过程不存在 - 'System.ServiceModel.FaultException' in System.ServiceModel.dll: Procedure not present 自承载WCF和System.ServiceModel.FaultException - Self-Hosting WCF and System.ServiceModel.FaultException System.ServiceModel.FaultException - System.ServiceModel.FaultException<DefaultFaultContract not catching some exceptions WCF单元测试结果在System.ServiceModel.FaultException中 - WCF Unit Testing Results in a System.ServiceModel.FaultException 在Dynamics CRM中将RetrieveMultiple与FetchXML一起使用时,出现“ System.ServiceModel.FaultException`1” - 'System.ServiceModel.FaultException`1' when using RetrieveMultiple with FetchXML in Dynamics CRM XAMARIN.ANDROID 应用出现 System.ServiceModel.FaultException - XAMARIN ANDROID app got System.ServiceModel.FaultException Synergy dbr.exe在xcall期间获取System.ServiceModel.FaultException - Synergy dbr.exe getting System.ServiceModel.FaultException during xcall
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM