繁体   English   中英

使用PHP消费WCF服务

[英]Consuming WCF Service with PHP

我想通过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文件。 另外,解析器相关的问题。 如何处理每个项目的“链接”? 该项目可能具有指向“文件”(即图像)的链接,因此需要为每个项目检索它们。 我怀疑我需要一个解析器来发出请求主文件并发出所有必要的请求以获取图像? 请说明如何处理或推荐可以简化我工作的现有解决方案。

谢谢。

Zend Framework的atom feed阅读器将轻松解析该feed。

http://framework.zend.com/manual/zh/zend.feed.using-atom.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM