0
votes

We are recreating a webservice based on a third party WDSL using a .NET WCF service project. The client is however expecting a response for all operations even when they are of a void type. The empty body will be used to indicate that the operation completed successfuly.

The response should look like this:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body/>
</s:Envelope>

The problem is that our newly created wcf service has no response body even if we throw a faultexception using SOAP 1.1 message format and basic http binding.

Is there a way to always 1. send a response body, 2. Send a fault body using SOAP 1.1? We are using SoapUI to test the service.

1

1 Answers

0
votes

We recreated an existing webservice by generating the interface code using the svcutil.exe utility and the existing WDSL file. The interface code it generated did have a attribute that turned all operations definitions into one way methods.

This made all methods return a http 202 accepted response as long as there are no error on the transport level of the service.

We simply refered to the interface from our new webservice code behind file and implemented all methods without actually knowing the meaning of the IsOneWay attribute.

[System.ServiceModel.OperationContractAttribute(IsOneWay = true, Action = "Case_New")]

Converting the definition is IsOneWay=false actually changed the behaviour of the service exactly as we liked it to be.

[System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "Case_New")]

We got the answer from WCF and confirmations - do I need to send back a 'OK got it' to client?