Contract-first Web Service, WCF, One-way operations with http status code response

49 views Asked by At

let's start by defining some preliminary assumptions:

For some time now, I've been involved in a project where my task is to create a web service that will act as a provider for an existing client service operating in a production environment. The idea is that the client possesses data that I need to receive.

In connection with this, I've received a set of .wsdl and .xsd files, along with documentation that theoretically outlines detailed communication rules.

The key details include:

  • Transport security: IPSec tunnel
  • Transport mechanism: HTTP
  • Messages exchange format: SOAP version 1.1
  • The messaging uses WS-Addressing defined SOAP header elements (some mandatory and some optional)
  • The fault SOAP body (with some specified elements like 'code')
  • WS-PolicyAttachment
  • MTOM

Since this is my first project of this kind, I wasn't sure which technological stack to choose for this task. I opted for MS WCF.

In general, I'm quite proficient in this framework (at least in its basic scope). I can smoothly read .wsdl and .xsd files, and conceptually, I know what needs to be done. However, I've been puzzled by a certain issue for some time, and I'd appreciate an explanation.

The concern revolves around a statement in the documentation: "All messaging defined by this interface is one-way. This means, the client sends the message body as part of the HTTP/S Request package and does not wait for any business-related data in the HTTP/S Response. The HTTP/S Response notifies the client whether or not the service provider successfully received and staged the message. The response codes identified in this section will be used by the service provider. The client will first test the HTTP/S response code. This is a three-digit number that defines the overall success or failure of processing."

This issue is confusing to me. On the one hand, the documentation in many places states that the communication is "One-way only." On the other hand, the client's internal processing of the message seems to be depended on the status code it receives from me (if I understand correctly, right after message passes schema validation).

I know that in WCF, there is a class allowing for the generation of SOAP Faults - [FaultContract]? But as far as I understand, it is used only in the case of an incorrect message. I am really confused by the excerpt I provided...

If it's not too much trouble, I would like a more experienced person to explain "what the author meant?".

Additionally, I would like to ask:

  • If the client is depended on server's returb code do we still call such communication One-way?
  • Does WCF allow the implementation of such a scenario? If not:
  • What tech stack will provide me with the possibility of implementing a contract-first web service meeting the requirements I mentioned?

Warm regards and thank you for your support.

PS - Any WCF code examples or reflinks are the most welcomed.

0

There are 0 answers