Home Page › Forums › BizTalk 2004 – BizTalk 2010 › I need an exception decoder ring
- This topic has 6 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
May 22, 2008 at 3:22 PM #19722
I’m calling a web service that was created by running the “WCF Service Publishing Wizard” (to publish a schema).
I am getting responses when I have no errors. But when the invoked orchestration calls a webservice, and catches an exception,
the C# console program that is calling the published web service, gets the followingFaultException`1 was unhandled:
The message has this value:
“<\0?\0x\0m\0l\0 \0v\0e\0r\0s\0i\0o\0n\0=\0\”\01\0.\00\0\”\0 \0e\0n\0c\0o\0d\0i\0n\0g\0=\0\”\0u\0t\0f\0-\01\06\0\”\0?\0>\0
\0
\0<\0s\0o\0a\0p\0:\0E\0n\0v\0e\0l\0o\0p\0e\0 \0x\0m\0l\0n\0s\0:\0s\0o\0a\0p\0=\0\”\0h\0t\0t\0p\0:\0/\0/\0s\0c\0h\0e\0m\0a\0s\0.\0x\0m\0l\0s\0o\0a\0p\0.\0o\0r\0g\0/\0s\0o\0a\0p\0/\0e\0n\0v\0e\0l\0o\0p\0e\0/\0\”\0>\0
\0
\0 \0 \0<\0s\0o\0a\0p\0:\0B\0o\0d\0y\0>\0
\0
\0 \0 \0 \0 \0<\0s\0o\0a\0p\0:\0F\0a\0u\0l\0t\0>\0
\0
\0 \0 \0 \0 \0 \0 \0<\0f\0a\0u\0l\0t\0c\0o\0d\0e\0>\0s\0o\0a\0p\0:\0S\0e\0r\0v\0e\0r\0<\0/\0f\0a\0u\0l\0t\0c\0o\0d\0e\0>\0
\0
\0 \0 \0 \0 \0 \0 \0<\0f\0a\0u\0l\0t\0s\0t\0r\0i\0n\0g\0>\0S\0e\0r\0v\0i\0c\0e\0 \0’\0o\0r\0c\0h\0M\0a\0p\0p\0e\0r\0(\07\0a\00\0d\04\00\0e\0e\0-\03\02\0b\05\0-\04\03\00\02\0-\08\04\09\08\0-\06\07\06\02\05\0b\0d\0c\06\0a\09\0c\0)\0’\0 \0t\0e\0r\0m\0i\0n\0a\0t\0e\0d\0 \0w\0i\0t\0h\0o\0u\0t\0 \0r\0e\0s\0p\0o\0n\0d\0i\0n\0g\0 \0t\0o\0 \0o\0p\0e\0r\0a\0t\0i\0o\0n\0 \0’\0D\0i\0r\0W\0C\0F\0P\0o\0r\0t\0G\0e\0n\0e\0r\0i\0c\0.\0O\0p\0e\0r\0a\0t\0i\0o\0n\0_\01\0’\0.\0<\0/\0f\0a\0u\0l\0t\0s\0t\0r\0i\0n\0g\0>\0
\0
\0 \0 \0 \0 \0 \0 \0<\0f\0a\0u\0l\0t\0a\0c\0t\0o\0r\0>\0o\0r\0c\0h\0M\0a\0p\0p\0e\0r\0<\0/\0f\0a\0u\0l\0t\0a\0c\0t\0o\0r\0>\0
\0
\0 \0 \0 \0 \0 \0 \0<\0d\0e\0t\0a\0i\0l\0 \0/\0>\0
\0
\0 \0 \0 \0 \0<\0/\0s\0o\0a\0p\0:\0F\0a\0u\0l\0t\0>\0
\0
\0 \0 \0<\0/\0s\0o\0a\0p\0:\0B\0o\0d\0y\0>\0
\0
\0<\0/\0s\0o\0a\0p\0:\0E\0n\0v\0e\0l\0o\0p\0e\0>\0”The Details field has this value: {An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkNackException: <}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& 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& msgData, Int32 type)
at CustodianServiceTester.ServiceReference2.ESBCustodianService.GetCustodianRequestForCert(GetCustodianRequestForCertRequest request)
at CustodianServiceTester.ServiceReference2.ESBCustodianServiceClient.CustodianServiceTester.ServiceReference2.ESBCustodianService.GetCustodianRequestForCert(GetCustodianRequestForCertRequest request) in C:\\Buddy\\LaSalle\\code\\TMAC\\LaSalle\\Webservices\\CustodianServiceTester\\Service References\\ServiceReference2\\Reference.cs:line 2164
at CustodianServiceTester.ServiceReference2.ESBCustodianServiceClient.GetCustodianRequestForCert(GetRequestForCertification GetRequestForCertification) in C:\\Buddy\\LaSalle\\code\\TMAC\\LaSalle\\Webservices\\CustodianServiceTester\\Service References\\ServiceReference2\\Reference.cs:line 2170
at CustodianServiceTester.Program.GetRequestForCertificationViaPublishedWCFWrapper() in C:\\Buddy\\LaSalle\\code\\TMAC\\LaSalle\\Webservices\\CustodianServiceTester\\Program.cs:line 155
at CustodianServiceTester.Program.Main(String[] args) in C:\\Buddy\\LaSalle\\code\\TMAC\\LaSalle\\Webservices\\CustodianServiceTester\\Program.cs:line 46
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()”Thanks,
Neal Walters -
May 22, 2008 at 3:35 PM #19724
The exception reads:
<?xml version=\”1.0\” encoding=\”utf-16\”?>
<soap:Envelope xmlns:soap=\”http://schemas.xmlsoap.org/soap/envelope/\“>
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Service ‘orchMapper(7a0d40ee-32b5-4302-8498-67625bdc6a9c)’ terminated without responding to operation ‘DirWCFPortGeneric.Operation_1’.</faultstring>
<faultactor>orchMapper</faultactor>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>”Some problem with utf-16/utf-8/ANSI encoding (replace all “\0” with “”)
You orchestration had an exception and terminated, without sending a response on a request-response port. I would suggest catching all exceptions within the orchestration and returning your own fault or error message to the initiating web service.
-
May 22, 2008 at 5:47 PM #19725
Thanks. Look like you read an UUEncoder on it?
My orchestration actually caught an exception when it was calling a web service, so right, it never returned a message. I have also gotten Timeouts and not sure why sometimes I get a timeout and sometimes the message above.
So what would be the best way to “bubble-up” the message.
Do I have to build a formal SoapFault message and send it?
Thanks,
Neal-
May 22, 2008 at 6:33 PM #19726
The easiest way is to add a Fault to the Port operation, with a message type of System.String. Add a message to your orchestration, MyFault of type System.String. Add an exception handler to to catch System.Exception. In the exception handler construct MyFault (e.g. MyFault = “System Error”; and send MyFault to the Port Fault.
You can expand on this as required, by adding more granular exception handlers or creating a more complicated messages
There is one gotcha with this pattern. You need to put your web service response Send shape inside an atomic transaction and have a decide shape in you exception handler to check whether you have sent a response before sending a fault. (i.e. !succeeded(ResponseSendTransaction).
You can only return one message to the web service, you cannot send a response and a fault.-
May 23, 2008 at 10:11 AM #19735
In my case I have what we call a “mapping” orchestration. We have a web page calling a WCF Published schema. I can’t put all the conflicting maps on the Receive Port, so I have to do the mapping in the orchestration to our common message format (a requirement of our ESB architecture).
So my orchestration then calls a WCF service that we wrote. It has the scope with a catch/exception, and I use a common Fault schema to grab the error. So after your post, I just added a “Send” shape in the Exception handler, associated it with the same fault message.
I then added a fault message to the WCF receive port (direct binding), and associated it with the same schema.
So now, my problem is that the WCF fault message has an outgoing shape on the port, thus it want to connect to a “Receive”, not a “Send”. The logical port is of course configured “I’ll be receive a request and sending a response.” Could this be a bug? Seems like the fault message should be able to connect to a send on this type of port.
Thanks again,
Neal-
May 26, 2008 at 4:18 AM #19742
This is strange, I have a number of solicit/response ports (i.e. receive then send), they all have an outbound faults (connect to a send shape).
Can you supply more details about the port configuration, particularly the direct binding?
-
May 27, 2008 at 12:36 PM #19770
Today, it worked! The Fault is an “innie” instead of an “outie”!
My guess is closing and re-opening Visual Studio helped.
Neal
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.