如何使用PEAR Soap发送和Mime附件

时间:2012-05-03 10:16:58

标签: php soap pear mime

如何使用Mime附件发送和Soap请求?

现在我用

创建一个Soap_Attachment
$att = new SOAP_Attachment('contentID', $_FILES['uploaded_file']['type'] . '; charset=utf-8', $_FILES['uploaded_file']['tmp_name'])

但如何将此附件附加到我的请求中?我的要求是例如

$result = $soapClient->call('saveEmployeeXmlData', array(
    'id'    => 'a-key',
    'key'   => '12456865456845',
    'data'  => $xml
), $options);

谢谢!

1 个答案:

答案 0 :(得分:1)

您可以尝试以下

$soapClient->getProxy ();
$soapClient->setOpt ( 'Mime', true );
$soapClient->saveEmployeeXmlData ( array (
        'id' => 'a-key',
        'key' => '12456865456845',
        'data' => $att 
) );