I spent the whole weekend writing a milter (sendmail filter). Everything was going great until I started making some SOAP calls from within the milter and, wham, I am getting that stupid 'Expecting 5' message. Urgh. It's not fun working with a sensitive piece of crap.
BTW, gSoap is a great library for implementing web service client or service in C or C++. Only problem is that its rather disorganized so you'll have to waste some time figuring out what the hell is going on.