Cryptic BizTalk error – Object […] of type StoredProcedure does not exist

Just had an annoying BizTalk error that I’ll probably run into again so jotting this down for posterity.

I was getting a warning in the event log like so: (names of objects changed to protect the innocent).
The adapter failed to transmit message going to send port "FooBar" with URL "mssql://sql/dev/Mydb?". It will be retransmitted after the retry interval specified for this Send Port. Details:"Microsoft.ServiceModel.Channels.Common.MetadataException: Object [dbo].[My_stored_procedure] of type StoredProcedure does not exist

Turns out that that “?” character at the end of the wcf-custom adapter url was the cause of all the fuss. That’s automatically appended in the bindings generated by using the Add Generated Items-> Consumer Adapter Service wizard.

Remove the question mark and all is well!

Also, don’t forget to update your port operation names as detailed in this blog post