热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

UsingWCFServiceswithPHP

UsingWCFServiceswithPHP:IrecentlywrotetwopostingsonthesubjectofWCFservices:WCFServices?Let
I recently wrote two postings on the subject of WCF services: WCF Services ? Let's Get Started and WCF and Unit Tests. One could see that creating and testing services was not complicated at all. Let's go on and take some steps nearer to the real world ? our service is used by SOAP clients running on different platforms.

I conducted my first experiment with PHP. PHP is widely used in the world of the Web and in all likelihood there will dawn a day when DT is asked just for such an integration. As PHP4 development and support is soon going to be discontinued, I didn't bother with an example using PHP4 SOAP tools. PHP5 is on the market and it comes with a quick and stable SOAP library. The performance is many times better than in case of similar widgets written for PHP4.

I have Apache and PHP5 running on Windows and for SOAP support I have to use an extension named php_soap.dll. Thus, I have to remove the comment mark in front of the appropriate php.ini line and restart Apache.

As an example I will present a PHP code calling the service's Add() method and writing the result on the screen. An example of WCF code can be found in our blog, in the posting WCF Services ? Let's Get Started.

x = 2.5;$obj->y = 3.5;$retval = $client->Add($obj);echo "2.5 + 3.5 = " . $retval->AddResult;?>

If nothing went wrong, the result should be something like this:

WCF Test 2.5 + 3.5 = 6

As you can see, using WCF services in PHP is very simple. The SOAP library provided along with PHP5 does a great deal of the work "behind the curtains", leaving us with an easily readable brief code.

推荐阅读
  • 开发笔记:Xunit测试使用个人小结
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了Xunit测试使用个人小结相关的知识,希望对你有一定的参考价值。因工作中用到xunit测试,故总结下用法,以供个人参考使 ... [详细]
  • C#设计模式(8)——桥接模式(Bridge Pattern)
    原文地址:http:www.cnblogs.comzhilipBridgePattern.html原文作者:Learninghard原文出处:博客园一、引言 ... [详细]
  • 缓冲区溢出实例(一)–Windows
    一、基本概念缓冲区溢出:当缓冲区边界限制不严格时,由于变量传入畸形数据或程序运行错误,导致缓冲区被填满从而覆盖了相邻内存区域的数据。可以修改内存数据,造成进程劫持,执行恶意代码,获 ... [详细]
  • 本文介绍了如何使用C#制作Java+Mysql+Tomcat环境安装程序,实现一键式安装。通过将JDK、Mysql、Tomcat三者制作成一个安装包,解决了客户在安装软件时的复杂配置和繁琐问题,便于管理软件版本和系统集成。具体步骤包括配置JDK环境变量和安装Mysql服务,其中使用了MySQL Server 5.5社区版和my.ini文件。安装方法为通过命令行将目录转到mysql的bin目录下,执行mysqld --install MySQL5命令。 ... [详细]
  • 导读:今天编程笔记来给各位分享关于php动态扩展怎么加载的相关内容,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!本文目录一览: ... [详细]
  • rtemsapi用户指南Elixir代表了相对较新的编程语言,面向更广泛的受众。它于2011年发布,此后一直在开发中。他的主要特征是取消功能范式 ... [详细]
  • Java发布webservice应用并发送SOAP请求调用
    webservice框架有很多,比如axis、axis2、cxf、xFire等等,做服务端和做客户端都可行,个人感觉使用这些框架的好处是减少了对于接口信息的解析,最主要的是减少了对于传递于网络中XML ... [详细]
  • CAS介绍CAS(CentralAuthenticationService),是耶鲁大学开发的单点登录系统(SSO,singlesign-on),应用广泛,具有独立于平台的,易于理解,支持代 ... [详细]
  • IPVlan 详解
    文章目录简介Ipvlan2同节点Ns互通Ns内与宿主机通信第三种方法Ns到节点外部结论Ipvlan31.同节点Ns互通Ns内与宿主机通信Ns内到外部网络总结源码分析ipvlan收包 ... [详细]
  • 只能输入数字的TextBox
    只能接受数字1usingSystem;2usingSystem.Text;3usingSystem.Web;4usingSystem.Web.UI;5usingSystem.Web ... [详细]
  • Spring Cloud笔记Spring Cloud Stream消息驱动(十五)
    1.消息驱动概述1.SpringCloudStream是什么SpringCloudStream是一个构建消息驱动微服务的框架。应用程序通过Inpust和Outputs与Spri ... [详细]
  • 缓存的重要性就不用再强调了,@OutputCache给我们提供了一种声明的方式(对应的还有编程的方式)来控制页面和用户控件的缓存策略,这是一种最简单直接的网站优化方式。还是先来过一遍@ ... [详细]
  • Today,IstartedtocreateacoupleofJSPpagesfortheserver-sidepartofmyMScthesisprojectinordertob ... [详细]
  • 本文整理了Java中com.google.gwt.user.client.ui.RootPanel.detachOnWindowClose方法的一些代码示例,展示了 ... [详细]
  • 向QTextEdit拖放文件的方法及实现步骤
    本文介绍了在使用QTextEdit时如何实现拖放文件的功能,包括相关的方法和实现步骤。通过重写dragEnterEvent和dropEvent函数,并结合QMimeData和QUrl等类,可以轻松实现向QTextEdit拖放文件的功能。详细的代码实现和说明可以参考本文提供的示例代码。 ... [详细]
author-avatar
幸福的FRN
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有