Search code examples
c#wcfsap-xi

How to handle a non-SOAP error message? "Response did not arrive for request"


I have a WCF client for a set of services in an SAP system. For certain errors, the services are (allegedly) unable to return a SOAP fault. Instead I receive something like this:

<?xml version="1.0"?>
<jpr:Fault xmlns:jpr="http://com.sap/aii/proxy/xiruntime/">com.sap.aii.proxy.xiruntime.core.ESPXISystemFaultException: Error encountered during processing of XI request message in inbound ESP; Hint: com.sap.engine.interfaces.webservices.runtime.RuntimeProcessException: Response did not arrive for request 8d4b2782-062a-11e6-b0f9-0000193763e3</jpr:Fault>

The above represents a certain type of timeout in the service. The only piece of information I have available here to identify it as a timeout, is this piece of text:

Response did not arrive for request

There are WSDLs but the vendor doesn't take them very seriously. I've also asked to try and give me a SOAP fault, but they insist it isn't possible in this case.

How can I handle a message like this? Currently, I receive this exception chain:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ServiceModel.CommunicationException: Unrecognized message version.

Solution

  • It is possible but you will have to work with some low level bits. The place you want to be is in the client channel where you can install your component in the channel for handling this kind of response. Take a look at WCF Extensibility – Channels where you can find how to create your protocol channel.

    After that you can create your Custom Binding stacking up channels where you have Transport (must be present), Your protocol, Encoder, etc...