How to send and Mime attachment using PEAR Soap

柔情痞子 提交于 2019-12-14 03:07:29

问题


How do I sent and Soap request with an Mime attachment?

Now I create an Soap_Attachment with

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

but how do I attach this attachment to my request? My request is e.g.

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

Thanks!


回答1:


You can try the following

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


来源:https://stackoverflow.com/questions/10429353/how-to-send-and-mime-attachment-using-pear-soap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!