Error on SOAP One Way operation from WCF client to SAP PI

While working on an integration with a customer with SOAP I came across an interesting issue.

The SOAP call was yielding the following error from their side.

The one-way operation returned a non-null message with Action=”.

After spending hours and hours trying to debug the issue I came across a few threads on stackoverflow talking about the same issue.

The one that saved my life was this one.

https://stackoverflow.com/questions/643241/problem-with-wcf-client-calling-one-way-operation

The issue was specifically related to the following of the SOAP specification.

(SOAP specs, chapter 4.7.9, One-way operations):

There are differing interpretations of how HTTP is to be used when performing one-way operations.

R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains an envelope. Specifically, the HTTP response entity-body must be empty.

R2750 A CONSUMER MUST ignore an envelope carried in a HTTP response message in a one-way operation.

R2727 For one-way operations, a CONSUMER MUST NOT interpret a successful HTTP response status code (i.e., 2xx) to mean the message is valid or that the receiver would process it.

In my case, SAP PI was sending back an HTTP response that was containing an empty enveloppe which was violating R2714.

Moreover the partner’s side was not ignoring the empty enveloppe which was returned ( also violating R2750 ).

If you check the stackoverflow thread you can see a few options suggested to solve the issue.

In my opinion the sender side should be taking care of ignoring the empty body. However I unfortunately did not have access to the partner side to implement a fix, so I used the following solution.

“Apply SAP Patch and add &responsecode202=true to the url”

The URL that need to be called by the consumer will be http:// <host name> : <port name> /XISOAPAdapter/MessageServlet?senderParty= <name of the sender party> &senderService= <name of the sender service> &interface= <name of the interface> &receiverParty= <name of the receiver party> &receiverService= <name of the receiver service> &interfaceNamespace= <name of the interface namespace>&responsecode202=true

After this change, SAP PI is sending back a response 202 with no response body 🙂

Leave a comment