I'm using a site called ViaPost to post letters for my business. I'm using the SoapClient. The uploaded file must be in the base64binary format. I'm using the following code however returns empty.

```
    $pdf_data = file_get_contents('test.pdf'); 
    $pdf_data = base64_encode($pdf_data);
    print $pdf_data;

```

To expand on the above: 

```
    POST /viapostcustomer.asmx HTTP/1.1
    Host: api.viapost.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://api.viapost.com/CreateLetter"

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <CreateLetter xmlns="http://api.viapost.com">
          <loginToken>string</loginToken>
          <name>string</name>
          <description>string</description>
          <FileContents>base64Binary</FileContents>
          <dynamic>boolean</dynamic>
          <shareLetterWithGroup>boolean</shareLetterWithGroup>
          <returnMessage>string</returnMessage>
          <letterID>long</letterID>
        </CreateLetter>
      </soap:Body>
    </soap:Envelope>

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <CreateLetterResponse xmlns="http://api.viapost.com">
          <CreateLetterResult>boolean</CreateLetterResult>
          <returnMessage>string</returnMessage>
          <letterID>long</letterID>
        </CreateLetterResponse>
      </soap:Body>
    </soap:Envelope>

    <?php
    $client = new SoapClient("http://api.viapost.com/viapostcustomer.asmx?WSDL");
    $params = array('sUserName'=>'USERNAME','sPassword'=>'PASSWORD','sLoginToken'=>'','sReturnMessage'=>'');
    $SignIn = $client->__soapCall('SignIn', array($params));
    $sLoginToken = $SignIn->sLoginToken;

    $pdf_data = file_get_contents('test.pdf');
    $pdf_data = base64_encode($pdf_data);
    $params = array('loginToken'=>$sLoginToken,'name'=>'testname','description'=>'testdescription','fileContents'=>$pdf_data,'dynamic'=>'true','shareLetterWithGroup'=>'false','returnMessage'=>'','letterID'=>'');
    $CreateLetter = $client->__soapCall('CreateLetter', array($params));
    $returnMessage = $CreateLetter->returnMessage;
    print $returnMessage;

    ?>

```

it returns: There was a problem saving your file. Please try again.

I've done something daft I know I have.