[prev in list] [next in list] [prev in thread] [next in thread]
List: php-soap
Subject: [SOAP] size limit for message sub-nodes?
From: Brian Miles <selimnairb () gmail ! com>
Date: 2009-11-25 6:35:51
Message-ID: 7136D021-1FC1-4C7B-813B-AD13EE1805CB () gmail ! com
[Download RAW message or body]
Hello,
I have defined a SOAP message for submitting mixed data, including a base64 encoded \
image. Everything works fine when the images I send are small (640x480). However \
when my images grow too large (1024x768), the image data coming out of the SOAP \
request appears to be truncated. For example, instead of being 169,048 bytes, it is \
166,448 bytes.
What I'm doing is re-encoding the image data that SoapServer has decoded for me for \
the purpose of storing it in a text field in a mysql table. So it may be that \
SoapServer is truncating the data. Or (less likely?) it may be that base64_encode is \
truncating the data.
Is there a size limit for message sub-nodes that SoapServer can handle?
I have attached relevant sections of my server and WSDL file below.
Thanks in advance for any advice.
Brian
Here are the relevant parts of my SOAP server:
<?php
function submitSighting($collector_id,
$species_common_name,
$sighting_datetime,
$location_lat,
$location_long,
$notes = NULL,
$alive_flag = true,
$photovideo = NULL) {
$species_common_name = mysql_real_escape_string($species_common_name);
$sighting_datetime = mysql_real_escape_string($sighting_datetime);
$location_lat = mysql_real_escape_string($location_lat);
$location_long = mysql_real_escape_string($location_long);
if (NULL != $notes) {
$notes = mysql_real_escape_string($notes);
} else {
$notes = "";
}
if (true == $alive_flag) {
$alive_flag = 'Y';
} else {
$alive_flag = 'N';
}
if (NULL != $photovideo) {
$photovideo = base64_encode($photovideo);
} else {
$photovideo = "";
}
$species_id = getSpeciesIdFromCommonName($species_common_name, $link); // function \
definition removed from this snippet if (!$species_id) {
$msg = "The species " . $species_common_name . " is unknown.";
}
// Insert into the sightings table
$query = sprintf("insert into pws_sightings values (NULL, %d, %d, 'N', '%s', %f, \
%f, '%s', '%s', '%s')", $collector_id,
$species_id,
$sighting_datetime,
$location_lat,
$location_long,
$notes,
$alive_flag,
$photovideo);
$result = mysql_query($query);
if ($result) {
$msg = "Success";
} else {
$msg .= " was NOT successfully submitted due to error: " . mysql_error();
}
error_log($msg, 0);
return $msg;
}
// SOAP stuff
ini_set("soap.wsdl_cache_enabled", "1"); // Enable WSDL cache
$server = new SoapServer("pws.wsdl");
$server->addFunction("submitSighting");
$server->handle();
?>
Here is the relevant excerpt from my WSDL file:
<message name='submitSightingRequest'>
<part name='collector_id' type='xsd:integer'/>
<part name='species_common_name' type='xsd:string'/>
<part name='sighting_datetime' type='xsd:dateTime'/>
<part name='location_lat' type='xsd:double'/>
<part name='location_long' type='xsd:double'/>
<part name='notes' type='xsd:string'/>
<part name='alive_flag' type='xsd:boolean'/>
<part name='photovideo' type='xsd:base64Binary'/>
</message>
<message name='submitSightingResponse'>
<part name='Result' type='xsd:string'/>
</message>
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic