Refactor SOAP log preparation into a method

We want to use this logic in more places, so that we can output the requests and responses more safely in general. 
Turn it into a method and call the method.