问题
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