That depends on what kind of server you are posting to, and how it handles the request, check for detailed error on the server side.
Most likely it’s due to the Content-Type settings for HTTP header.
you can try to set:
Content-Type = text/xml
under headers when calling pub.client:http
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods