【发布时间】:2011-03-22 15:14:27
【问题描述】:
我正在尝试从 php 调用一个肥皂网络服务。
Web 服务返回一个 ADO.NET 数据集结构。 PHP中有没有可以处理这种数据结构的库?如果是这样,它们叫什么,我在哪里可以找到它们?如果没有,请随时提供提示?
到目前为止,我有这个(使用 ActiveMQ 和 NuSoap 库):
/**
* Create a new service instance
* Provide ActiveMQ uri and the extended class name
**/
$client = new Client('tcp://localhost:61613?tcpNoDelay=false', 'test');
/**
* New service reference
**/
$service = new ServiceProxy($client, 'ServiceName');
/* Service call */
$result = $service->get_clients();
get_clients() 是一种执行实际服务调用的方法,它获取 DataSet 结构作为回报。我该如何操作这个返回值?
例如,在 .NET 中,有一个 DataSet 类。 ADO.NET 数据集包含一个或多个 ADO.NET 数据表,这些数据表又由一个或多个 ADO.NET 数据列和数据行组成,这些数据列和数据行在集合(数组)中返回。
一个简单的代码示例,其中DataSet只包含一个DataTable,可以是:
/**
* Here, the val variable will contain the data positioned in the
* first field of the first DataRow of the first DataTable
**/
string val = dataset.Table[0].Rows[0].ItemArray[0];
我想在 PHP 中做同样的事情,但我需要帮助。
【问题讨论】:
-
这无济于事,但是。我最深切的哀悼......没有人应该为此受苦。