Tuesday, November 6, 2012

One-way WCF service from BizTalk orchestration returns 200 OK on an invalid message

Today I ran into some weird behaviour of the WCF service that is generated by the WCF Service Publishing Wizard of BizTalk.

I have an orchestration that has a receive port but no send ports. This means that when I generate a service from this orchestration, it will result in a one-way service.

In the xsd for the incoming message, there is a restriction on a field. Something like this:

<s:simpletype name="FIELDTYPE">
  <s:restriction base="s:string">
    <s:enumeration value="Value1" />
    <s:enumeration value="Value2" />

When I send a valid message to the WCF service, the message is neatly delivered to the BizTalk Messagebox, as expected, and the orchestration can process it. The service returns HTTP status code 202 Accepted. Nice.

But when I send a message that contains

(which by its restriction makes this an invalid message) the message never finds its way to the message box. So it doesn't result in a suspended message, nor does it show up in the Tracked Message Instances. It just disappears.

This isn't really a problem, as after all, it was an invalid message. But it does look a bit weird to see the service return HTTP status code 200 OK....

No comments:

Post a Comment