[PEAR::SOAP] Correctly attaching SOAP_Attachments to a SOAP message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am working on a soap server that has to correctly send mime attachments
back to the client.  It basically does a "get file" function.

I am running into a problem where I am not correctly returning SOAP
attachments back to the client.

My question is how do I correctly attach a SOAP_Attachment to a SOAP message
that I send to the client?

Here is what I currently have written:

The Test Client:
$wsdl=new SOAP_WSDL('http://MySOAPServer.com/Server.php?wsdl');

$DCS=$wsdl->getProxy();

echo '<pre>';
$Attachment = $DCS->GetAttachment();
echo '<pre>';
print_r($Attachment);
print_r($DCS->xml);
echo '</pre>';


The Server:
(code snippets... not complete)

$this->__dispatch_map['SendAnAttachment'] =
                        array('in'   => array(),
                                 'out' => array('myAttachment'=> 'string'));

function GetAttachment()
{
$FullPath = 'C:/Junk/test.jpg';

if (file_exists($FullPath))
    return new SOAP_Attachment('Response', 'application/octet-stream',
$FullPath);
else
    return new SOAP_Value('return', 'boolean', false);
}

Thanks in Advance!
Dave Dykshoorn
Web Developer
SpeedLine Solutions

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux