Home » Web Services » SOAP » Bug #4746
SOAP-ENC:arrayType="xsd:anyType[20]" SOAP-ENC:offset="[0]"
Details
| Submitted | 2005-07-05 08:10 UTC |
|---|---|
| From | kinliang at gmail dot com |
| Assigned | yunosh |
| Status | Closed |
| Package | SOAP |
| PHP Version | 4.3.8 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-07-05 08:10 UTC] kinliang at gmail dot com
Description:
------------
$query="SELECT * FROM news";
$q->query($query);
$i=1;
$news=array();
$news[]=&new SOAP_Value("pages", "int", "$pages");
$news[]=&new SOAP_Value("max_item", "int", $q->nf());
$return_value[$i]=new SOAP_Value("$i", "{http://soapinterop.org/xsd}InfoListStruct", $news);
if ($q->nf()>0) {
$i=2;
while ($q->next_record()) {
//contruct data
$news=array();
$content = eregi_replace("<br />", "\n", $content);
$content = strip_tags($q->f("content"));
$news[]=&new SOAP_Value("news_title", "string", $i.$q->f("title"));
$news[]=&new SOAP_Value("news_description", "string", substr($content,0,50)."...");
$news[]=&new SOAP_Value("news_author", "string",$q->f("source"));
$news[]=&new SOAP_Value("news_id", "string", $q->f("id"));
$news[]=&new SOAP_Value("news_date", "string", $q->f("entry_stamp"));
$return_value[$i]=new SOAP_Value("$i", "{http://soapinterop.org/xsd}NewsListStruct", $news);
$i++;
}
Reproduce code:
---------------
<ns5:NewsListResponse>
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:anyType[20]" SOAP-ENC:offset="[0]">
<item xsi:type="ns4:InfoListStruct">
<pages xsi:type="xsd:int">1</pages>
<max_item xsi:type="xsd:int">19</max_item>
</item>
<item xsi:type="ns4:NewsListStruct">
<news_title xsi:type="xsd:string">23454gths</news_title>
<news_description xsi:type="xsd:string">sfsdf
...</news_description>
Expected result:
----------------
<ns5:NewsListResponse>
<return>
<item xsi:type="ns4:InfoListStruct">
<pages xsi:type="xsd:int">1</pages>
<max_item xsi:type="xsd:int">19</max_item>
</item>
<item xsi:type="ns4:NewsListStruct">
<news_title xsi:type="xsd:string">23454gths</news_title>
<news_description xsi:type="xsd:string">sfsdf
...</news_description>
[2005-07-05 08:11 UTC] kinliang at gmail dot com
anyone got any idea, why when i return more than 11 items in a response, it will create SOAP-ENC:arrayType="xsd:anyType[20]" SOAP-ENC:offset="[0]" inside the return tag? thanks in advance