使用PHP使用WCF服务

时间:2011-02-21 01:09:23

标签: php web-services wcf atom-feed

我想用PHP来使用WCF服务(由ASP .NET创建)。我通常不用PHP开发,但我知道它足以通过示例或引用编写我的代码。最后 - 它就像我所知道的任何其他语言一样。我对Web服务没有太多经验,但之前我用Java和ASP创建了一些客户端。因此,我需要在PHP中找到一个简单但很好的解决方案来使用Service.svc文件。 我尝试了SOAP扩展,但是他们不认识XML中的“定义”,因为结构是这样的:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><feed xml:base="http://site.com/Service.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"><title type="text">Title Text</title><id>http://site.com/Service.svc/Buildings</id><updated>2011-02-21T00:50:19Z</updated><link rel="self" title="Buildings" href="Buildings" /><entry><id>http://site.com/Service.svc/Buildings(1234)</id><title type="text"></title><updated>2011-02-21T00:50:19Z</updated><author><name /></author><link rel="edit" title="Building" href="Buildings(1234)" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Townhouses" type="application/atom+xml;type=feed" title="Townhouses" href="Buildings(1234)/Townhouses" /><category term="SiteModel.Building" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><content type="application/xml"><m:properties><d:BuildingID m:type="Edm.Int32">1234</d:BuildingID><d:BuildingName></d:BuildingName><d:Address>123 Main Street</d:Address> ETC...

所以这是一个Atom文件。另外,解析器相关的问题。如何处理每个项目的“链接”?该项目可能具有指向“文件”的链接,即图像,并且需要为每个项目检索它们。我怀疑我需要一个解析器来生成请求主文件并提出所有必要的请求以获取图像?请解释如何处理或推荐可以简化我的工作的现有解决方案。

谢谢。

1 个答案:

答案 0 :(得分:0)

Zend Framework的原子提要阅读器将轻松解析此提要。

http://framework.zend.com/manual/en/zend.feed.consuming-atom.html

相关问题