NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

WCF Fault InnerException --> Throwable.getCause()

 
Post new topic   Reply to topic    NetBeans Forums -> SOA Users
View previous topic :: View next topic  
Author Message
looselyhuman



Joined: 09 Jul 2011
Posts: 1

PostPosted: Sat Jul 09, 2011 6:38 pm    Post subject: WCF Fault InnerException --> Throwable.getCause() Reply with quote

Hello,

I'm calling a WCF service using JAX-WS in Netbeans 7. This is my first Java project - usually a C# guy. Anyway, I'm trying to figure out if I can access the inner exception of my SOAP fault in Java. I know it's in the message, as seen below:

Code:
<GetFISHTestsByCase>
  <MethodParameters>
    <FaultException1>
      <Detail>
        <HelpLink isNull="true" />
        <InnerException>
          <HelpLink isNull="true" />
          <InnerException isNull="true" />
          <Message>Value cannot be null.Parameter name: source</Message>
          <StackTrace>at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)   at NeoESB.SOAP.CellCount.GetFISHTestsByCase(String APvXCaseNo, String Token) in C:\NeoESB\NeoESB\SOAP\CellCount.svc.cs:line 97</StackTrace>
          <Type>System.ArgumentNullException</Type>
        </InnerException>
        <Message>Error retrieving tests for hss11-000101.</Message>
        <StackTrace>at NeoESB.SOAP.CellCount.GetFISHTestsByCase(String APvXCaseNo, String Token) in C:\NeoESB\NeoESB\SOAP\CellCount.svc.cs:line 111   at SyncInvokeGetFISHTestsByCase(Object , Object[] , Object[] )   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
        <Type>System.ApplicationException</Type>
      </Detail>
      <Action isNull="true" />
      <Code>System.ServiceModel.FaultCode</Code>
      <Message>Error retrieving tests for hss11-000101.</Message>
      <Reason>Error retrieving tests for hss11-000101.</Reason>
      <Data>
        <KeysAndValues attr0="KeyValuePairArray" isNull="false" />
      </Data>
      <InnerException isNull="true" />
      <TargetSite>Void HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)</TargetSite>
      <StackTrace>Server stack trace:    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)Exception rethrown at [0]:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)   at ICellCount.GetFISHTestsByCase(String APvXCaseNo, String Token)   at CellCountClient.GetFISHTestsByCase(String APvXCaseNo, String Token)</StackTrace>
      <HelpLink isNull="true" />
      <Source>mscorlib</Source>
    </FaultException1>
  </MethodParameters>
</GetFISHTestsByCase>

However, in this code:

Code:
catch (Exception e) {
            jComboBoxTests.addItem("Error retrieving Tests");
            jComboBoxTests.addItem(e.getMessage());
            if(e.getCause() != null)
                jComboBoxTests.addItem(e.getCause().getMessage());
        }

e.getCause is always null. Any ideas on how I can get this inner exception?

Thanks!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> SOA Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo