#!/bin/bash

boundary=epoch-`date +%s`

echo "--$boundary 
Content-Type: application/soap+xml
Content-Location: root

<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">
<env:Body>
<some_soap/>
</env:Body>
</env:Envelope>
--$boundary
Content-Type: `java -classpath ~/bin MimeType $1`
Content-Transfer-Encoding: binary
Content-Id: <binary>

" `cat $1` "
--$boundary--
" | curl -s --data-binary @- -H 'Content-Type: multipart/related; type="text/xml"; boundary="'$boundary'"' $2

