We have a BizTalk orchestration which has been published as a web service. The orchestration has a one way recieve port which results in a web service being generated which contains a method with a void return type.
The behaviour we experienced was that on occasion the service was called by a client which was returned an http 202 return code and indicated that the message had been accepted. The problem how ever was that the message hadnt made it to the message box. An example of this was if the recieve location was disabled.
Upon inspection of the web service this was caused because the web method was marked with the one way attribute with a value of true. This means that once the web server accepts the message from the client, the client will continue executing and not care of the result of the call.
This was not what we wanted, we wanted to know that the message had made it to the message box and that any error in the inbound process would be reported to the client.
The solution was simple in that we just needed the web service and the clients web service proxy to mark the web method as one way = false. This was not as straight forward to implement though because the web service and proxy code is generated at build time by our msbuild process.
The solution to this was to amend the web service description file used to generate the web services before the build task automated the web service publishing wizard to generate the service.
In the web service description file there is the following attribute for the method
The change was to change this attribute to "Yes" which would then result in the code behind for the web service being marked as OneWay="false" for the web method.
This would then result in the desired behaviour where the message gets to the message box before the respose is returned to the client