Empty result of the web service method call

Hi
I have a web service written on the PHP. The appropriate WSDL looks
like this:
<s:complexType name="ArrayOfObjectData">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="ObjectData"
nillable="true" type="tns:ObjectData" />
</s:sequence>
</s:complexType>
<s:complexType name="ObjectData" abstract="true">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ID" type="s:string" /
>
<s:element minOccurs="1" maxOccurs="1" name="ParentID"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Name"
type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="Status"
type="tns:ObjectStatus" />
</s:sequence>
</s:complexType>
<s:complexType name="ProjectData">
<s:complexContent mixed="false">
<s:extension base="tns:ObjectData">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Form"
type="s:string" />
</s:sequence>
</s:extension>
</s:complexContent>
</s:complexType>

<s:element name="SynchronizeRequest">
<s:complexType>
<s:sequence>
<s:element name="ClientID" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SynchronizeResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="SynchronizeResult"
type="tns:ArrayOfObjectData" />
</s:sequence>
</s:complexType>
</s:element>

There are one abstract object (ObjectData) and two inherited objects
(ProjectData and LocationData)
There is a method Synchronize, which returns an array of the objects
derived from the ObjectData.

There is a PHP code, which fill the array with ProjectData objects:

while ($object = mysql_fetch_array($result, MYSQL_ASSOC))
{
$newProject->ID = $object[object_id];
if ($object[version] == null)
{
$newProject->Status = "Deleted";
}
elseif ($object[object_version] == 0)
{
$newProject->Status = "New";
$newProject->Name = $object[name];
}
else
{
$newProject->Status = "Updated";
$newProject->Name = $object[name];
}
$objects[$objectCount++] = new SoapVar($newProject,
SOAP_ENC_OBJECT, "ProjectData");
}
return array("SynchronizeResult" => $objects);

The result, which SOAP server returns looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="http://informer.dataexchange/">
<SOAP-ENV:Body>
<ns1:SynchronizeResponse>
<ns1:SynchronizeResult>
<ns1:ObjectData xsi:type="ProjectData">
<ID>1</ID>
<Status>Updated</Status>
<Name>Project 1</Name>
</ns1:ObjectData>
</ns1:SynchronizeResult>
</ns1:SynchronizeResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

So it seems to be a normal array with one element.
The client is written on the C#. It normally calls the method
Synchronize and gets a result without errors. But result is empty
array, it has no elements.
How to fix it? Can it be a problem with object inheritance and forming
result at PHP code?
Thank you in advance
Ralfeus [ Di, 22 Januar 2008 11:00 ] [ ID #1913980 ]

Re: Empty result of the web service method call

On Jan 22, 5:00 am, Ralfeus <ralf... [at] gmail.com> wrote:
> I have a web service written on the PHP.
>
> The client is written on the C#. It normally calls the method
> Synchronize and gets a result without errors. But result is empty
> array, it has no elements.
> How to fix it? Can it be a problem with object inheritance and forming
> result at PHP code?
> Thank you in advance

Finding a more precise spot in the process where things are broken
will help you solve the problem.

If that is exactly what is being returned from the server, and it is a
valid response, then your problem must be in the client. Did you get
that response data by inspecting the network communication on the test
client machine or did you log that from PHP? (You can try to output
the response through C# to find out).

If you can verify that the data safely reaches the client, then there
will be more people in the C# newsgroup who can help you. Otherwise,
if you can debug your script with breakpoints and a debugging editor
or post some of your code then that would be helpful in finding a
solution to your problem.

-Michael Placentra II | ZCE
nothingsoriginalonthe [ Mi, 23 Januar 2008 02:08 ] [ ID #1914731 ]

Re: Empty result of the web service method call

The response from the web service was seen at the client network
interface. If the response is correct one I'll continue fight with C#
client side :-)
Thank you for response

On 23 Led, 02:08, Mike Placentra II
<nothingsoriginalontheinter... [at] gmail.com> wrote:
> On Jan 22, 5:00 am, Ralfeus <ralf... [at] gmail.com> wrote:
>
> > I have a web service written on the PHP.
>
> > The client is written on the C#. It normally calls the method
> > Synchronize and gets a result without errors. But result is empty
> > array, it has no elements.
> > How to fix it? Can it be a problem with object inheritance and forming
> > result at PHP code?
> > Thank you in advance
>
> Finding a more precise spot in the process where things are broken
> will help you solve the problem.
>
> If that is exactly what is being returned from the server, and it is a
> valid response, then your problem must be in the client. Did you get
> that response data by inspecting the network communication on the test
> client machine or did you log that from PHP? (You can try to output
> the response through C# to find out).
>
> If you can verify that the data safely reaches the client, then there
> will be more people in the C# newsgroup who can help you. Otherwise,
> if you can debug your script with breakpoints and a debugging editor
> or post some of your code then that would be helpful in finding a
> solution to your problem.
>
> -Michael Placentra II | ZCE
Ralfeus [ Do, 24 Januar 2008 14:29 ] [ ID #1915604 ]
PHP » comp.lang.php » Empty result of the web service method call

Vorheriges Thema: Will htmlentities avoid all XSS in php?
Nächstes Thema: text parsing