Attachment to AXIS
| From: | Sacha Matasci | Date: | Fri, 24 Sep 2004 15:39:19 +0000 |
| Subject: | Attachment to AXIS | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-1622@lists.php.net to get a copy of this message | ||
Hi. I have a question about SOAP Pear. When I try to send an attachment to
an Axis WebService it doesn't work. Or better, the attachment will not be
sent. The service is called, but if I print the envelope there isnt' any
attachment. The Service is submitJob. There isn't any parameters. Thank you
for the help. Sacha This is the envelope that I receive in the AXIS
server: <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://JobSchedulerServer"><SOAP-ENV:Body>
<ns4:submitJob/></SOAP-ENV:Body></SOAP-ENV:Envelope> This is the code:
require_once("SOAP/Client.php");
require_once("SOAP/Value.php");
$uploadfile = 'index.php';
echo Step 1';
$v = new
SOAP_Attachment(basename($_FILES['userfile']['name']), 'text/plain',
$uploadfile);
if (PEAR::isError($v)){
print("<br>An error #" .
$v->getCode() . " occurred!<br>");
print(" Error: " .
$v->getMessage() . "<br>\n");
return false;
}
echo 'Step 2';
$av = array('content_type' =>
'multipart/related; type="text/xml"');
echo Step 3';
$methodValue = new
SOAP_Value('submitJob', 'Struct', array($v));
echo Step 4';
$client = new
SOAP_Client('http://localhost:8083/Scheduler/services/JobScheduler?wsdl');
echo Step 5';
# calling with mime
$resp = $client->call('submitJob', $v,
$av1);
echo Step 6';
print $client->wire."\n\n\n";
print_r($resp);